@@ -3,13 +3,14 @@ import React from 'react';
3
3
import { isNil } from 'lodash' ;
4
4
5
5
import { ResponseError } from '../../../components/Errors/ResponseError' ;
6
- import type { Column } from '../../../components/PaginatedTable' ;
6
+ import type { PaginatedTableData } from '../../../components/PaginatedTable' ;
7
7
import { PaginatedTableWithLayout } from '../../../components/PaginatedTable/PaginatedTableWithLayout' ;
8
8
import { TableColumnSetup } from '../../../components/TableColumnSetup/TableColumnSetup' ;
9
9
import { NODES_COLUMNS_TITLES } from '../../../components/nodesColumns/constants' ;
10
10
import type { NodesColumnId } from '../../../components/nodesColumns/constants' ;
11
+ import type { NodesColumn } from '../../../components/nodesColumns/types' ;
11
12
import { nodesApi } from '../../../store/reducers/nodes/nodes' ;
12
- import type { NodesPreparedEntity } from '../../../store/reducers/nodes /types' ;
13
+ import type { PreparedStorageNode } from '../../../store/reducers/storage /types' ;
13
14
import type { NodesGroupByField , NodesPeerRole } from '../../../types/api/nodes' ;
14
15
import { useAutoRefreshInterval } from '../../../utils/hooks' ;
15
16
import { useSelectedColumns } from '../../../utils/hooks/useSelectedColumns' ;
@@ -32,9 +33,10 @@ interface NodeGroupProps {
32
33
searchValue : string ;
33
34
peerRoleFilter ?: NodesPeerRole ;
34
35
groupByParam ?: NodesGroupByField ;
35
- columns : Column < NodesPreparedEntity > [ ] ;
36
+ columns : NodesColumn [ ] ;
36
37
scrollContainerRef : React . RefObject < HTMLElement > ;
37
38
onIsExpandedChange : ( name : string , isExpanded : boolean ) => void ;
39
+ onDataFetched ?: ( data : PaginatedTableData < PreparedStorageNode > ) => void ;
38
40
}
39
41
40
42
const NodeGroup = React . memo ( function NodeGroup ( {
@@ -50,6 +52,7 @@ const NodeGroup = React.memo(function NodeGroup({
50
52
columns,
51
53
scrollContainerRef,
52
54
onIsExpandedChange,
55
+ onDataFetched,
53
56
} : NodeGroupProps ) {
54
57
return (
55
58
< TableGroup
@@ -76,6 +79,7 @@ const NodeGroup = React.memo(function NodeGroup({
76
79
initialEntitiesCount = { count }
77
80
columns = { columns }
78
81
scrollContainerRef = { scrollContainerRef }
82
+ onDataFetched = { onDataFetched }
79
83
/>
80
84
}
81
85
tableWrapperProps = { {
@@ -92,11 +96,12 @@ interface GroupedNodesComponentProps {
92
96
databaseFullPath ?: string ;
93
97
scrollContainerRef : React . RefObject < HTMLElement > ;
94
98
withPeerRoleFilter ?: boolean ;
95
- columns : Column < NodesPreparedEntity > [ ] ;
99
+ columns : NodesColumn [ ] ;
96
100
defaultColumnsIds : NodesColumnId [ ] ;
97
101
requiredColumnsIds : NodesColumnId [ ] ;
98
102
selectedColumnsKey : string ;
99
103
groupByParams : NodesGroupByField [ ] ;
104
+ onDataFetched ?: ( data : PaginatedTableData < PreparedStorageNode > ) => void ;
100
105
}
101
106
102
107
export function GroupedNodesComponent ( {
@@ -110,6 +115,7 @@ export function GroupedNodesComponent({
110
115
requiredColumnsIds,
111
116
selectedColumnsKey,
112
117
groupByParams,
118
+ onDataFetched,
113
119
} : GroupedNodesComponentProps ) {
114
120
const { searchValue, peerRoleFilter, groupByParam} = useNodesPageQueryParams (
115
121
groupByParams ,
@@ -147,11 +153,7 @@ export function GroupedNodesComponent({
147
153
) ;
148
154
149
155
const isLoading = currentData === undefined && isFetching ;
150
- const {
151
- NodeGroups : tableGroups ,
152
- FoundNodes : found = 0 ,
153
- TotalNodes : total = 0 ,
154
- } = currentData || { } ;
156
+ const { tableGroups, found = 0 , total = 0 } = currentData || { } ;
155
157
156
158
const { expandedGroups, setIsGroupExpanded} = useExpandedGroups ( tableGroups ) ;
157
159
@@ -186,6 +188,7 @@ export function GroupedNodesComponent({
186
188
columns = { columnsToShow }
187
189
scrollContainerRef = { scrollContainerRef }
188
190
onIsExpandedChange = { setIsGroupExpanded }
191
+ onDataFetched = { onDataFetched }
189
192
/>
190
193
) ;
191
194
} ) ;
0 commit comments