diff --git a/apps/files_sharing/lib/Capabilities.php b/apps/files_sharing/lib/Capabilities.php index 61e8f3b63b6ae..55cce5f3e7600 100644 --- a/apps/files_sharing/lib/Capabilities.php +++ b/apps/files_sharing/lib/Capabilities.php @@ -115,7 +115,8 @@ public function getCapabilities() { // Sharee searches $res['sharee'] = [ - 'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false) + 'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false), + 'always_show_unique' => $this->config->getAppValue('files_sharing', 'always_show_unique', 'yes') === 'yes', ]; return [ diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index 654fdb3aeb31b..23d4a528d0e07 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -398,7 +398,9 @@ export default { */ formatForMultiselect(result) { let desc - if ((result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE + if (result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER && this.config.shouldAlwaysShowUnique) { + desc = result.shareWithDisplayNameUnique ?? '' + } else if ((result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE || result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP ) && result.value.server) { desc = t('files_sharing', 'on {server}', { server: result.value.server }) diff --git a/apps/files_sharing/src/services/ConfigService.js b/apps/files_sharing/src/services/ConfigService.js index a825bcb7d11e0..1addd00907c0e 100644 --- a/apps/files_sharing/src/services/ConfigService.js +++ b/apps/files_sharing/src/services/ConfigService.js @@ -229,6 +229,15 @@ export default class Config { return (OC.getCapabilities().files_sharing.sharebymail === undefined) ? false : OC.getCapabilities().files_sharing.sharebymail.password.enforced } + /** + * @returns {boolean} + * @readonly + * @memberof Config + */ + get shouldAlwaysShowUnique() { + return (OC.getCapabilities().files_sharing?.sharee?.always_show_unique === true) + } + /** * Is sharing with groups allowed ? *