Skip to content
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] provide drag-n-drop support to order tooltip properties #46631

Merged
merged 25 commits into from
Oct 9, 2019

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 25, 2019

Part of #46581

This PR replaces the tooltip configuration UI with a new component that allows users to use drag-n-drop to order tooltip properties. The UI changes lay the foundation needed for custom tooltip labels and support for a side bar overflow when lots of properties are requested.

Screen Shot 2019-10-07 at 3 30 18 PM

Screen Shot 2019-10-07 at 3 30 26 PM

@nreese nreese added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation enhancement New value added to drive a business result v8.0.0 v7.5.0 labels Sep 25, 2019
@nreese nreese requested a review from a team as a code owner September 25, 2019 19:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis

@nreese nreese mentioned this pull request Sep 25, 2019
9 tasks
@cchaos
Copy link
Contributor

cchaos commented Sep 25, 2019

@miukimiu Is working on mocks for this at the moment. Please coordinate with her over the UI design.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit, but the flash on the droppable pane after the drag end feels delayed. I'm not sure if this is something in EUI or if there's some async function that is blocking the flash. I just feel like the flash should happen sooner.

dragend-delay

selectedFields={selectedFields}
/>
</EuiTextAlign>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could wrap this div in a collapsible element like EuiAccordion instead? It takes up a lot of real estate when someone adds a lot of fields.

@miukimiu
Copy link
Contributor

miukimiu commented Sep 27, 2019

Hi @nreese,

Here's the design I have in mind for the tooltips:

Tooltip fields not editable

When we reach more than 5 fields a <EuiCallOut /> appears saying that is not recommended. As we discussed on #44298

When the users click to add a new field a <EuiPopover /> appears. Similar to what you've done but the difference is instead of having the type of field as a title they will appear as icons.

Tooltip fields not editable-1

As you asked me, I also thought about how to rename the fields just to have for future reference:

Tooltip fields editable

The idea is you can always rename the field but you can open the card to see the real field name. This is just an initial idea and I'm happy to improve it. 😄

You can find the Figma Prototype Here

@nreese
Copy link
Contributor Author

nreese commented Sep 27, 2019

@miukimiu Thanks for the designs, they look great. I really like the idea of showing type icon instead of using a header.

Did you see Nick's suggestion about having a way to collapse the list? Where should the controls go for that suggestion?

@nickpeihl
Copy link
Member

Did you see Nick's suggestion about having a way to collapse the list? Where should the controls go for that suggestion?

IMO we may not need to collapse the element if we implement the suggested limit of five fields from @miukimiu 's mockup.

@miukimiu
Copy link
Contributor

Another suggestion could be to have all the panels collapsible and move the tooltip settings to its own card.

05-collapsible

But I think there's a reason that @nreese mentioned that the tooltip settings can't be on a different card.

@nreese
Copy link
Contributor Author

nreese commented Sep 27, 2019

But I think there's a reason that @nreese mentioned that the tooltip settings can't be on a different card.

Tooltip state is currently stored in source state. Settings panels are controlled by the layer and layer state. We would need to migrate the tooltip state from the source to the layer to move the panel to its own panel.

I think we need to do this in order to allow users to control which metrics and join fields are displayed in the tooltip tip. Right now, all metrics and joins show up in the tooltip but if we go the route of the side panel for overflow tooltip space then users will need to be able to specify which metric and joins are in the tooltip and the display order. Regardless, that work will be done in another PR

@nreese
Copy link
Contributor Author

nreese commented Oct 7, 2019

Updated add tooltip popover with FieldIcon

Screen Shot 2019-10-07 at 2 48 52 PM

@nreese
Copy link
Contributor Author

nreese commented Oct 7, 2019

@miukimiu I added a bottom border to each tooltip field instead of a box. This is more inline with the separation between metric fields for the geo-grid source that @cchaos just added. I also do not show the grab and trash icon until the hover event. This is more inline with the icons in the map legend. Thoughts?

Screen Shot 2019-10-07 at 3 03 17 PM

@nreese
Copy link
Contributor Author

nreese commented Oct 7, 2019

@nickpeihl This is ready for another look. I have fixed the flash after dragging and dropping fields. The popover now allows for the selection of multiple fields at a time.

@nreese nreese requested a review from nickpeihl October 7, 2019 21:29
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@nickpeihl nickpeihl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thanks.

@nreese nreese added release_note:enhancement and removed enhancement New value added to drive a business result labels Oct 9, 2019
@bcamper
Copy link

bcamper commented Oct 9, 2019

🎊🎊🎊

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@miukimiu miukimiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for merging the style fixes! 👍

Everything looks good to me!

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small one for you @nreese. Thanks.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese nreese merged commit e925186 into elastic:master Oct 9, 2019
nreese added a commit to nreese/kibana that referenced this pull request Oct 9, 2019
…ic#46631)

* [Maps] tooltip custom labels

* add drag handlers for re-ordering tooltip property order

* add trash button to remove property

* add jest tests for AddTooltipFieldPopover

* sort EMS file tooltip properties

* update TooltipSelector jest test

* clean up AddTooltipFieldPopover field sorting

* remove console statements

* add more styles when row is getting dragged

* change reorder aria label

* move css changes into seperate file

* allow adding multiple fields before closing popover

* clear checked state on Add

* update jest snapshots

* use FieldIcon to display field type as icon

* add bottom border to tooltip field

* avoid flash after drag and drop

* Tooltip styles (#32)

* update TooltipSelector snapshot

* replace 24px with
nreese added a commit that referenced this pull request Oct 10, 2019
… (#47771)

* [Maps] tooltip custom labels

* add drag handlers for re-ordering tooltip property order

* add trash button to remove property

* add jest tests for AddTooltipFieldPopover

* sort EMS file tooltip properties

* update TooltipSelector jest test

* clean up AddTooltipFieldPopover field sorting

* remove console statements

* add more styles when row is getting dragged

* change reorder aria label

* move css changes into seperate file

* allow adding multiple fields before closing popover

* clear checked state on Add

* update jest snapshots

* use FieldIcon to display field type as icon

* add bottom border to tooltip field

* avoid flash after drag and drop

* Tooltip styles (#32)

* update TooltipSelector snapshot

* replace 24px with
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants