graceguo-supercat commented on a change in pull request #11640:
URL: 
https://github.com/apache/incubator-superset/pull/11640#discussion_r522520654



##########
File path: superset-frontend/src/explore/components/SaveModal.jsx
##########
@@ -109,19 +110,31 @@ class SaveModal extends React.Component {
     sliceParams.save_to_dashboard_id = this.state.saveToDashboardId;
     sliceParams.new_dashboard_name = this.state.newDashboardName;
 
-    this.props.actions
-      .saveSlice(this.props.form_data, sliceParams)
-      .then(({ data }) => {
-        if (data.dashboard_id === null) {
-          sessionStorage.removeItem(SK_DASHBOARD_ID);
-        } else {
-          sessionStorage.setItem(SK_DASHBOARD_ID, data.dashboard_id);
-        }
-        // Go to new slice url or dashboard url
-        const url = gotodash ? data.dashboard_url : data.slice.slice_url;
-        window.location.assign(url);
+    if (slice.slice_updated) {
+      const payload = {
+        description: slice.description || null,
+        cache_timeout: slice.cache_timeout || null,
+        owners: slice.owners || null,
+      };
+      await SupersetClient.put({

Review comment:
       So it seems these 2 modals hold different data and we have to use 2 
different API save each of them? 
   This flow seems very intuitive to me: 
   - Edit something in one Modal, save it, Modal closed. 
   - Then user have to click SAVE button in a different place, open another 
Modal, seeing some not very relative data, and save them again.
   If someone don't look at the source code and APIs, how do they understand 
this is right flow to save chart metadata? 
   
   
   




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