diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index ab5e049e187de..747fa31aac920 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -357,11 +357,17 @@ export default { } return this.share.shareWith } + + if (this.index === null) { + return t('files_sharing', 'Share link') + } } - if (this.index > 1) { + + if (this.index >= 1) { return t('files_sharing', 'Share link ({index})', { index: this.index }) } - return t('files_sharing', 'Share link') + + return t('files_sharing', 'Create public link') }, /** diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index f8949920772c4..5c62eb3851bcb 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -21,7 +21,7 @@ @search="asyncFind" @option:selected="onSelected"> @@ -74,6 +74,14 @@ export default { type: Boolean, required: true, }, + isExternal: { + type: Boolean, + default: false, + }, + placeholder: { + type: String, + default: '', + }, }, data() { @@ -106,6 +114,10 @@ export default { if (!this.canReshare) { return t('files_sharing', 'Resharing is not allowed') } + if (this.placeholder) { + return this.placeholder + } + // We can always search with email addresses for users too if (!allowRemoteSharing) { return t('files_sharing', 'Name or email …') @@ -168,19 +180,26 @@ export default { lookup = true } - const shareType = [ - ShareType.User, - ShareType.Group, - ShareType.Remote, - ShareType.RemoteGroup, - ShareType.Team, - ShareType.Room, - ShareType.Guest, - ShareType.Deck, - ShareType.ScienceMesh, - ] - - if (getCapabilities().files_sharing.public.enabled === true) { + let shareType = [] + + if (this.isExternal) { + shareType.push(ShareType.Remote) + shareType.push(ShareType.RemoteGroup) + } else { + // Merge shareType array + shareType = shareType.concat([ + ShareType.User, + ShareType.Group, + ShareType.Team, + ShareType.Room, + ShareType.Guest, + ShareType.Deck, + ShareType.ScienceMesh, + ]) + + } + + if (getCapabilities().files_sharing.public.enabled === true && this.isExternal) { shareType.push(ShareType.Email) } diff --git a/apps/files_sharing/src/views/SharingInherited.vue b/apps/files_sharing/src/views/SharingInherited.vue index 4576f252cac92..434634517154b 100644 --- a/apps/files_sharing/src/views/SharingInherited.vue +++ b/apps/files_sharing/src/views/SharingInherited.vue @@ -4,7 +4,7 @@ -->