[NP] Migrate uiSettings owned by Kibana app#64321
Conversation
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
nreese
left a comment
There was a problem hiding this comment.
Maps changes LGTM
code review
src/plugins/saved_objects_management/public/management_section/mount_section.tsx
Outdated
Show resolved
Hide resolved
pgayvallet
left a comment
There was a problem hiding this comment.
I'm +1 with @restrry's comment here:
I wonder if moving the uiSettings name constants to their respective new owners and exposing these constants to other plugins is really the correct approach here.
Main issue with this is that you can import / use settings declared from plugins you don't have a declared dependency with (see first review comment)
I think exposing accessors to the settings via their owners contracts is probably more compliant with KP way of doing things, and will also ensure that you cannot use/access settings from plugins you don't depend on.
Accessing a setting from within the owner plugin's code would remain unchanged
import { MAX_BUCKETS_SETTING } from '../common/constants';
const maxBuckets = config.get(MAX_BUCKETS_SETTING);But accessing a setting owned by another plugin would be something like
const externalSetting = startDeps.dependencyPlugin.settings.getMaxBuckets()I'm aware these are way more impactful changes than this PR's implementation, but I really think that's the way to go.
@restrry / @joshdover are we on the same page?
src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts
Outdated
Show resolved
Hide resolved
…ettings - no consumers need to set this value via initialPageSize
…to setting accessors
|
I agree with that plugins should only have access to the settings that either (1) Core exposes (2) plugins they depend on expose (3) they own themselves. I also think that to accomplish that we need a much larger change to how this service works in order to enforce those boundaries. Same goes for saved object types. We probably shouldn't allow arbitrary access to any SO type. So maybe for now we try to follow the pattern @pgayvallet laid out above where it's easy & feasible, but if there are some cases that don't fit nicely into that pattern we can solve that separately later? |
I do agree and I'm currently adapting the PR to the pattern @pgayvallet suggested, where possible |
| schema: schema.arrayOf(schema.string()), | ||
| }, |
There was a problem hiding this comment.
Optional: I'm wondering whether we know all of them to declare validation as a union of well-known strings.
There was a problem hiding this comment.
here are mapping fields. but not all e.g. _score of the query context is missing, think it should stay flexible, just in case
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-fields.html
src/plugins/visualize/public/application/listing/visualize_listing.js
Outdated
Show resolved
Hide resolved
flash1293
left a comment
There was a problem hiding this comment.
Tested against current master and all settings are still there. LGTM.
While looking through the code I noticed we need to do the same thing for a bunch of timelion settings, I will create a separate issue for that.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
| import { fieldWildcardMatcher } from '../../../../../../../../../plugins/kibana_utils/public'; | ||
| import { IndexPatternManagementStart } from '../../../../../../../../../plugins/index_pattern_management/public'; | ||
| import { IndexPattern, IndexPatternField } from '../../../../../../../../../plugins/data/public'; | ||
| import { META_FIELDS_SETTING } from '../../../../../../../../../plugins/data/common'; |
There was a problem hiding this comment.
If I'm not wrong we are trying to avoid imports from /common folder.
Also I think that this approach introduce a lot of fields in our static contract which also not good.
Maybe we can move all into one variable:
const UI_SETTINGS = {
META_FIELDS_SETTING: 'meta_field',
DEFAULT_QUERY_LANGUAGE: 'kuery',
META_FIELDS_SETTING: `'metaFields',`
}
There was a problem hiding this comment.
sorry, seems we had a comment/merge race condition. seen this comment after the merge. since this part of Kibana was in the legacy world, and it's currently migrated, this could be done in or after #65026
* Move META_FIELDS_SETTING, DOC_HIGHLIGHT_SETTING to data plugin.ts * Refactor table_list_view.tsx to no longer get PER_PAGE_SETTING by uiSettings * Migrate graph, visualize, dashboard usage of saved_objects module constants to accessor functions * Remove redundant logging in plugins start and setup methods Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co> # Conflicts: # src/plugins/data/public/index_patterns/index_patterns/index_pattern.ts
* Move META_FIELDS_SETTING, DOC_HIGHLIGHT_SETTING to data plugin.ts * Refactor table_list_view.tsx to no longer get PER_PAGE_SETTING by uiSettings * Migrate graph, visualize, dashboard usage of saved_objects module constants to accessor functions * Remove redundant logging in plugins start and setup methods Co-authored-by: Maryia Lapata <mary.lopato@gmail.com> Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
* master: (191 commits) [Maps] Get number of categories from palette (elastic#66454) move oss features registration to KP (elastic#66524) [kbn/plugin-helpers] typescript-ify (elastic#66513) Add kibana-operations as codeowners for .ci/es-snapshots and vars/ (elastic#66746) FTR: move basic services under common folder (elastic#66563) Migrate Beats Management UI to KP (elastic#65791) [CI] Add 20 minutes to overall build timeout lint import from restricted zones for export exressions (elastic#66588) [SIEM][Detection Engine] Add validation for Rule Actions (elastic#63332) KP plugins shouldn't need package.json (elastic#66654) Replace agent metrics link with the new one (elastic#66632) [CI] Add one retry to setup step (elastic#66638) [CI] Add slack alerts to tracked branch jobs, change default channel, change formatting (elastic#66580) [docLinks] Add docLinks to CoreSetup. (elastic#66631) [DOCS] Rename monitoring collection from internal to legacy (elastic#65781) unskip newsfeed tests (elastic#66562) [NP] Migrate uiSettings owned by Kibana app (elastic#64321) [ML] Functional tests - stabilize typing in DFA mml input (elastic#66706) [Map] return bounding box for static feature collection without joins (elastic#66607) remove trailing slash in graph sample data links (elastic#66358) ...
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
Summary
Fixes #63597.
This PR migrates the following ui settings to the new platform:
discover:defaultColumnsdiscover:sampleSizediscover:aggs:terms:sizediscover:sort:defaultOrderdiscover:searchOnPageLoaddoc_table:hideTimeColumnfields:popularLimitcontext:defaultSizecontext:stepcontext:tieBreakerFieldsdata:metaFieldsdoc_table:highlightcharts:visualization:colorMappingvis_type_vislib:visualization:dimmingOpacityvisualization:heatmap:maxBucketssaved_objects:savedObjects:perPagesavedObjects:listingLimitvis_type_timeseries:metrics:max_bucketsvisualization:loadingDelaysince it's unused.i18nIDs were updated respectively.