fix: Form data was not being passed to save/update slice (#22989)

This commit is contained in:
Michael S. Molina 2023-02-03 14:04:17 -05:00 committed by GitHub
parent ae155611dc
commit c9b9b7404a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
@ -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') {