Skip to content

Commit

Permalink
fix(Dashboard): Copy dashboard with duplicating charts 500 error (#17707
Browse files Browse the repository at this point in the history
)

* Fix copy dashboard with charts

* Fix Cypress test
  • Loading branch information
geido committed Dec 9, 2021
1 parent bdc4e7a commit dad8c20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ describe('Dashboard save action', () => {
.trigger('mouseenter')
.click();

cy.get('[data-test="grid-container"]').find('.treemap').should('not.exist');
cy.get('[data-test="grid-container"]')
.find('.box_plot')
.should('not.exist');

cy.intercept('PUT', '/api/v1/dashboard/**').as('putDashboardRequest');
cy.get('[data-test="dashboard-header"]')
Expand All @@ -88,9 +90,9 @@ describe('Dashboard save action', () => {
.find('[aria-label="edit-alt"]')
.click();

// deleted treemap should still not exist
// deleted boxplot should still not exist
cy.get('[data-test="grid-container"]')
.find('.treemap', { timeout: 20000 })
.find('.box_plot', { timeout: 20000 })
.should('not.exist');
});

Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/dashboard/actions/dashboardState.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export function saveDashboardRequest(data, id, saveType) {
.catch(response => onError(response));
}
// changing the data as the endpoint requires
const copyData = cleanedData;
const copyData = { ...cleanedData };
if (copyData.metadata) {
delete copyData.metadata;
}
Expand Down

0 comments on commit dad8c20

Please sign in to comment.