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
  • Loading branch information
michael-s-molina authored and PawankumarES committed Feb 13, 2023
1 parent bb8079c commit 3810929
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 3810929

Please sign in to comment.