@@ -3,22 +3,28 @@ import { usePVCActions } from '@console/app/src/actions/hooks/usePVCActions';
3
3
import { Action } from '@console/dynamic-plugin-sdk' ;
4
4
import { referenceFor , PersistentVolumeClaimKind } from '@console/internal/module/k8s' ;
5
5
import { useK8sModel } from '@console/shared/src/hooks/useK8sModel' ;
6
- import { CommonActionCreator } from '../hooks/types' ;
6
+ import { CommonActionCreator , PVCActionCreator } from '../hooks/types' ;
7
7
import { useCommonActions } from '../hooks/useCommonActions' ;
8
8
9
9
export const usePVCActionsProvider = (
10
10
resource : PersistentVolumeClaimKind ,
11
11
) : [ Action [ ] , boolean , boolean ] => {
12
12
const [ kindObj , inFlight ] = useK8sModel ( referenceFor ( resource ) ) ;
13
- const actionsPVC = usePVCActions ( resource ) ;
13
+ const pvcActions = usePVCActions ( resource , [
14
+ PVCActionCreator . ExpandPVC ,
15
+ PVCActionCreator . PVCSnapshot ,
16
+ PVCActionCreator . ClonePVC ,
17
+ ] ) ;
18
+ const pvcDeleteAction = usePVCActions ( resource , [ PVCActionCreator . DeletePVC ] ) ;
14
19
const [ commonActions ] = useCommonActions ( kindObj , resource , [
15
20
CommonActionCreator . ModifyLabels ,
16
21
CommonActionCreator . ModifyAnnotations ,
17
22
CommonActionCreator . Edit ,
18
23
] ) ;
19
- const actions = useMemo ( ( ) => [ ...actionsPVC , ...Object . values ( commonActions ) ] , [
20
- actionsPVC ,
21
- commonActions ,
22
- ] ) ;
24
+
25
+ const actions = useMemo (
26
+ ( ) => [ ...pvcActions , ...Object . values ( commonActions ) , ...pvcDeleteAction ] ,
27
+ [ pvcActions , commonActions , pvcDeleteAction ] ,
28
+ ) ;
23
29
return [ actions , ! inFlight , false ] ;
24
30
} ;
0 commit comments