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

[Discover] Adds an Options menu for switching between the two table modes #97120

Merged
merged 8 commits into from
Apr 20, 2021

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Apr 14, 2021

Summary

Implements #92618 (comment)

Adds a new menu item Options which appears only to the users that have permissions to edit the advanced settings.

The link redirects to the advanced settings section with the use legacy table query in order only the setting we want to be displayed.

Link text depends on the switch status
image

image

Checklist

Delete any items that are not applicable to this PR.

@stratoula
Copy link
Contributor Author

@ryankeairns I will need your valuable feedback for the UI and the texts. Right now, I am changing only the text of the link, but I could also change the explanatory text too.

Comment on lines 48 to 52
<FormattedMessage
id="discover.topNav.openOptionsPopover.description"
defaultMessage="The new data grid layout includes better data sorting, drag-and-drop columns, and a full
screen view. Enable this option if you prefer to fall back to the legacy table."
/>
Copy link
Member

@kertal kertal Apr 15, 2021

Choose a reason for hiding this comment

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

thx a lot for taking care of this 🙇 , so here's my first thought while playing with this: I think also the link description should be different depending on which state is selected, FYI @gchaps & @shaunmcgough for finding the right words here

Choose a reason for hiding this comment

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

Perhaps: "The new data grid features faster loading, better comparison, a flyout window, enhanced options, and is going to replace the legacy table soon. Enable this option if you prefer to fall back to the legacy table."

@gchaps what say you?

@ryankeairns
Copy link
Contributor

ryankeairns commented Apr 15, 2021

Having tried this out, I have a few new thoughts:

  1. The link is not very discernible alongside the helper text. That said, I think noting the pros is worthwhile, so let's try raising the visual weight of the link relative to that text (see below).
  2. The 'Switch to...' wording feels like a mismatch of expectations since it really just takes you to the Advanced Settings page and doesn't actually switch anything. I'm thinking we need something more general/precise like 'Go to Advanced Settings' , etc. Curious what @gchaps thinks here. I've also updated the description text to better align with the button action and am suggesting we show the current mode, distinctly (this is akin to how current values are displayed under Advanced Settings).

Screen Shot 2021-04-15 at 11 27 12 AM

I'll push up a rough design PR of my local changes.

👉 Incomplete design/reference PR: stratoula#3

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

@stratoula
Copy link
Contributor Author

Thank you @ryankeairns, I really like it! I merged your PR and adjusted the unit test. We should decide now about the text, if we want this to be different and what exactly will be

@stratoula stratoula marked this pull request as ready for review April 19, 2021 07:29
@stratoula stratoula requested a review from a team April 19, 2021 07:29
@stratoula stratoula requested a review from a team as a code owner April 19, 2021 07:29
@stratoula stratoula added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Apr 19, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@stratoula stratoula changed the title [Discover] Adds an Options menu for enabling the Legacy table [Discover] Adds an Options menu for switching between the two table modes Apr 19, 2021
@ryankeairns
Copy link
Contributor

My last attempt at the wording :)

The new data grid layout includes enhanced data sorting, drag-and-drop columns, multi-document selection, and a full screen view. Toggle the 'Use legacy table' option in Advanced Settings to switch modes.

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

This looks great Stratoula! Thanks for stepping in to help and for addressing the feedback.

@gchaps
Copy link
Contributor

gchaps commented Apr 19, 2021

A minor edit:

The new data grid layout includes enhanced data sorting, drag-and-drop columns, multi-document selection, and a full screen view. Toggle 'Use legacy table' in Advanced Settings to switch modes.

@stratoula
Copy link
Contributor Author

Text was changed :)
image

Comment on lines 32 to 38
const mode = isLegacy
? i18n.translate('discover.openOptionsPopover.dataGridText', {
defaultMessage: 'Data grid',
})
: i18n.translate('discover.openOptionsPopover.legacyTableText', {
defaultMessage: 'Legacy table',
});
Copy link
Member

@kertal kertal Apr 20, 2021

Choose a reason for hiding this comment

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

this should be inverted to like (same with tests then)

isLegacy ? 'Legacy table' : 'Data grid'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are so right Matthias 😱

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :D

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM, tested locally in Chrome Firefox Safari, Mac OS. Works as expected. Thx a lot for taking care of this! This new Options would have saved me a few hours or days of navigating to switch the grid! 👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 347 357 +10

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 407.2KB 412.6KB +5.3KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@stratoula stratoula merged commit 0cec343 into elastic:master Apr 20, 2021
stratoula added a commit to stratoula/kibana that referenced this pull request Apr 20, 2021
…odes (elastic#97120)

* [Discover] Adds an Options menu for enabling the Legacy table

* Add unit test

* Layout and copy tweaks

* Update UI and fix unit test

* Change description text

* Revert legacy text mode functionality

Co-authored-by: Ryan Keairns <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
stratoula added a commit that referenced this pull request Apr 20, 2021
…odes (#97120) (#97611)

* [Discover] Adds an Options menu for enabling the Legacy table

* Add unit test

* Layout and copy tweaks

* Update UI and fix unit test

* Change description text

* Revert legacy text mode functionality

Co-authored-by: Ryan Keairns <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Ryan Keairns <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants