fix(Dashboard): Copy dashboard with duplicating charts 500 error (#17707)
* Fix copy dashboard with charts * Fix Cypress test
This commit is contained in:
parent
bdc4e7a322
commit
dad8c20af7
|
|
@ -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"]')
|
||||
|
|
@ -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');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue