-
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
[Lens] visualize in maps button #98677
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.
I know this is in draft, so I've left the smallest review I can.
x-pack/plugins/lens/public/indexpattern_datasource/visualize_geo_field_button.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/indexpattern_datasource/visualize_geo_field_button.tsx
Outdated
Show resolved
Hide resolved
@nreese @wylieconlon I wrote down an idea how to implement the second part of this feature (custom workspace drop target that leads to maps): https://gist.github.com/flash1293/3a55232eb1f0162125ad3aa8e1ac3f99 |
I wonder if we really want to show that geo point if there would be no action available for that trigger, or if we should already make listing those fields (and not just disabling the button within the popover) dependant on whether there is an action available? |
Agree with that @timroes - if the action is not available we should hide the field in the list. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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 pretty good already. Do you need some help to polish the UI? Or did you plan to do that after the general feature is working?
One thing we should probably think about: If the user came to Lens from dashboard and goes to maps via the action, the connection to dashboard is lost and the maps "Save" button will prompt them to select a dashboard again. Are we fine with that? Or should we find a way to pass this information along?
I will need help creating the icon from the screen shots in the demo. Also, any other suggestions would be helpful as well but I have mainly been focused on getting the functionality working |
@cchaos or @MichaelMarcialis Can you assist getting the icon out of the mockups here? #80078 |
Resolved
Functional test added to lens suite
I am fine having this work done in a separate PR since it could balloon in scope. |
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 almost good to me except for the a11y message when dragging to the new drop zone. The best solution I can think of (maybe someone else has a better idea) is to extend HumandData
by something like specialCallout?: string
which overwrites the default announcement and then setting it to something like Visualize {field} in Maps
...lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss
Outdated
Show resolved
Hide resolved
const dragDropIdentifier = { | ||
id: 'lnsGeoFieldWorkspace', | ||
humanData: { | ||
label: i18n.translate('xpack.lens.geoFieldWorkspace.workspaceLabel', { |
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 used to construct the screen reader message if the user picks up the field using keyboard and moves it to the drop zone:
We can either add a special case for this here (extending humanData
for a special message):
: i18n.translate('xpack.lens.dragDrop.announce.selectedTarget.defaultNoPosition', { |
or think about something that fits into the existing template and makes clear this will move the user to Maps.
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.
Left some small comments and suggestions below. Also going to send along an updated SVG globe graphic. Noticed some oddities in the original illustration that I'd like to correct. Stay tuned.
.../lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx
Outdated
Show resolved
Hide resolved
...lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss
Outdated
Show resolved
Hide resolved
.../lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx
Outdated
Show resolved
Hide resolved
...lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss
Outdated
Show resolved
Hide resolved
...lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx
Outdated
Show resolved
Hide resolved
…orkspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]>
…orkspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]>
…orkspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]>
…orkspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]>
…orkspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]>
Co-authored-by: Michael Marcialis <[email protected]>
@elasticmachine merge upstream |
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.
Left one small comment below. Otherwise, looks good to me. Approving now so I don't hold you up.
.../lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx
Outdated
Show resolved
Hide resolved
…orkspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]>
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 - tested and works fine. Thanks for this!
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
* [Lens] visualize in maps button * clean up dependency injection as suggested * add custom workspace render for geo fields * tslint and finish drag and drop for geo field * convert react class to function component * prevent page reload when clicking visualize in maps button * filter allFields instead of using condition to populate fieldTypeNames to fix tslint * clean up UI * fix jest test * globe illustration * UI cleanup * functional test * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx Co-authored-by: Michael Marcialis <[email protected]> * updated globe svg * remove unused * better message for drop zone screen reader * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]> * tslint Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Michael Marcialis <[email protected]>
* [Lens] visualize in maps button * clean up dependency injection as suggested * add custom workspace render for geo fields * tslint and finish drag and drop for geo field * convert react class to function component * prevent page reload when clicking visualize in maps button * filter allFields instead of using condition to populate fieldTypeNames to fix tslint * clean up UI * fix jest test * globe illustration * UI cleanup * functional test * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.scss Co-authored-by: Michael Marcialis <[email protected]> * Update x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx Co-authored-by: Michael Marcialis <[email protected]> * updated globe svg * remove unused * better message for drop zone screen reader * Update x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx Co-authored-by: Michael Marcialis <[email protected]> * tslint Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Michael Marcialis <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Michael Marcialis <[email protected]>
Hi! I'm just popping in after doing some 7.14 testing. I like that the field is shown in the listing and can be accessed as a way to navigate to Maps: it's a nice, streamlined process users may even learn to access intentionally. Great work! |
Closes #80078
Show geo_point and geo_shape fields in Lens field list. Add visualize in maps button in field details. PR also shows a custom workspace panel when users drag geo fields into the workspace. The workspace panel has a drop zone that when the field is dropped into the zone, takes users to the maps application.