refactor: migrate icon to icons in tablecollection (#15309)
* initial commit * fix flaky test * remove line
This commit is contained in:
parent
ea382e404d
commit
f35ce394bf
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue