@@ -38,6 +38,7 @@ import {
38
38
deleteElements ,
39
39
duplicateElement ,
40
40
duplicateSpreadsheetConfig ,
41
+ duplicateSpreadsheetConfigCollection ,
41
42
elementExists ,
42
43
moveElementsToDirectory ,
43
44
newScriptFromFilter ,
@@ -169,6 +170,7 @@ export default function ContentContextualMenu(props: Readonly<ContentContextualM
169
170
case ElementType . LOADFLOW_PARAMETERS :
170
171
case ElementType . SHORT_CIRCUIT_PARAMETERS :
171
172
case ElementType . SPREADSHEET_CONFIG :
173
+ case ElementType . SPREADSHEET_CONFIG_COLLECTION :
172
174
console . info (
173
175
`${ activeElement . type } with uuid ${ activeElement . elementUuid } from directory ${ selectedDirectory ?. elementUuid } selected for copy`
174
176
) ;
@@ -241,6 +243,11 @@ export default function ContentContextualMenu(props: Readonly<ContentContextualM
241
243
handleDuplicateError ( error . message ) ;
242
244
} ) ;
243
245
break ;
246
+ case ElementType . SPREADSHEET_CONFIG_COLLECTION :
247
+ duplicateSpreadsheetConfigCollection ( activeElement . elementUuid ) . catch ( ( error ) => {
248
+ handleDuplicateError ( error . message ) ;
249
+ } ) ;
250
+ break ;
244
251
default : {
245
252
handleLastError ( intl . formatMessage ( { id : 'unsupportedItem' } ) ) ;
246
253
}
@@ -409,6 +416,7 @@ export default function ContentContextualMenu(props: Readonly<ContentContextualM
409
416
ElementType . SHORT_CIRCUIT_PARAMETERS ,
410
417
ElementType . LOADFLOW_PARAMETERS ,
411
418
ElementType . SPREADSHEET_CONFIG ,
419
+ ElementType . SPREADSHEET_CONFIG_COLLECTION ,
412
420
] ;
413
421
414
422
const hasMetadata = selectedElements [ 0 ] ?. hasMetadata ;
@@ -453,7 +461,11 @@ export default function ContentContextualMenu(props: Readonly<ContentContextualM
453
461
) ;
454
462
455
463
const allowsDownload = useCallback ( ( ) => {
456
- const allowedTypes = [ ElementType . CASE , ElementType . SPREADSHEET_CONFIG ] ;
464
+ const allowedTypes = [
465
+ ElementType . CASE ,
466
+ ElementType . SPREADSHEET_CONFIG ,
467
+ ElementType . SPREADSHEET_CONFIG_COLLECTION ,
468
+ ] ;
457
469
// if selectedElements contains at least one of the allowed types
458
470
return selectedElements . some ( ( element ) => allowedTypes . includes ( element . type ) ) && noCreationInProgress ( ) ;
459
471
} , [ selectedElements , noCreationInProgress ] ) ;
0 commit comments