-
Notifications
You must be signed in to change notification settings - Fork 14k
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): Replace overlay with alert banner when chart controls change #19696
Conversation
@@ -0,0 +1,127 @@ | |||
/** |
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 ControlPanelAlert
, just renamed. No need to review this file
Codecov Report
@@ Coverage Diff @@
## master #19696 +/- ##
==========================================
+ Coverage 66.49% 66.51% +0.01%
==========================================
Files 1689 1690 +1
Lines 64614 64616 +2
Branches 6650 6656 +6
==========================================
+ Hits 42966 42978 +12
+ Misses 19947 19937 -10
Partials 1701 1701
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@kgabryje Ephemeral environment spinning up at http://54.200.67.72:8080. Credentials are |
d6a2e0b
to
35bc351
Compare
tested PR locally, did not find major issue, LGTM |
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! A few minor comments, but overall I think this is a great improvement! Also, thanks for the cleanup, this change again leaves the codebase slightly more readable and performant 👍
? t( | ||
'Drag and drop values into highlighted field(s) in the control panel. Then run the query by clicking on the "Create chart" button.', | ||
) | ||
: t( | ||
'Select values in highlighted field(s) in the control panel. Then run the query by clicking on the "Create chart" button.', | ||
); |
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.
Not something you're changing here, but to get rid of a ternary, I wonder if we couldn't get away with just one message here. As the current default supports both dragging and dropping and clicking on the ghost button, the "Select values in highlighted field(s) in the control panel" message could IMO be an ok message for both DnD and non-DnD scenarios.
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.
Sounds good 👍
queriesResponse = [], | ||
isDeactivatedViz = false, | ||
width, | ||
} = this.props; | ||
|
||
const isLoading = chartStatus === 'loading'; | ||
const isFaded = refreshOverlayVisible && !errorMessage; | ||
const isFaded = chartIsStale && !errorMessage; |
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.
As we're no longer fading, this variable should probably be renamed
? t( | ||
'Drag and drop values into highlighted field(s) in the control panel. Then run the query by clicking on the "Update chart" button.', | ||
) | ||
: t( | ||
'Select values in highlighted field(s) in the control panel. Then run the query by clicking on the "Update chart" button.', | ||
); |
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.
As this is identical to the text in src/components/Chart/Chart.tsx
, we should perhaps consider placing these strings in a constants.ts
to ensure they stay the same (otherwise someone might only update one but not the other).
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.
Not exactly identical - the other one says "Create chart", this one "Update chart". Though we should probably make it more generic, like move to a function with argument isCreating
or isUpdating
35bc351
to
7114545
Compare
Ephemeral environment shutdown and build artifacts deleted. |
…change (apache#19696) * Rename explore alert * Rename refreshOverlayVisible to chartIsStale * Implement banners * Add tests * Add clickable text to empty state * Fix viz type switching * styling changes * Fixes after rebasing * Code review fixes * Fix bug * Fix redundant refreshing
SUMMARY
Before, when user made some changes to controls, we displayed an overlay with "Run query" button. This PR removes that overlay and introduces an alert banner that tells the user that some controls have changed and that they should click "Update chart" button. Thanks to that, the user can still view their chart while doing changes to controls.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2022-04-13.at.18.50.32.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
CC @kasiazjc