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 committed Mar 11, 2021
1 parent 04dd7b2 commit cd5e27e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing_tab.js.map

Large diffs are not rendered by default.

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 cd5e27e

Please sign in to comment.