@@ -20,6 +20,7 @@ import { useLocation, useParams } from 'react-router-dom'
20
20
import {
21
21
abortPreviousRequests ,
22
22
FiltersTypeEnum ,
23
+ getAIAnalyticsEvents ,
23
24
LARGE_PAGE_SIZE_OPTIONS ,
24
25
Nodes ,
25
26
PaginationEnum ,
35
36
import { importComponentFromFELibrary } from '@Components/common'
36
37
import {
37
38
getManifestResource ,
39
+ getPodRestartRBACPayload ,
38
40
updateManifestResourceHelmApps ,
39
41
} from '@Components/v2/appDetails/k8Resource/nodeDetail/nodeDetail.api'
40
42
@@ -59,6 +61,7 @@ const RESOURCE_FILTER_KEYS: Record<string, unknown> = importComponentFromFELibra
59
61
)
60
62
const RBBulkSelectionActions = importComponentFromFELibrary ( 'RBBulkSelectionActions' , null , 'function' )
61
63
const RBBulkOperations = importComponentFromFELibrary ( 'RBBulkOperations' , null , 'function' )
64
+ const PodRestart = importComponentFromFELibrary ( 'PodRestart' )
62
65
63
66
const K8SResourceListViewWrapper = ( {
64
67
children,
@@ -235,66 +238,75 @@ export const K8SResourceList = ({
235
238
}
236
239
237
240
return (
238
- < Table
239
- // key={JSON.stringify(selectedResource)}
240
- loading = { resourceListLoader || ! resourceList }
241
- columns = { columns }
242
- rows = { rows }
243
- { ...( RBBulkSelectionActions && ! isEventListing
244
- ? {
245
- bulkSelectionConfig : {
246
- BulkActionsComponent : RBBulkSelectionActions ,
247
- getSelectAllDialogStatus : ( ) => SelectAllDialogStatus . CLOSED ,
248
- BulkOperationModal : RBBulkOperations ,
249
- bulkOperationModalData : {
250
- selectedResource,
251
- isNodeListing,
252
- getManifestResource,
253
- updateManifestResourceHelmApps,
254
- clusterId : + clusterId ,
255
- clusterName : selectedCluster ?. label ?? '' ,
256
- handleReloadDataAfterBulkOperation : handleClearCacheAndReload ,
241
+ < >
242
+ < Table
243
+ // key={JSON.stringify(selectedResource)}
244
+ loading = { resourceListLoader || ! resourceList }
245
+ columns = { columns }
246
+ rows = { rows }
247
+ { ...( RBBulkSelectionActions && ! isEventListing
248
+ ? {
249
+ bulkSelectionConfig : {
250
+ BulkActionsComponent : RBBulkSelectionActions ,
251
+ getSelectAllDialogStatus : ( ) => SelectAllDialogStatus . CLOSED ,
252
+ BulkOperationModal : RBBulkOperations ,
253
+ bulkOperationModalData : {
254
+ selectedResource,
255
+ isNodeListing,
256
+ getManifestResource,
257
+ updateManifestResourceHelmApps,
258
+ clusterId : + clusterId ,
259
+ clusterName : selectedCluster ?. label ?? '' ,
260
+ handleReloadDataAfterBulkOperation : handleClearCacheAndReload ,
261
+ } ,
262
+ bulkActionsData : {
263
+ showBulkRestartOption :
264
+ window . _env_ . FEATURE_BULK_RESTART_WORKLOADS_FROM_RB . split ( ',' )
265
+ . map ( ( feat : string ) => feat . trim ( ) . toUpperCase ( ) )
266
+ . indexOf ( selectedResource ?. gvk . Kind . toUpperCase ( ) ) > - 1 ,
267
+ showNodeListingOptions : isNodeListing ,
268
+ } ,
257
269
} ,
258
- bulkActionsData : {
259
- showBulkRestartOption :
260
- window . _env_ . FEATURE_BULK_RESTART_WORKLOADS_FROM_RB . split ( ',' )
261
- . map ( ( feat : string ) => feat . trim ( ) . toUpperCase ( ) )
262
- . indexOf ( selectedResource ?. gvk . Kind . toUpperCase ( ) ) > - 1 ,
263
- showNodeListingOptions : isNodeListing ,
264
- } ,
265
- } ,
266
- }
267
- : { } ) }
268
- emptyStateConfig = { {
269
- noRowsConfig : {
270
- image : emptyCustomChart ,
271
- title : `No ${ selectedResource ?. gvk . Kind ?? 'Resource' } found` ,
272
- subTitle : `We could not find any ${ selectedResource ?. gvk . Kind ?? 'Resource' } . Try selecting a different cluster or namespace.` ,
273
- } ,
274
- } }
275
- filtersVariant = { FiltersTypeEnum . URL }
276
- paginationVariant = { PaginationEnum . PAGINATED }
277
- areColumnsConfigurable = { isNodeListing }
278
- id = "table__gvk-resource-list"
279
- additionalFilterProps = { {
280
- parseSearchParams : parseK8sResourceListSearchParams ,
281
- defaultPageSize : LARGE_PAGE_SIZE_OPTIONS [ 0 ] . value ,
282
- initialSortKey : getDefaultSortKey ( ) ,
283
- } }
284
- ViewWrapper = { K8SResourceListViewWrapper }
285
- filter = { tableFilter }
286
- additionalProps = { {
287
- renderRefreshBar ,
288
- selectedResource ,
289
- selectedCluster ,
290
- addTab ,
291
- isNodeListing ,
292
- isEventListing ,
293
- lowercaseKindToResourceGroupMap ,
294
- reloadResourceListData : handleClearCacheAndReload ,
295
- clusterName : selectedCluster ?. label ?? '' ,
296
- } }
297
- pageSizeOptions = { ! isNodeListing ? LARGE_PAGE_SIZE_OPTIONS : undefined }
298
- />
270
+ }
271
+ : { } ) }
272
+ emptyStateConfig = { {
273
+ noRowsConfig : {
274
+ image : emptyCustomChart ,
275
+ title : `No ${ selectedResource ?. gvk . Kind ?? 'Resource' } found` ,
276
+ subTitle : `We could not find any ${ selectedResource ?. gvk . Kind ?? 'Resource' } . Try selecting a different cluster or namespace.` ,
277
+ } ,
278
+ } }
279
+ filtersVariant = { FiltersTypeEnum . URL }
280
+ paginationVariant = { PaginationEnum . PAGINATED }
281
+ areColumnsConfigurable = { isNodeListing }
282
+ id = "table__gvk-resource-list"
283
+ additionalFilterProps = { {
284
+ parseSearchParams : parseK8sResourceListSearchParams ,
285
+ defaultPageSize : LARGE_PAGE_SIZE_OPTIONS [ 0 ] . value ,
286
+ initialSortKey : getDefaultSortKey ( ) ,
287
+ } }
288
+ ViewWrapper = { K8SResourceListViewWrapper }
289
+ filter = { tableFilter }
290
+ additionalProps = { {
291
+ renderRefreshBar ,
292
+ selectedResource ,
293
+ selectedCluster ,
294
+ addTab ,
295
+ isNodeListing ,
296
+ isEventListing ,
297
+ lowercaseKindToResourceGroupMap ,
298
+ reloadResourceListData : handleClearCacheAndReload ,
299
+ clusterName : selectedCluster ?. label ?? '' ,
300
+ } }
301
+ pageSizeOptions = { ! isNodeListing ? LARGE_PAGE_SIZE_OPTIONS : undefined }
302
+ />
303
+
304
+ { PodRestart && (
305
+ < PodRestart
306
+ aiWidgetAnalyticsEvent = { getAIAnalyticsEvents ( 'RB_POD_RESTART' ) }
307
+ rbacPayload = { getPodRestartRBACPayload ( ) }
308
+ />
309
+ ) }
310
+ < />
299
311
)
300
312
}
0 commit comments