Skip to content

Commit

Permalink
fix: Form data was not being passed to save/update slice (apache#22989)
Browse files Browse the repository at this point in the history
(cherry picked from commit c9b9b74)
  • Loading branch information
michael-s-molina authored and AnushaErrabelli committed Feb 6, 2023
1 parent cef0e74 commit 3dc128d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions superset-frontend/src/explore/components/SaveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
);
}

const { url_params, ...formData } = this.props.form_data || {};

let dashboard: DashboardGetResponse | null = null;
if (this.state.newDashboardName || this.state.saveToDashboardId) {
let saveToDashboardId = this.state.saveToDashboardId || null;
Expand All @@ -216,14 +218,13 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
sliceDashboards = sliceDashboards.includes(dashboard.id)
? sliceDashboards
: [...sliceDashboards, dashboard.id];
const { url_params, ...formData } = this.props.form_data || {};
this.props.actions.setFormData({
...formData,
dashboards: sliceDashboards,
});
formData.dashboards = sliceDashboards;
}
}

// Sets the form data
this.props.actions.setFormData({ ...formData });

// Update or create slice
let value: { id: number };
if (this.state.action === 'overwrite') {
Expand Down

0 comments on commit 3dc128d

Please sign in to comment.