diff options
author | F. E Noel Nfebe <fenn25.fn@gmail.com> | 2025-05-06 16:20:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-06 16:20:17 +0200 |
commit | 598579396cf522e7d56f41e28c4183b75de8045f (patch) | |
tree | 03587992c923be7df19771870cda805271c429b4 /apps/files_sharing/src | |
parent | 87bad3349646cb153d3aec637f876d1675a7d196 (diff) | |
parent | 46b98f3bcc6efa59af983f9daeb2c1c706f83fda (diff) | |
download | nextcloud-server-598579396cf522e7d56f41e28c4183b75de8045f.tar.gz nextcloud-server-598579396cf522e7d56f41e28c4183b75de8045f.zip |
Merge pull request #52511 from nextcloud/feat/no-issue/show-remote-shares-as-internal-config
feat(files_sharing): Add command to control display area for federated shares
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/components/SharingInput.vue | 11 | ||||
-rw-r--r-- | apps/files_sharing/src/services/ConfigService.ts | 9 | ||||
-rw-r--r-- | apps/files_sharing/src/views/SharingTab.vue | 28 |
3 files changed, 40 insertions, 8 deletions
diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index 49a39915e5e..b886ba95a17 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -194,11 +194,11 @@ export default { let shareType = [] - if (this.isExternal) { - shareType.push(ShareType.Remote) - shareType.push(ShareType.RemoteGroup) + const remoteTypes = [ShareType.Remote, ShareType.RemoteGroup] + + if (this.isExternal && !this.config.showFederatedSharesAsInternal) { + shareType.push(...remoteTypes) } else { - // Merge shareType array shareType = shareType.concat([ ShareType.User, ShareType.Group, @@ -209,6 +209,9 @@ export default { ShareType.ScienceMesh, ]) + if (this.config.showFederatedSharesAsInternal) { + shareType.push(...remoteTypes) + } } if (getCapabilities().files_sharing.public.enabled === true && this.isExternal) { diff --git a/apps/files_sharing/src/services/ConfigService.ts b/apps/files_sharing/src/services/ConfigService.ts index 09fdca13598..2114e2d1bae 100644 --- a/apps/files_sharing/src/services/ConfigService.ts +++ b/apps/files_sharing/src/services/ConfigService.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ import { getCapabilities } from '@nextcloud/capabilities' +import { loadState } from '@nextcloud/initial-state' type PasswordPolicyCapabilities = { enforceNonCommonPassword: boolean @@ -306,4 +307,12 @@ export default class Config { return this._capabilities?.files_sharing?.public?.custom_tokens } + /** + * Show federated shares as internal shares + * @return {boolean} + */ + get showFederatedSharesAsInternal(): boolean { + return loadState('files_sharing', 'showFederatedSharesAsInternal', false) + } + } diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index e9e068a7c1d..1b5275bcf7e 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -50,7 +50,7 @@ :link-shares="linkShares" :reshare="reshare" :shares="shares" - :placeholder="t('files_sharing', 'Share with accounts and teams')" + :placeholder="internalShareInputPlaceholder" @open-sharing-details="toggleShareDetailsView" /> <!-- other shares list --> @@ -90,7 +90,7 @@ :file-info="fileInfo" :link-shares="linkShares" :is-external="true" - :placeholder="t('files_sharing', 'Email, federated cloud id')" + :placeholder="externalShareInputPlaceholder" :reshare="reshare" :shares="shares" @open-sharing-details="toggleShareDetailsView" /> @@ -249,6 +249,18 @@ export default { return !!(this.fileInfo.permissions & OC.PERMISSION_SHARE) || !!(this.reshare && this.reshare.hasSharePermission && this.config.isResharingAllowed) }, + + internalShareInputPlaceholder() { + return this.config.showFederatedSharesAsInternal + ? t('files_sharing', 'Share with accounts, teams, federated cloud id') + : t('files_sharing', 'Share with accounts and teams') + }, + + externalShareInputPlaceholder() { + return this.config.showFederatedSharesAsInternal + ? t('files_sharing', 'Email') + : t('files_sharing', 'Email, federated cloud id') + }, }, methods: { @@ -369,7 +381,11 @@ export default { if ([ShareType.Link, ShareType.Email].includes(share.type)) { this.linkShares.push(share) } else if ([ShareType.Remote, ShareType.RemoteGroup].includes(share.type)) { - this.externalShares.push(share) + if (this.config.showFederatedSharesAsInternal) { + this.shares.push(share) + } else { + this.externalShares.push(share) + } } else { this.shares.push(share) } @@ -439,7 +455,11 @@ export default { if (share.type === ShareType.Email) { this.linkShares.unshift(share) } else if ([ShareType.Remote, ShareType.RemoteGroup].includes(share.type)) { - this.externalShares.unshift(share) + if (this.config.showFederatedSharesAsInternal) { + this.shares.unshift(share) + } else { + this.externalShares.unshift(share) + } } else { this.shares.unshift(share) } |