1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

refactor(docker/services): convert service tasks table to react [EE-4674] (#10188)

This commit is contained in:
Chaim Lev-Ari 2023-09-07 15:19:03 +01:00 committed by GitHub
parent c47a804c97
commit c3d266931f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 421 additions and 322 deletions

View file

@ -23,6 +23,11 @@ interface Props<D extends DefaultType> {
initialTableState?: Partial<TableState>;
isLoading?: boolean;
initialSortBy?: BasicTableSettings['sortBy'];
/**
* keyword to filter by
*/
search?: string;
}
export function NestedDatatable<D extends DefaultType>({
@ -33,6 +38,7 @@ export function NestedDatatable<D extends DefaultType>({
initialTableState = {},
isLoading,
initialSortBy,
search,
}: Props<D>) {
const tableInstance = useReactTable<D>({
columns,
@ -45,6 +51,9 @@ export function NestedDatatable<D extends DefaultType>({
enableColumnFilter: false,
enableHiding: false,
},
state: {
globalFilter: search,
},
getRowId,
autoResetExpanded: false,
getCoreRowModel: getCoreRowModel(),
@ -55,7 +64,7 @@ export function NestedDatatable<D extends DefaultType>({
return (
<NestedTable>
<Table.Container>
<Table.Container noWidget>
<DatatableContent<D>
tableInstance={tableInstance}
isLoading={isLoading}