From ef6c198067d8ac223716fcd2af195788ddfefe03 Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Wed, 1 Dec 2021 20:35:55 +0200 Subject: [PATCH] Revert "fix(Dashboard): Only apply changes when editing properties (#17392)" (#17618) This reverts commit 0712be4c124ff90152d80c8bb11444415db4a7c7. (cherry picked from commit 8963cca265ee6457542eeb22c33e31e1858e664c) --- .../integration/dashboard/edit_properties.test.ts | 2 +- .../HeaderActionsDropdown.test.tsx | 11 +---------- .../src/dashboard/components/Header/index.jsx | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts index 1cb84b3401aee..9e2fe49288625 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/edit_properties.test.ts @@ -103,7 +103,7 @@ describe('Dashboard edit action', () => { // save edit changes cy.get('.ant-modal-footer') - .contains('Apply') + .contains('Save') .click() .then(() => { // assert that modal edit window has closed diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx index d6d20c8e473c3..1b1cb30424e8f 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { render, screen, waitFor } from 'spec/helpers/testing-library'; +import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import fetchMock from 'fetch-mock'; import { HeaderDropdownProps } from 'src/dashboard/components/Header/types'; @@ -198,12 +198,3 @@ test('should show the properties modal', async () => { userEvent.click(screen.getByText('Edit dashboard properties')); expect(editModeOnProps.showPropertiesModal).toHaveBeenCalledTimes(1); }); - -test('should display the Apply button when opening the modal', async () => { - render(setup(editModeOnProps)); - await openDropdown(); - userEvent.click(screen.getByText('Edit dashboard properties')); - waitFor(() => { - expect(screen.getByRole('button', { name: 'Apply' })).toBeInTheDocument(); - }); -}); diff --git a/superset-frontend/src/dashboard/components/Header/index.jsx b/superset-frontend/src/dashboard/components/Header/index.jsx index 4dff0e40c649f..1fb26eb0cc914 100644 --- a/superset-frontend/src/dashboard/components/Header/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/index.jsx @@ -629,7 +629,6 @@ class Header extends React.PureComponent { ); } }} - onlyApply /> )}