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>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
  • Loading branch information
juliusknorr authored and npmbuildbot-nextcloud[bot] committed Mar 18, 2021
1 parent 939db1f commit 96287f3
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 @@ -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 [
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 @@ -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 })
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 96287f3

Please sign in to comment.