@@ -128,12 +128,15 @@ export default defineComponent({
128
128
return canShare ({ space: unref (space ), resource: unref (resource ) })
129
129
})
130
130
131
+ const language = useGettext ()
132
+
131
133
const sharesStore = useSharesStore ()
132
134
const { updateLink, deleteLink } = sharesStore
133
135
const { linkShares } = storeToRefs (sharesStore )
134
136
135
137
const configStore = useConfigStore ()
136
138
const { options : configOptions } = storeToRefs (configStore )
139
+ const alertRwFolders = configStore .options .alertRwFolders
137
140
138
141
const { actions : createLinkActions } = useFileActionsCreateLink ()
139
142
const createLinkAction = computed <FileAction >(() =>
@@ -225,8 +228,23 @@ export default defineComponent({
225
228
resource: unref (resource ),
226
229
linkShare ,
227
230
options
231
+ }).then (() => {
232
+ showMessage ({ title: $gettext (' Link was updated successfully' ) })
228
233
})
229
- showMessage ({ title: $gettext (' Link was updated successfully' ) })
234
+ if (options .type === ' edit' && unref (resource ).isFolder && alertRwFolders ) {
235
+ if (! document .getElementById (' files-file-link-warning' )) {
236
+ const warningMessage = document .createElement (' div' )
237
+ warningMessage .className = ' oc-mb-m oc-p-s oc-background-secondary oc-rounded'
238
+ warningMessage .id = ' files-file-link-warning'
239
+ warningMessage .innerHTML = $gettext (
240
+ alertRwFolders [language .current ] ?? alertRwFolders [Object .keys (alertRwFolders )[0 ]]
241
+ )
242
+ document .getElementById (' files-links-list' ).parentElement .prepend (warningMessage )
243
+ setTimeout (() => {
244
+ warningMessage .remove ()
245
+ }, 10000 )
246
+ }
247
+ }
230
248
} catch (e ) {
231
249
console .error (e )
232
250
showErrorMessage ({
@@ -376,4 +394,9 @@ export default defineComponent({
376
394
margin-top : var (--oc-space-medium );
377
395
}
378
396
}
397
+ #files-file-link-warning {
398
+ color : var (--oc-color-swatch-danger-default );
399
+ text-align : center ;
400
+ border : solid 1px var (--oc-color-swatch-danger-muted );
401
+ }
379
402
</style >
0 commit comments