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

refactor(edge/stacks): migrate list view to react [EE-2237] (#9186)

This commit is contained in:
Chaim Lev-Ari 2023-07-12 18:26:52 +04:00 committed by GitHub
parent 020ecb740a
commit a216a1e960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 482 additions and 298 deletions

View file

@ -5,7 +5,8 @@ import { Link } from '@@/Link';
export function buildNameColumn<T extends Record<string, unknown>>(
nameKey: keyof T,
idKey: string,
path: string
path: string,
idParam = 'id'
): ColumnDef<T> {
const cell = createCell<T>();
@ -15,6 +16,7 @@ export function buildNameColumn<T extends Record<string, unknown>>(
id: 'name',
cell,
enableSorting: true,
enableHiding: false,
sortingFn: 'text',
};
@ -27,7 +29,11 @@ export function buildNameColumn<T extends Record<string, unknown>>(
}
return (
<Link to={path} params={{ id: row.original[idKey] }} title={name}>
<Link
to={path}
params={{ [idParam]: row.original[idKey] }}
title={name}
>
{name}
</Link>
);