1
0
Fork 0
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:
Chaim Lev-Ari 2023-05-02 13:42:16 +07:00 committed by GitHub
parent f20d3e72b9
commit 757461d58b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
140 changed files with 1805 additions and 2872 deletions

View file

@ -1,4 +1,4 @@
import { CellProps, Column } from 'react-table';
import { CellContext } from '@tanstack/react-table';
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
@ -6,29 +6,34 @@ import { Link } from '@@/Link';
import { Service } from '../../types';
export const application: Column<Service> = {
Header: 'Application',
accessor: (row) => (row.Applications ? row.Applications[0].Name : ''),
id: 'application',
import { columnHelper } from './helper';
Cell: ({ row, value: appname }: CellProps<Service, string>) => {
const environmentId = useEnvironmentId();
return appname ? (
<Link
to="kubernetes.applications.application"
params={{
endpointId: environmentId,
namespace: row.original.Namespace,
name: appname,
}}
title={appname}
>
{appname}
</Link>
) : (
'-'
);
},
canHide: true,
disableFilters: true,
};
export const application = columnHelper.accessor(
(row) => (row.Applications ? row.Applications[0].Name : ''),
{
header: 'Application',
id: 'application',
cell: Cell,
}
);
function Cell({ row, getValue }: CellContext<Service, string>) {
const appName = getValue();
const environmentId = useEnvironmentId();
return appName ? (
<Link
to="kubernetes.applications.application"
params={{
endpointId: environmentId,
namespace: row.original.Namespace,
name: appName,
}}
title={appName}
>
{appName}
</Link>
) : (
'-'
);
}