Skip to content

Commit

Permalink
Add appconfig to always show the unique label of a sharee
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Mar 11, 2021
1 parent 1d0b210 commit e4b55e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/files_sharing/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,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 [
Expand Down
4 changes: 3 additions & 1 deletion apps/files_sharing/src/components/SharingInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,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 })
Expand Down
9 changes: 9 additions & 0 deletions apps/files_sharing/src/services/ConfigService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
*
Expand Down

0 comments on commit e4b55e3

Please sign in to comment.