-
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] allow adding multiple layers #67544
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
x-pack/plugins/maps/public/classes/sources/es_search_source/create_source_editor.js
Outdated
Show resolved
Hide resolved
closeFlyout: () => dispatch<any>(clearTransientLayerStateAndCloseFlyout()), | ||
closeFlyout: () => { | ||
dispatch(updateFlyout(FLYOUT_STATE.NONE)); | ||
dispatch<any>(removePreviewLayers()); |
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.
There are a few other places where we're closing the flyout but not removing preview layers. We might want to create an action called something like closeFlyoutAndClearTempLayers
that calls updateFlyout(FLYOUT_STATE.NONE)
and also clears all preview and selected layers so we don't miss any cases.
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.
Where are those places? I suspect that in those places, it is not possible to have preview layers. In the last couple of minors, we have updated the UI to avoid opening flyout when its already opened to avoid having to do weird clean-ups like this.
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.
I suspect that in those places, it is not possible to have preview layers
That might be obvious now but may not be as obvious for devs that come after. It's difficult to know for sure which flyout close actions should coincide with what clean up, whereas I find it very easy to reason about:
An action that cancels or completes layer adding can always:
- clean up any temp layers since temp layers are an add layer construct
- close flyout
All that said, this doesn't need to hold up this PR. This might be more of an offline architectural discussion.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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 really nice! It also opens up the possibility (with some more work) of previewing and uploading multiple files to a single index. lgtm!
- code review
- tested locally in chrome
* [Maps] allow adding multiple layers * update RenderWizardArguments arguments * fix toc_entry jest test * fix tslint error * cleanup * remove __transientLayerId from store signature * rename setSelectedLayerToFirstPreviewLayer * revert changes to es_search_source/create_source_editor.js
* [Maps] allow adding multiple layers * update RenderWizardArguments arguments * fix toc_entry jest test * fix tslint error * cleanup * remove __transientLayerId from store signature * rename setSelectedLayerToFirstPreviewLayer * revert changes to es_search_source/create_source_editor.js Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Fixes #67505
This PR updates "add layer" to support wizards that return multiple layers. This is required for a wizard to created pew pew map