Skip to content

Commit cd5e27e

Browse files
committed
Add appconfig to always show the unique label of a sharee
Signed-off-by: Julius Härtl <[email protected]>
1 parent 04dd7b2 commit cd5e27e

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

apps/files_sharing/js/dist/files_sharing_tab.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files_sharing/js/dist/files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files_sharing/lib/Capabilities.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ public function getCapabilities() {
116116

117117
// Sharee searches
118118
$res['sharee'] = [
119-
'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false)
119+
'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false),
120+
'always_show_unique' => $this->config->getAppValue('files_sharing', 'always_show_unique', 'yes') === 'yes',
120121
];
121122

122123
return [

apps/files_sharing/src/components/SharingInput.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ export default {
405405
*/
406406
formatForMultiselect(result) {
407407
let desc
408-
if ((result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE
408+
if (result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER && this.config.shouldAlwaysShowUnique) {
409+
desc = result.shareWithDisplayNameUnique ?? ''
410+
} else if ((result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE
409411
|| result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP
410412
) && result.value.server) {
411413
desc = t('files_sharing', 'on {server}', { server: result.value.server })

apps/files_sharing/src/services/ConfigService.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ export default class Config {
229229
return (OC.getCapabilities().files_sharing.sharebymail === undefined) ? false : OC.getCapabilities().files_sharing.sharebymail.password.enforced
230230
}
231231

232+
/**
233+
* @returns {boolean}
234+
* @readonly
235+
* @memberof Config
236+
*/
237+
get shouldAlwaysShowUnique() {
238+
return (OC.getCapabilities().files_sharing?.sharee?.always_show_unique === true)
239+
}
240+
232241
/**
233242
* Is sharing with groups allowed ?
234243
*

0 commit comments

Comments
 (0)