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
fix: Visualization settings were lost when editing a datasource from Explore #10092
fix: Visualization settings were lost when editing a datasource from Explore #10092
Conversation
@willbarrett there are a few tests for the exploreReducer here |
Thanks @nytai - I'll add a few more. |
I also noticed this yesterday and was surprised. Thanks for the fix! |
Codecov Report
@@ Coverage Diff @@
## master #10092 +/- ##
==========================================
- Coverage 70.63% 65.80% -4.84%
==========================================
Files 592 590 -2
Lines 31191 31139 -52
Branches 3191 3163 -28
==========================================
- Hits 22032 20490 -1542
- Misses 9050 10471 +1421
- Partials 109 178 +69
Continue to review full report at Codecov.
|
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.
Code LGTM.
Just a note that this will also keep the settings when changing to a different datasource, which leaves invalid selected columns sometimes (probably doesn't matter though).
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, assuming the tests failed before making this change. and thanks so much for tracking this bug down!
also, could you add a test plan to the summary prior to merging? Thanks!
SUMMARY
When working on a visualization in Explore, if there were changes to the visualization that had not been "run" via the "Run Query" button, they would be lost when editing the related datasource via the modal on the page.
Why? The reducer that updated the
form_data
when a form component changed was broken in such a way that it would update the control settings to make the change visible, but not theform_data
settings to make the change durable.This PR retains the behavior of not updating the encoded data in the URL until the "Run Query" button is pressed.
Question for the community: are there any tests for any of the reducers in Superset? Can someone point me to an example? I'd love to write some tests for this change to avoid a regression.
Also, big props to @nytai for walking me through the Explore front-end code and helping me track this one down.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
Explore
Save
in the modalConfirm
ADDITIONAL INFORMATION