kgabryje opened a new pull request #18215:
URL: https://github.com/apache/superset/pull/18215


   ### SUMMARY
   Currently, when user switches datasource, controls such as metrics, group 
by, filters etc. are being reset. This PR changes that behaviour - after 
switching datasource, controls that use columns or saved metrics that are 
present in both previous and current datasource are preserved. After that, we 
display an alert that let's user decide if they want to reset the chart config 
or keep the changes. If there were no controls using columns nor metrics that 
matched the new dataset, we display a "warning" alert that informs user that 
chart config was reset.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   
https://user-images.githubusercontent.com/15073128/151549614-98b0baa9-2635-4c33-8908-1f255ba5ae0b.mov
   
   
https://user-images.githubusercontent.com/15073128/151549652-ff6caa55-23e4-494c-9e27-96084863f9f9.mov
   
   ### TESTING INSTRUCTIONS
   1. Open a chart
   2. Add some columns and metrics to controls
   3. Change dataset
   4. If some of the columns or metrics that you used in controls are present 
in the new dataset, an info alert should appear with 2 button - "Clear form" 
and "Continue". Clicking "Continue" should close the alert, clicking "Clear 
form" should reset the controls and close the alert.
   5. If none of the columns or metrics that you used in controls are present 
in the new dataset, a warning alert should appear with button "Continue", that 
closes the alert.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   CC @kasiazjc


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to