You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2022/01/27 01:05:13 UTC

[superset] 03/12: fix(Dashboard): Copy dashboard with duplicating charts 500 error (#17707)

This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch 1.4
in repository https://gitbox.apache.org/repos/asf/superset.git

commit dbe43b8ca6d84f9719707750fdcb50a06994d490
Author: Geido <60...@users.noreply.github.com>
AuthorDate: Fri Dec 10 01:25:01 2021 +0200

    fix(Dashboard): Copy dashboard with duplicating charts 500 error (#17707)
    
    * Fix copy dashboard with charts
    
    * Fix Cypress test
---
 .../cypress-base/cypress/integration/dashboard/save.test.js       | 8 +++++---
 superset-frontend/src/dashboard/actions/dashboardState.js         | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js b/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js
index a4d3fba..5f28f20 100644
--- a/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js
+++ b/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js
@@ -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');
   });
 
diff --git a/superset-frontend/src/dashboard/actions/dashboardState.js b/superset-frontend/src/dashboard/actions/dashboardState.js
index edee215..c3fb252 100644
--- a/superset-frontend/src/dashboard/actions/dashboardState.js
+++ b/superset-frontend/src/dashboard/actions/dashboardState.js
@@ -349,7 +349,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;
     }