@@ -12,6 +12,7 @@ import { useCreateArgoApplication } from '../../../../k8s/groups/ArgoCD/Applicat
12
12
import { APPLICATIONS_TABLE_MODE } from '../../constants' ;
13
13
import { usePermissionsContext } from '../../providers/Permissions/hooks' ;
14
14
import { EnrichedApplicationWithArgoApplication } from '../../types' ;
15
+ import { ApplicationsMultiDeletion } from '../ApplicationsMultiDeletion' ;
15
16
import { useButtonsEnabledMap } from './hooks/useButtonsEnabled' ;
16
17
import { useColumns } from './hooks/useColumns' ;
17
18
import { useConfigurationHandlers } from './hooks/useConfigurationHandlers' ;
@@ -25,6 +26,10 @@ export const Applications = ({
25
26
} : ApplicationsProps ) => {
26
27
const permissions = usePermissionsContext ( ) ;
27
28
29
+ const allArgoApplications = enrichedApplicationsWithArgoApplications ?. map (
30
+ ( { argoApplication } ) => argoApplication
31
+ ) ;
32
+
28
33
const enrichedApplicationsByApplicationName = React . useMemo ( ( ) => {
29
34
return (
30
35
enrichedApplicationsWithArgoApplications &&
@@ -46,7 +51,9 @@ export const Applications = ({
46
51
) ;
47
52
48
53
const [ selected , setSelected ] = React . useState < string [ ] > ( [ ] ) ;
54
+
49
55
const [ mode , setMode ] = React . useState < ApplicationsTableMode > ( APPLICATIONS_TABLE_MODE . PREVIEW ) ;
56
+ const [ deleteDialogOpen , setDeleteDialogOpen ] = React . useState ( false ) ;
50
57
51
58
const toggleMode = ( ) =>
52
59
mode === APPLICATIONS_TABLE_MODE . PREVIEW
@@ -74,8 +81,8 @@ export const Applications = ({
74
81
setSelected,
75
82
enrichedApplicationsByApplicationName,
76
83
enrichedApplicationsWithArgoApplications,
77
- deleteArgoApplication,
78
84
values,
85
+ setDeleteDialogOpen,
79
86
} ) ;
80
87
81
88
const buttonsEnabledMap = useButtonsEnabledMap ( {
@@ -239,6 +246,17 @@ export const Applications = ({
239
246
}
240
247
>
241
248
< Table < EnrichedApplicationWithArgoApplication > { ..._TableProps } />
249
+ < ApplicationsMultiDeletion
250
+ applications = { allArgoApplications }
251
+ selected = { selected }
252
+ open = { deleteDialogOpen }
253
+ handleClose = { ( ) => setDeleteDialogOpen ( false ) }
254
+ onDelete = { ( ) => {
255
+ setSelected ( [ ] ) ;
256
+ setDeleteDialogOpen ( false ) ;
257
+ } }
258
+ deleteArgoApplication = { deleteArgoApplication }
259
+ />
242
260
</ TabSection >
243
261
) ;
244
262
} ;
0 commit comments