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 } 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>
|
||||
) : (
|
||||
'-'
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue