You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/05/11 23:06:03 UTC
[GitHub] graceguo-supercat commented on a change in pull request #4979:
Dashboard save button
graceguo-supercat commented on a change in pull request #4979: Dashboard save button
URL: https://github.com/apache/incubator-superset/pull/4979#discussion_r187751401
##########
File path: superset/assets/src/dashboard/actions/dashboardState.js
##########
@@ -81,14 +81,28 @@ export function onSave() {
return { type: ON_SAVE };
}
-export function saveDashboard() {
+export function saveDashboardRequestSuccess() {
return dispatch => {
dispatch(onSave());
// clear layout undo history
dispatch(UndoActionCreators.clearHistory());
};
}
+export function saveDashboardRequest(data, id, saveType) {
+ const path = saveType === 'overwrite' ? 'save_dash' : 'copy_dash';
+ const url = `/superset/${path}/${id}/`;
+ return dispatch =>
+ $.ajax({
+ type: 'POST',
+ url,
+ data: {
+ data: JSON.stringify(data),
+ },
+ success: () => dispatch(saveDashboardRequestSuccess()),
Review comment:
added error handle.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org