-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Removing stateful saved object finder #52166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing stateful saved object finder #52166
Conversation
|
Jenkins, test this. |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
| notifications: CoreSetup['notifications']; | ||
| SavedObjectFinder: React.ComponentType<any>; | ||
| savedObjects: CoreStart['savedObjects']; | ||
| uiSettings: CoreSetup['uiSettings']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my own understanding: what's the difference between CoreStart and CoreSetup? Everywhere else uiSettings is read from CoreStart, so why is it here defined as property of CoreSetup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not cleanly done by me, I reverted those changes. The difference between CoreSetup and CoreStart is that they are services available during different startup phases of plugins. For the particular case of uiSettings, start and setup core should be identical so it wouldn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find more information here: https://github.com/elastic/kibana/blob/master/src/core/CONVENTIONS.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: Copied wrong link
| }, 300); | ||
|
|
||
| constructor(props: SavedObjectFinderProps) { | ||
| constructor(props: SavedObjectFinderUiProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was introducing this wrapper component necessary, instead of just introducing two new props on the existing SavedObjectFinder component? Are there still places where SavedObjectFinder is used, without uiSettings and savedObjects props?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at the moment, but this is the target architecture we are moving towards (see also #52493 ). Passing uiSettings and savedObjects services down through the component tree can be cumbersome in some cases, so the wrapper component is able to pick it out of the Kibana context: https://github.com/elastic/kibana/tree/master/src/plugins/kibana_react#context
The usages of saved object finder in embeddables will move into this direction soon. Future uses should be guided into this direction.
majagrubic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I just left two questions, mostly for my own understanding
streamich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you doing these changes to embeddables? We are in a process of refactoring embeddables where one does not need to pass all these services, like uiSettings and savedObject through props at every step but can instead consume them through React context. As I see it, your changes are basically step backwards that passes uiSettings and savedObjects services manually at every step through props—something we removed a couple of months ago.
kertal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, tested in Discover, Visualize, Dashboard, Graph in Chrome, works as expected
|
After syncing with @streamich I reverted the changes in embeddables. This means consumers of embeddables are still required to pass in a |
streamich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App Arch changes LGTM
jgowdyelastic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ML and Transform changes LGTM
crob611
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Canvas changes look good 👍
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…le-sql-highlighting * 'master' of github.com:elastic/kibana: (56 commits) Migrate url shortener service (elastic#50896) Re-enable datemath in from/to canvas timelion args (elastic#52159) [Logs + Metrics UI] Remove eslint exceptions (elastic#50979) [Logs + Metrics UI] Add missing headers in Logs & metrics (elastic#52405) [ML] API integration tests - initial tests for bucket span estimator (elastic#52636) [Watcher] New Platform (NP) Migration (elastic#50908) Decouple Authorization subsystem from Legacy API. (elastic#52638) [APM] Fix some warnings logged in APM tests (elastic#52487) [ui/public/utils] Delete unused base_object & find_by_param (elastic#52500) [ui/public/utils] Move items into ui/vis (elastic#52615) fix newlines in kbn-analytics build script Add top level examples folder and command to run, `--run-examples`. (elastic#52027) feat(NA): add trap for SIGINT in the git precommit hook (elastic#52662) [DOCS] Updtes description of elasticsearch.requestHeadersWhitelist (elastic#52675) [Telemetry/Pulse] Updates advanced settings text for usage data (elastic#52657) [SIEM][Detection Engine] Adds the default name space to the end of the signals index [Logs UI] Generalize ML module management (elastic#50662) Removing stateful saved object finder (elastic#52166) Shim oss telemetry (elastic#51168) [Reporting/Screenshots] Do not fail the report if request is aborted (elastic#52344) ... # Conflicts: # src/legacy/core_plugins/console/public/legacy.ts # src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/mode/elasticsearch_sql_highlight_rules.ts # src/legacy/core_plugins/console/public/np_ready/lib/autocomplete/components/full_request_component.ts # src/legacy/core_plugins/console/public/quarantined/src/sense_editor/row_parser.js
This PR removes the legacy
SavedObjectFinderand changes all usages to switch to the one provided bykibana_react. The biggest change is that it's now necessary to pass inuiSettingsandsavedObjectscore services to the component.