mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
chore(deps): upgrade react-table to v8 [EE-4837] (#8245)
This commit is contained in:
parent
f20d3e72b9
commit
757461d58b
140 changed files with 1805 additions and 2872 deletions
|
@ -1,4 +1,4 @@
|
|||
import { CellProps, Column, Row } from 'react-table';
|
||||
import { Row } from '@tanstack/react-table';
|
||||
|
||||
import { filterHOC } from '@/react/components/datatables/Filter';
|
||||
|
||||
|
@ -6,28 +6,30 @@ import { Link } from '@@/Link';
|
|||
|
||||
import { Service } from '../../types';
|
||||
|
||||
export const namespace: Column<Service> = {
|
||||
Header: 'Namespace',
|
||||
import { columnHelper } from './helper';
|
||||
|
||||
export const namespace = columnHelper.accessor('Namespace', {
|
||||
header: 'Namespace',
|
||||
id: 'namespace',
|
||||
accessor: 'Namespace',
|
||||
Cell: ({ row }: CellProps<Service>) => (
|
||||
<Link
|
||||
to="kubernetes.resourcePools.resourcePool"
|
||||
params={{
|
||||
id: row.original.Namespace,
|
||||
}}
|
||||
title={row.original.Namespace}
|
||||
>
|
||||
{row.original.Namespace}
|
||||
</Link>
|
||||
),
|
||||
canHide: true,
|
||||
disableFilters: false,
|
||||
Filter: filterHOC('Filter by namespace'),
|
||||
filter: (rows: Row<Service>[], _filterValue, filters) => {
|
||||
if (filters.length === 0) {
|
||||
return rows;
|
||||
}
|
||||
return rows.filter((r) => filters.includes(r.original.Namespace));
|
||||
cell: ({ getValue }) => {
|
||||
const namespace = getValue();
|
||||
|
||||
return (
|
||||
<Link
|
||||
to="kubernetes.resourcePools.resourcePool"
|
||||
params={{
|
||||
id: namespace,
|
||||
}}
|
||||
title={namespace}
|
||||
>
|
||||
{namespace}
|
||||
</Link>
|
||||
);
|
||||
},
|
||||
};
|
||||
meta: {
|
||||
filter: filterHOC('Filter by namespace'),
|
||||
},
|
||||
enableColumnFilter: true,
|
||||
filterFn: (row: Row<Service>, columnId: string, filterValue: string[]) =>
|
||||
filterValue.length === 0 || filterValue.includes(row.original.Namespace),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue