From 29dd0844bf7ace9f3e69b1e73ecccc2a8213f852 Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Wed, 7 Jul 2021 10:20:15 -0700 Subject: [PATCH] refactor: icon to icons for headeractionsdropdown (#15560) * initial commit * fix test * fix cypress * fix markdown cypress test --- .../cypress/integration/dashboard/controls.test.ts | 4 ++-- .../cypress/integration/dashboard/markdown.test.ts | 2 +- .../cypress/integration/dashboard/save.test.js | 2 +- .../components/Header/HeaderActionsDropdown/index.jsx | 7 +++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts index 73587ee3acd9e..5ba40db499e37 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/controls.test.ts @@ -63,7 +63,7 @@ describe('Dashboard top-level controls', () => { // should allow force refresh WORLD_HEALTH_CHARTS.forEach(waitForChartLoad); getChartAliasesBySpec(WORLD_HEALTH_CHARTS).then(aliases => { - cy.get('[data-test="more-horiz"]').click(); + cy.get('[aria-label="more-horiz"]').click(); cy.get('[data-test="refresh-dashboard-menu-item"]').should( 'not.have.class', 'ant-dropdown-menu-item-disabled', @@ -92,7 +92,7 @@ describe('Dashboard top-level controls', () => { }); }); }); - cy.get('[data-test="more-horiz"]').click(); + cy.get('[aria-label="more-horiz"]').click(); cy.get('[data-test="refresh-dashboard-menu-item"]').and( 'not.have.class', 'ant-dropdown-menu-item-disabled', diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts index a057872e1e78f..ba5670638a0d7 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/markdown.test.ts @@ -35,7 +35,7 @@ describe('Dashboard edit markdown', () => { // lazy load - need to open dropdown for the scripts to load cy.get('[data-test="dashboard-header"]') - .find('[data-test="more-horiz"]') + .find('[aria-label="more-horiz"]') .click(); cy.get('script').then(nodes => { // load 5 new script chunks for css editor 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 b56da45b89e87..b52ff806f4783 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js @@ -42,7 +42,7 @@ describe('Dashboard save action', () => { 'copyRequest', ); - cy.get('[data-test="more-horiz"]').trigger('click', { force: true }); + cy.get('[aria-label="more-horiz"]').trigger('click', { force: true }); cy.get('[data-test="save-as-menu-item"]').trigger('click', { force: true, }); diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx index e69d4a147abd7..f839ad901e571 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import { styled, SupersetClient, t } from '@superset-ui/core'; import { Menu, NoAnimationDropdown } from 'src/common/components'; -import Icon from 'src/components/Icon'; +import Icons from 'src/components/Icons'; import { URL_PARAMS } from 'src/constants'; import ShareMenuItems from 'src/dashboard/components/menu/ShareMenuItems'; import CssEditor from 'src/dashboard/components/CssEditor'; @@ -88,6 +88,9 @@ const MENU_KEYS = { const DropdownButton = styled.div` margin-left: ${({ theme }) => theme.gridUnit * 2.5}px; + span { + color: ${({ theme }) => theme.colors.grayscale.base}; + } `; const SCREENSHOT_NODE_SELECTOR = '.dashboard'; @@ -328,7 +331,7 @@ class HeaderActionsDropdown extends React.PureComponent { } > - + );