This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 7f2f51b refactor: icon to icons for listviewcomponent (#15408)
7f2f51b is described below
commit 7f2f51b2bdac0cf4f5de83249c1a9fe33e3546bc
Author: Phillip Kelley-Dotson <[email protected]>
AuthorDate: Thu Jul 1 11:36:16 2021 -0700
refactor: icon to icons for listviewcomponent (#15408)
* initial commit
* fix dashboard cypress tests
* fix more tests
* fix more tests
* fix listviews
---
.../cypress-base/cypress/integration/chart_list/card_view.test.ts | 2 +-
.../cypress-base/cypress/integration/chart_list/filter.test.ts | 4 ++--
.../cypress-base/cypress/integration/chart_list/list_view.test.ts | 2 +-
.../cypress/integration/dashboard_list/card_view.test.ts | 2 +-
.../cypress/integration/dashboard_list/filter.test.ts | 4 ++--
.../cypress/integration/dashboard_list/list_view.test.ts | 2 +-
superset-frontend/src/components/ListView/ListView.tsx | 8 ++++----
superset-frontend/src/views/CRUD/chart/ChartList.test.jsx | 2 +-
superset-frontend/src/views/CRUD/dashboard/DashboardList.test.jsx | 2 +-
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git
a/superset-frontend/cypress-base/cypress/integration/chart_list/card_view.test.ts
b/superset-frontend/cypress-base/cypress/integration/chart_list/card_view.test.ts
index 6910b23..1335fcb 100644
---
a/superset-frontend/cypress-base/cypress/integration/chart_list/card_view.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/chart_list/card_view.test.ts
@@ -22,7 +22,7 @@ describe('chart card view', () => {
beforeEach(() => {
cy.login();
cy.visit(CHART_LIST);
- cy.get('[data-test="card-view"]').click();
+ cy.get('[aria-label="card-view"]').click();
});
it('should load cards', () => {
diff --git
a/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
b/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
index dd9b573..6892651 100644
---
a/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts
@@ -22,7 +22,7 @@ describe('chart card view filters', () => {
beforeEach(() => {
cy.login();
cy.visit(CHART_LIST);
- cy.get('[data-test="card-view"]').click();
+ cy.get('[aria-label="card-view"]').click();
});
it('should filter by owners correctly', () => {
@@ -89,7 +89,7 @@ describe('chart list view filters', () => {
beforeEach(() => {
cy.login();
cy.visit(CHART_LIST);
- cy.get('[data-test="list-view"]').click();
+ cy.get('[aria-label="list-view"]').click();
});
it('should filter by owners correctly', () => {
diff --git
a/superset-frontend/cypress-base/cypress/integration/chart_list/list_view.test.ts
b/superset-frontend/cypress-base/cypress/integration/chart_list/list_view.test.ts
index 7b51e98..6da5d90 100644
---
a/superset-frontend/cypress-base/cypress/integration/chart_list/list_view.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/chart_list/list_view.test.ts
@@ -22,7 +22,7 @@ describe('chart list view', () => {
beforeEach(() => {
cy.login();
cy.visit(CHART_LIST);
- cy.get('[data-test="list-view"]').click();
+ cy.get('[aria-label="list-view"]').click();
});
it('should load rows', () => {
diff --git
a/superset-frontend/cypress-base/cypress/integration/dashboard_list/card_view.test.ts
b/superset-frontend/cypress-base/cypress/integration/dashboard_list/card_view.test.ts
index 35f11a1..8bfc35d 100644
---
a/superset-frontend/cypress-base/cypress/integration/dashboard_list/card_view.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/dashboard_list/card_view.test.ts
@@ -22,7 +22,7 @@ describe('Dashboard card view', () => {
beforeEach(() => {
cy.login();
cy.visit(DASHBOARD_LIST);
- cy.get('[data-test="card-view"]').click();
+ cy.get('[aria-label="card-view"]').click();
});
xit('should load cards', () => {
diff --git
a/superset-frontend/cypress-base/cypress/integration/dashboard_list/filter.test.ts
b/superset-frontend/cypress-base/cypress/integration/dashboard_list/filter.test.ts
index caff4c0..d9bf0bb 100644
---
a/superset-frontend/cypress-base/cypress/integration/dashboard_list/filter.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/dashboard_list/filter.test.ts
@@ -22,7 +22,7 @@ describe('dashboard filters card view', () => {
beforeEach(() => {
cy.login();
cy.visit(DASHBOARD_LIST);
- cy.get('[data-test="card-view"]').click();
+ cy.get('[aria-label="card-view"]').click();
});
it('should filter by owners correctly', () => {
@@ -73,7 +73,7 @@ describe('dashboard filters list view', () => {
beforeEach(() => {
cy.login();
cy.visit(DASHBOARD_LIST);
- cy.get('[data-test="list-view"]').click();
+ cy.get('[aria-label="list-view"]').click();
});
it('should filter by owners correctly', () => {
diff --git
a/superset-frontend/cypress-base/cypress/integration/dashboard_list/list_view.test.ts
b/superset-frontend/cypress-base/cypress/integration/dashboard_list/list_view.test.ts
index 045d43c..a758552 100644
---
a/superset-frontend/cypress-base/cypress/integration/dashboard_list/list_view.test.ts
+++
b/superset-frontend/cypress-base/cypress/integration/dashboard_list/list_view.test.ts
@@ -22,7 +22,7 @@ describe('dashboard list view', () => {
beforeEach(() => {
cy.login();
cy.visit(DASHBOARD_LIST);
- cy.get('[data-test="list-view"]').click();
+ cy.get('[aria-label="list-view"]').click();
});
xit('should load rows', () => {
diff --git a/superset-frontend/src/components/ListView/ListView.tsx
b/superset-frontend/src/components/ListView/ListView.tsx
index 22729bd..f74e799 100644
--- a/superset-frontend/src/components/ListView/ListView.tsx
+++ b/superset-frontend/src/components/ListView/ListView.tsx
@@ -23,7 +23,7 @@ import Alert from 'src/components/Alert';
import { ReactComponent as EmptyImage } from 'images/empty.svg';
import cx from 'classnames';
import Button from 'src/components/Button';
-import Icon from 'src/components/Icon';
+import Icons from 'src/components/Icons';
import IndeterminateCheckbox from 'src/components/IndeterminateCheckbox';
import { TableCollection, Pagination } from 'src/components/dataViewCommon';
import CardCollection from './CardCollection';
@@ -142,7 +142,7 @@ const ViewModeContainer = styled.div`
display: inline-block;
border-radius: ${({ theme }) => theme.gridUnit / 2}px;
padding: ${({ theme }) => theme.gridUnit}px;
- padding-bottom: 0;
+ padding-bottom: ${({ theme }) => theme.gridUnit * 0.5}px;
&:first-of-type {
margin-right: ${({ theme }) => theme.gridUnit * 2}px;
@@ -182,7 +182,7 @@ const ViewModeToggle = ({
}}
className={cx('toggle-button', { active: mode === 'card' })}
>
- <Icon name="card-view" />
+ <Icons.CardView />
</div>
<div
role="button"
@@ -193,7 +193,7 @@ const ViewModeToggle = ({
}}
className={cx('toggle-button', { active: mode === 'table' })}
>
- <Icon name="list-view" />
+ <Icons.ListView />
</div>
</ViewModeContainer>
);
diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.test.jsx
b/superset-frontend/src/views/CRUD/chart/ChartList.test.jsx
index 00d7403..894aa4e 100644
--- a/superset-frontend/src/views/CRUD/chart/ChartList.test.jsx
+++ b/superset-frontend/src/views/CRUD/chart/ChartList.test.jsx
@@ -142,7 +142,7 @@ describe('ChartList', () => {
});
it('renders a table view', async () => {
- wrapper.find('[data-test="list-view"]').first().simulate('click');
+ wrapper.find('[aria-label="list-view"]').first().simulate('click');
await waitForComponentToPaint(wrapper);
expect(wrapper.find('table')).toExist();
});
diff --git a/superset-frontend/src/views/CRUD/dashboard/DashboardList.test.jsx
b/superset-frontend/src/views/CRUD/dashboard/DashboardList.test.jsx
index 230ccc5..4bb2043 100644
--- a/superset-frontend/src/views/CRUD/dashboard/DashboardList.test.jsx
+++ b/superset-frontend/src/views/CRUD/dashboard/DashboardList.test.jsx
@@ -143,7 +143,7 @@ describe('DashboardList', () => {
});
it('renders a table view', async () => {
- wrapper.find('[data-test="list-view"]').first().simulate('click');
+ wrapper.find('[aria-label="list-view"]').first().simulate('click');
await waitForComponentToPaint(wrapper);
expect(wrapper.find('table')).toExist();
});