@@ -73,7 +73,7 @@ function DirectoryContentDialog(
7373) {
7474 const intl = useIntl ( ) ;
7575 const dispatch = useDispatch ( ) ;
76- const { snackError } = useSnackMessage ( ) ;
76+ const { snackError, snackWarning } = useSnackMessage ( ) ;
7777 const itemSelectionForCopy = useSelector ( ( state : AppState ) => state . itemSelectionForCopy ) ;
7878 const activeDirectory = useSelector ( ( state : AppState ) => state . activeDirectory ) ;
7979 const enableDeveloperMode = useSelector ( ( state : AppState ) => state . enableDeveloperMode ) ;
@@ -169,7 +169,8 @@ function DirectoryContentDialog(
169169 setOpenDescModificationDialog ( true ) ;
170170 } else if ( childrenMetadata [ event . data . elementUuid ] !== undefined ) {
171171 setActiveElement ( event . data ) ;
172- setElementName ( childrenMetadata [ event . data . elementUuid ] . elementName ) ;
172+ const childName = childrenMetadata [ event . data . elementUuid ] . elementName ;
173+ setElementName ( childName ) ;
173174 setElementDescription ( childrenMetadata [ event . data . elementUuid ] . description ) ;
174175 const subtype = childrenMetadata [ event . data . elementUuid ] . specificMetadata . type as unknown as string ;
175176 /** set active directory on the store because it will be used while editing the contingency name */
@@ -180,6 +181,13 @@ function DirectoryContentDialog(
180181 if ( url ) {
181182 if ( selectedDirectoryWritable ) {
182183 window . open ( url , '_blank' ) ;
184+ } else {
185+ snackWarning ( {
186+ messageTxt : intl . formatMessage (
187+ { id : 'noWritePermissionOnStudy' } ,
188+ { studyName : childName }
189+ ) ,
190+ } ) ;
183191 }
184192 } else {
185193 snackError ( {
@@ -241,6 +249,7 @@ function DirectoryContentDialog(
241249 setActiveElement ,
242250 setOpenDialog ,
243251 snackError ,
252+ snackWarning ,
244253 ]
245254 ) ;
246255
@@ -251,7 +260,6 @@ function DirectoryContentDialog(
251260 description = { activeElement . description }
252261 elementUuid = { activeElement . elementUuid }
253262 onClose = { handleDescDialogClose }
254- // @ts -expect-error TODO: set UUID as parameter type in commons-ui
255263 updateElement = { updateElement }
256264 />
257265 ) ;
0 commit comments