ktmud opened a new pull request #10284:
URL: https://github.com/apache/incubator-superset/pull/10284


   ### SUMMARY
   
   Follow up for #10283 .
   
   Even after re-enable the "Edit datasource" menu item, the datasource edit 
modal doesn't actually update current control state---users have to refresh the 
page to see their datasource updated. This is because the `actions` object 
passed to `mapStateToProps` is not the actual reducer dispatch function, but 
the methods to generate dispatch payload.
   
   The functionality was broken because #10224 and #10264 simplified how 
`mapStateToProps` is called and removed `actions` from `mapStateToProps`'s 
signature. Since `DatasourceControl` is the only place where `actions` 
dispatchers are needed for `mapStateToProps`, and all controls actually 
[already accepts `actions` as 
props](https://github.com/apache/incubator-superset/blob/700429f431d20b624e886cf554b2b493793448be/superset-frontend/src/explore/components/ControlPanelsContainer.jsx#L95),
 it makes sense to keep the function simple and refactor `DatasourceControl` 
instead.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A
   
   ### TEST PLAN
   
   1. Edit a datasource. We recommend start from a table chart.
   2. After saving the datasource, you should be able to see the changes to 
datasource columns, metrics, etc in the controls without refreshing the page.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue:
   - [x] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


----------------------------------------------------------------
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.

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