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:
parent
020ecb740a
commit
a216a1e960
23 changed files with 482 additions and 298 deletions
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue