[Maps] Add handling for shareable saved objects#111195
[Maps] Add handling for shareable saved objects#111195kindsun wants to merge 11 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/kibana-gis (Team:Geo) |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
|
|
||
| export interface Props { | ||
| spacesApi?: SpacesPluginStart; | ||
| http: HttpStart; |
There was a problem hiding this comment.
http does not need to be passed to MapApp, its never used. This dependency chain starts all the way in RenderApp. No need to pass http to RenderApp in public/plugin
| plugins.usageCollection?.components.ApplicationUsageTrackingProvider ?? React.Fragment; | ||
| const { renderApp } = await lazyLoadMapModules(); | ||
| return renderApp(params, UsageTracker); | ||
| return renderApp(params, UsageTracker, http, spacesApi); |
There was a problem hiding this comment.
Not sure passing spaces into renderApp this way is needed. Spaces is a start dependency and can just be grabbed from kibana_services when needed to align with how all start dependencies are obtained.
| } | ||
|
|
||
| export interface Props { | ||
| spacesApi?: SpacesPluginStart; |
There was a problem hiding this comment.
Get spacesStartApi from kibana_services instead of passing in to be consistent with how other dependencies are provided
| this.onFatalError(e); | ||
| return; | ||
| } | ||
| try { |
There was a problem hiding this comment.
Instead of handing saved object check seperatly in MapEmbeddable and MapApp, how about moving logic into a new SavedMap called something like "hasSavedObjectIdConflict"? That way all checking logic can just be part of SavedMap and consolidated into a single location.
|
Looks like Lens has already migrated to using SavedObjectClient.resolve. We should try to stay aligned with how Lens has migrated to SavedObjectClient.resolve and instead of making a separate call to SavedObjectClient.resolve, it looks like Then in the embeddable, just get sharingSavedObjectProps from attributes like this |
|
Replacing with #112606 |
Resolves #101177. Adds handling for shareable saved objects in the Maps app
In Maps app:
In Dashboard/Embeddable:
Below is an overview of the steps required to migrate current Maps app saved object usage to shareable saved objects using the dev guide
Step 1: Ensure all object links use the root level
referencesfieldThe Maps app is already doing this. It looks this was introduced in #82486
Step 2: Are there any "deep links" to these objects?
The Maps app uses deep links to load saved maps from the initial landing page. They don't appear to be used anywhere else. Handling has been added for these in this PR.
Step 3: Update your client-side code to correctly handle the three different resolve() outcomes
This is pretty much a continuation of 2 and is covered in this PR
Steps 4, 5 should be handled in a future PR for merge in version
8.0Testing PR
Follow the instructions for loading sample data outlined here. Review different outcomes in the 3 different spaces created.