-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] Add handling for shareable saved objects #111195
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: |
|
||
interface MapRefreshConfig { | ||
isPaused: boolean; | ||
interval: number; | ||
} | ||
|
||
export interface Props { | ||
spacesApi?: SpacesPluginStart; | ||
http: HttpStart; |
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.
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
const UsageTracker = | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
||
interface MapRefreshConfig { | ||
isPaused: boolean; | ||
interval: number; | ||
} | ||
|
||
export interface Props { | ||
spacesApi?: SpacesPluginStart; |
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.
Get spacesStartApi from kibana_services instead of passing in to be consistent with how other dependencies are provided
@@ -152,6 +153,23 @@ export class MapEmbeddable | |||
this.onFatalError(e); | |||
return; | |||
} | |||
try { |
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.
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
references
fieldThe 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.0
Testing PR
Follow the instructions for loading sample data outlined here. Review different outcomes in the 3 different spaces created.