From 2519c80a2807572fe64efbe4360fdcb0f02b533a Mon Sep 17 00:00:00 2001 From: Anton Standrik Date: Fri, 16 Aug 2024 16:21:41 +0300 Subject: [PATCH 1/2] feat: enable autorefresh for paginated tables (#1146) --- .../EntitiesCount/EntitiesCount.tsx | 6 +- .../PaginatedTable/PaginatedTable.tsx | 247 ++++-------------- .../ResizeablePaginatedTable.tsx | 7 +- src/components/PaginatedTable/TableChunk.tsx | 140 +++++++--- src/components/PaginatedTable/TableRow.tsx | 2 +- src/components/PaginatedTable/reducer.ts | 141 ---------- src/components/PaginatedTable/types.ts | 14 +- src/containers/Cluster/Cluster.scss | 14 + src/containers/Cluster/Cluster.tsx | 4 +- src/containers/Nodes/PaginatedNodes.tsx | 29 +- src/containers/Nodes/getNodes.ts | 51 +++- .../StorageGroups/PaginatedStorageGroups.tsx | 35 +-- .../Storage/StorageGroups/getGroups.ts | 28 +- .../StorageNodes/PaginatedStorageNodes.tsx | 37 +-- .../Storage/StorageNodes/getNodes.ts | 37 ++- src/store/reducers/nodes/types.ts | 10 +- src/store/reducers/storage/types.ts | 15 ++ src/store/reducers/tableData.ts | 38 +++ tests/suites/nodes/nodes.test.ts | 127 ++++++++- tests/suites/paginatedTable/paginatedTable.ts | 126 +++++++++ tests/suites/storage/storage.test.ts | 127 +++++++++ 21 files changed, 749 insertions(+), 486 deletions(-) delete mode 100644 src/components/PaginatedTable/reducer.ts create mode 100644 src/store/reducers/tableData.ts create mode 100644 tests/suites/paginatedTable/paginatedTable.ts diff --git a/src/components/EntitiesCount/EntitiesCount.tsx b/src/components/EntitiesCount/EntitiesCount.tsx index a6722c15e..fe71cf563 100644 --- a/src/components/EntitiesCount/EntitiesCount.tsx +++ b/src/components/EntitiesCount/EntitiesCount.tsx @@ -1,7 +1,11 @@ import {Label} from '@gravity-ui/uikit'; +import {cn} from '../../utils/cn'; + import i18n from './i18n'; +const b = cn('ydb-entities-count'); + interface EntitiesCountProps { current: number | string; total?: number | string; @@ -28,7 +32,7 @@ export const EntitiesCount = ({total, current, label, loading, className}: Entit } return ( -