-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Support by value saved objects. #82486
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
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.
Tested locally in chrome.
Code LGTM. Everything looks super clean.
Adding to library, cloning panel, and unlinking all work flawlessly with by reference and by value panels!
One issue I found is that editing 'by reference' maps from a dashboard then hitting 'save and return' doesn't apply the changes properly. You need to press 'save to maps' to see your changes. Not totally sure what's going on there.
I also have some tiny UX nits that could maybe be addressed in a followup:
-
When editing a 'by reference' map from a dashboard, the button to the left of 'save and return' still says 'save to maps'. If you're editing though that means it's already been saved to maps. In Lens, in that case, the button reads 'save as'.
-
When editing a 'by reference' panel from dashboard I would say that it makes sense to have the 'maps' breadcrumb also present - so it would be
Dashboard / Maps / My cool Map
when editing from dashboard in by reference mode. -
In both visualize and lens, new by value panels are saved with no title at all. Editing them shows something like
Dashboard / Edit visualization
in the breadcrumbs, and when you're in view mode on the dashboard, those blank titles just aren't shown. In Maps so far, by value maps are all named New Map, which means the users will have customize each panel's title, or hide the panel titles - else they will potentially have a bunch of 'New Map' on their dashboard.
Additionally, while testing I noticed that saving a map with filters applied doesn't actually apply when they are on a dashboard. This behaviour was the same in maps in 7.10 BC 4, and in 7.9.2 but I'm not sure if it's intentional or not. If not, maybe a separate issue.
Overall, this is a huge change, and will contribute a lot to the seamless feeling we hope to capture when we release Time to Visualize!
description: '', | ||
}; | ||
} else { | ||
this._attributes = await getMapAttributeService().unwrapAttributes(this._mapEmbeddableInput); |
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.
This is looking really clean!
This is as expected behavior. Query, filters, and time saved with a map are not transferred to Dashboard |
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.
this is such a fun PR to play with. kibana and maps feel twice as fast.
the simplifcation in the Maps-code is impressive.
Any ideas on how to test? It'd make sense to add some functional test for the new flow.
x-pack/plugins/maps/public/routes/map_app/map_app_container.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/routes/map_app/saved_map/saved_map.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/routes/map_app/saved_map/saved_map.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/routes/map_app/saved_map/saved_map.ts
Outdated
Show resolved
Hide resolved
@thomasneirynck - great timing with the question of adding functional tests. This PR #82441 was recently merged which should allow us to start writing tests with |
@elasticmachine merge upstream |
Thanks for pointing this out. I had a logic error where a "by reference" map was calling |
@ThomThomson Thanks for all the great feedback on the little stuff like breadcrumbs, button labels, and page titles. These are great things to make consistent with Lens to provide a cohesive user experience. I have addressed the following.
Resolved. Added proper logic to set button label when "by value" or "by reference"
Resolved. Added proper logic to include "Maps" in path when "by reference"
Resolved. Map title now defaults to empty string like lens. When you create a new map either from Maps or Dashboard, the page title is "Create". When you edit a map "by value", the page title is "Edit map". When you edit a map "by reference", the page title is the saved object title. |
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.
lgtm. So great, this flow feels really fast. Thanks for simplifying how the maps is bootstrapped in the page of the Maps-app and inside the embeddable.
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.
Tested again on Chrome. Everything works great! Thanks again for looking into those consistency nits.
LGTM
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
* [Maps] saved objects by value * inject references when unwrapping * clean up map embeddable initialize * use attribute service to load savedMap * clean up * remove clear ui since each route has its own store instance * save * update for API changes * pass input to stateTransfer * remove map saved object loader * remove unused store_operations * add saved objects to recently accessed * provide default description * break originatingApp connection when not returnToOrigin * clean up file structure * clean up adding help menu * use SavedMap in map_embeddable to remove dupicated load attributes code * clean up * restore imports * clean up breadcrumbs to match lens * fix check for duplicate title * tslint * make title map saved object attribute required * fix jest tests * fix logic for hasSaveAndReturnConfig to not show save and return button with new map and allowByValueEmbeddables disabled * tslint * fix functional test by triggering MapApp render after save * rename map_app_container to map_page * move MapApp and redux connector into folder * review feedback * use MAP_PATH constant * update by reference saved object on save and return * cleanup breadcrumbs and title * properly handle deleted map saved objects * tslint cleanup Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [Maps] saved objects by value * inject references when unwrapping * clean up map embeddable initialize * use attribute service to load savedMap * clean up * remove clear ui since each route has its own store instance * save * update for API changes * pass input to stateTransfer * remove map saved object loader * remove unused store_operations * add saved objects to recently accessed * provide default description * break originatingApp connection when not returnToOrigin * clean up file structure * clean up adding help menu * use SavedMap in map_embeddable to remove dupicated load attributes code * clean up * restore imports * clean up breadcrumbs to match lens * fix check for duplicate title * tslint * make title map saved object attribute required * fix jest tests * fix logic for hasSaveAndReturnConfig to not show save and return button with new map and allowByValueEmbeddables disabled * tslint * fix functional test by triggering MapApp render after save * rename map_app_container to map_page * move MapApp and redux connector into folder * review feedback * use MAP_PATH constant * update by reference saved object on save and return * cleanup breadcrumbs and title * properly handle deleted map saved objects * tslint cleanup Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This PR updates map embeddable and map application to support saved objects by value, allowing users to store map saved objects directly in dashboard without needed to create and maintain a separate saved object.
Testing instructions
dashboard.allowByValueEmbeddables: true
in kibana.dev.ymlcreate new
to add a panel and select maps.Save return