-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat(explore): Move chart actions into dropdown #19446
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19446 +/- ##
=======================================
Coverage 66.57% 66.58%
=======================================
Files 1675 1676 +1
Lines 64092 64172 +80
Branches 6519 6525 +6
=======================================
+ Hits 42672 42731 +59
- Misses 19729 19742 +13
- Partials 1691 1699 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
ec1d468
to
0f10e44
Compare
It feels strange that the "Share chart by email" and "Embed code" are in the dropdown, while the permalink button is in the header, as I assume people will consider them similar use cases. I can see myself clicking on the action button and wondering where the permalink item is. Would one of these make sense?
|
Thanks for comments. Personally I like the 1st option the most, but I guess @kasiazjc would probably want to chime in 🙂 |
Good point @villebro! I agree, 1st option would work best. In that case we can remove the icon from the header So we don't duplicate the actions. |
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 with a few minor comments
import * as chartAction from 'src/components/Chart/chartAction'; | ||
import * as downloadAsImage from 'src/utils/downloadAsImage'; | ||
import fetchMock from 'fetch-mock'; | ||
import * as exploreUtils from 'src/explore/exploreUtils'; |
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.
nit: importing *
always makes me cringe, but in a test I guess it's acceptable 😛
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 don't like that either, but I think that syntax is necessary to use sinon.spy
<Menu.Item key={MENU_KEYS.EMBED_CODE}> | ||
<ModalTrigger | ||
triggerNode={ | ||
<span data-test="embed-code-button">{t('Embed code')}</span> |
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.
minor comment: I'd kinda prefer to see "Embed code" below "Share chart via email"
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.
👍
* feat(explore): Move chart actions to a dropdown menu * Fix tests and add some new ones * Add background color to embed code button * Fix cypress tests * Move copy permalink to actions menu * Remove unused function * Move share by email above embed code * Fix test * Fix test * Fix test * Fix test * Fix test
SUMMARY
This PR is a stage 1 of chart header redesign.
It focuses on moving the action button into a dropdown menu to declutter the header.
List of changes:
Final design available in discussion: #19099
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2022-03-30.at.21.13.39.mov
TESTING INSTRUCTIONS
Verify that all action in the dropdown menu work exactly the same as they did before moving them to dropdown
ADDITIONAL INFORMATION
CC @kasiazjc