refactor: migrate icon to icons in tablecollection (#15309)

* initial commit

* fix flaky test

* remove line
This commit is contained in:
Phillip Kelley-Dotson 2021-06-23 09:40:06 -07:00 committed by GitHub
parent ea382e404d
commit f35ce394bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -128,8 +128,8 @@ describe('AlteredSliceTag', () => {
);
const th = getTableWrapperFromModalBody(modalBody).find('th');
expect(th).toHaveLength(3);
['Control', 'Before', 'After'].forEach((v, i) => {
expect(th.find('span').get(i).props.children[0]).toBe(v);
['Control', 'Before', 'After'].forEach(async (v, i) => {
await expect(th.find('span').get(i).props.children[0]).toBe(v);
});
});

View File

@ -20,7 +20,7 @@ import React from 'react';
import cx from 'classnames';
import { TableInstance } from 'react-table';
import { styled } from '@superset-ui/core';
import Icon from 'src/components/Icon';
import Icons from 'src/components/Icons';
interface TableCollectionProps {
getTableProps: (userProps?: any) => any;
@ -228,11 +228,11 @@ export default React.memo(
{headerGroups.map(headerGroup => (
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map(column => {
let sortIcon = <Icon name="sort" />;
let sortIcon = <Icons.Sort />;
if (column.isSorted && column.isSortedDesc) {
sortIcon = <Icon name="sort-desc" />;
sortIcon = <Icons.SortDesc />;
} else if (column.isSorted && !column.isSortedDesc) {
sortIcon = <Icon name="sort-asc" />;
sortIcon = <Icons.SortAsc />;
}
return column.hidden ? null : (
<th