1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

refactor(app): app events datatable [EE-5355] (#10024)

This commit is contained in:
Ali 2023-08-14 05:09:40 +12:00 committed by GitHub
parent 0eaf296e1b
commit c472fe9c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 277 additions and 19 deletions

View file

@ -1,7 +1,7 @@
import clsx from 'clsx';
import { PropsWithChildren } from 'react';
type BadgeType = 'success' | 'danger' | 'warn' | 'info';
export type BadgeType = 'success' | 'danger' | 'warn' | 'info';
export interface Props {
type?: BadgeType;

View file

@ -1 +1,2 @@
export { Badge } from './Badge';
export type { BadgeType } from './Badge';

View file

@ -24,7 +24,7 @@ export function ExpandableDatatableTableRow<D extends Record<string, unknown>>({
cells={cells}
onClick={expandOnClick ? () => row.toggleExpanded() : undefined}
/>
{row.getIsExpanded() && (
{row.getIsExpanded() && row.getCanExpand() && (
<tr>
{!disableSelect && <td />}
<td colSpan={disableSelect ? cells.length : cells.length - 1}>

View file

@ -9,7 +9,7 @@ export function buildExpandColumn<
return {
id: 'expand',
header: ({ table }) => {
const hasExpandableItems = table.getExpandedRowModel().rows.length > 0;
const hasExpandableItems = table.getCanSomeRowsExpand();
return (
hasExpandableItems && (