You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by gi...@git.apache.org on 2017/09/15 04:31:58 UTC

[GitHub] mistercrunch commented on a change in pull request #3466: Allow user update slice title in visualize flow

mistercrunch commented on a change in pull request #3466: Allow user update slice title in visualize flow
URL: https://github.com/apache/incubator-superset/pull/3466#discussion_r139062403
 
 

 ##########
 File path: superset/assets/javascripts/explore/components/ChartContainer.jsx
 ##########
 @@ -152,15 +152,20 @@ class ChartContainer extends React.PureComponent {
     this.props.actions.runQuery(this.props.formData, true, this.props.timeout);
   }
 
-  updateChartTitle(newTitle) {
+  updateChartTitleOrSaveSlice(newTitle) {
+    const isNewSlice = !this.props.slice;
     const params = {
       slice_name: newTitle,
-      action: 'overwrite',
+      action: isNewSlice ? 'saveas' : 'overwrite',
     };
     const saveUrl = getExploreUrl(this.props.formData, 'base', false, null, params);
     this.props.actions.saveSlice(saveUrl)
-      .then(() => {
-        this.props.actions.updateChartTitle(newTitle);
+      .then((data) => {
+        if (isNewSlice) {
+          window.location = data;
 
 Review comment:
   Is a round trip necessary? As a user it may be confusing.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services