superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: After saving slice fixing redirect (#3572)
Date Tue, 03 Oct 2017 01:19:55 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 064363d  After saving slice fixing redirect (#3572)
064363d is described below

commit 064363df78da2a490a297b91fb07dd5c095548b7
Author: michellethomas <michelle.q.thomas@gmail.com>
AuthorDate: Mon Oct 2 18:19:52 2017 -0700

    After saving slice fixing redirect (#3572)
---
 .../javascripts/explore/components/SaveModal.jsx     |  6 +++++-
 superset/views/core.py                               | 20 +++++++++++---------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/superset/assets/javascripts/explore/components/SaveModal.jsx b/superset/assets/javascripts/explore/components/SaveModal.jsx
index 9de8353..2939f2e 100644
--- a/superset/assets/javascripts/explore/components/SaveModal.jsx
+++ b/superset/assets/javascripts/explore/components/SaveModal.jsx
@@ -108,7 +108,11 @@ class SaveModal extends React.Component {
     this.props.actions.saveSlice(saveUrl)
       .then((data) => {
         // Go to new slice url or dashboard url
-        window.location = data.slice.slice_url;
+        if (gotodash) {
+          window.location = data.dashboard;
+        } else {
+          window.location = data.slice.slice_url;
+        }
       });
     this.props.onHide();
   }
diff --git a/superset/views/core.py b/superset/views/core.py
index d068997..23a3993 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1194,16 +1194,18 @@ class Superset(BaseSupersetView):
             dash.slices.append(slc)
             db.session.commit()
 
+        response = {
+            "can_add": slice_add_perm,
+            "can_download": slice_download_perm,
+            "can_overwrite": is_owner(slc, g.user),
+            'form_data': form_data,
+            'slice': slc.data,
+        }
+
         if request.args.get('goto_dash') == 'true':
-            return dash.url
-        else:
-            return json_success(json.dumps({
-                "can_add": slice_add_perm,
-                "can_download": slice_download_perm,
-                "can_overwrite": is_owner(slc, g.user),
-                'form_data': form_data,
-                'slice': slc.data,
-            }))
+            response.update({'dashboard': dash.url})
+
+        return json_success(json.dumps(response))
 
     def save_slice(self, slc):
         session = db.session()

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message