diff options
author | nfebe <fenn25.fn@gmail.com> | 2025-01-22 00:03:04 +0100 |
---|---|---|
committer | nfebe <fenn25.fn@gmail.com> | 2025-01-24 13:08:05 +0100 |
commit | 64138650d1298da1c8d561d1d3a3537ab4b148af (patch) | |
tree | c5d6ea38a855e6a17eaf12d8aa75da53f3418c91 | |
parent | 24d7fc1bdd5e42347c169644e414fc88914dd25c (diff) | |
download | nextcloud-server-64138650d1298da1c8d561d1d3a3537ab4b148af.tar.gz nextcloud-server-64138650d1298da1c8d561d1d3a3537ab4b148af.zip |
feat(files_sharing): Modularize `SharingInput` to adapt with share sections
Signed-off-by: nfebe <fenn25.fn@gmail.com>
-rw-r--r-- | apps/files_sharing/src/components/SharingInput.vue | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index 7352be9ce11..5c62eb3851b 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -5,6 +5,7 @@ <template> <div class="sharing-search"> + <label for="sharing-search-input">{{ t('files_sharing', 'Search for share recipients') }}</label> <NcSelect ref="select" v-model="value" input-id="sharing-search-input" @@ -20,7 +21,7 @@ @search="asyncFind" @option:selected="onSelected"> <template #no-options="{ search }"> - {{ search ? noResultText : t('files_sharing', 'Add users and teams') }} + {{ search ? noResultText : placeholder }} </template> </NcSelect> </div> @@ -73,6 +74,14 @@ export default { type: Boolean, required: true, }, + isExternal: { + type: Boolean, + default: false, + }, + placeholder: { + type: String, + default: '', + }, }, data() { @@ -105,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 …') @@ -167,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) } |