mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
After saving slice fixing redirect (#3572)
This commit is contained in:
parent
f8cc05b54e
commit
064363df78
@ -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();
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user