diff options
author | Louis Chemineau <louis@chmn.me> | 2023-07-05 15:52:13 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-07-05 15:52:13 +0200 |
commit | eb71ee950df10111910c68b76ec75e991d9dbc42 (patch) | |
tree | 18a97945af2a10b461e1846eda0bf956978200e8 /apps/files_versions | |
parent | fc7944fc73109ec851acb04f2fc85d9c3423e3d3 (diff) | |
download | nextcloud-server-eb71ee950df10111910c68b76ec75e991d9dbc42.tar.gz nextcloud-server-eb71ee950df10111910c68b76ec75e991d9dbc42.zip |
Enable all files versions features when groupfolders is enabled
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/Capabilities.php | 6 | ||||
-rw-r--r-- | apps/files_versions/src/components/Version.vue | 14 |
2 files changed, 14 insertions, 6 deletions
diff --git a/apps/files_versions/lib/Capabilities.php b/apps/files_versions/lib/Capabilities.php index 6439c18772b..b5861db8937 100644 --- a/apps/files_versions/lib/Capabilities.php +++ b/apps/files_versions/lib/Capabilities.php @@ -44,13 +44,11 @@ class Capabilities implements ICapability { * Return this classes capabilities */ public function getCapabilities() { - $groupFolderInstalled = $this->appManager->isInstalled('groupfolders'); - return [ 'files' => [ 'versioning' => true, - 'version_labeling' => !$groupFolderInstalled && $this->config->getSystemValueBool('enable_version_labeling', true), - 'version_deletion' => !$groupFolderInstalled && $this->config->getSystemValueBool('enable_version_deletion', true), + 'version_labeling' => $this->config->getSystemValueBool('enable_version_labeling', true), + 'version_deletion' => $this->config->getSystemValueBool('enable_version_deletion', true), ] ]; } diff --git a/apps/files_versions/src/components/Version.vue b/apps/files_versions/src/components/Version.vue index ec03a1c2b31..8c7296fbb25 100644 --- a/apps/files_versions/src/components/Version.vue +++ b/apps/files_versions/src/components/Version.vue @@ -46,7 +46,7 @@ </div> </template> <template #actions> - <NcActionButton v-if="capabilities.files.version_labeling === true" + <NcActionButton v-if="enableLabeling" :close-after-click="true" @click="openVersionLabelModal"> <template #icon> @@ -70,7 +70,7 @@ </template> {{ t('files_versions', 'Download version') }} </NcActionLink> - <NcActionButton v-if="!isCurrent && capabilities.files.version_deletion === true" + <NcActionButton v-if="!isCurrent && enableDeletion" :close-after-click="true" @click="deleteVersion"> <template #icon> @@ -250,6 +250,16 @@ export default { formattedDate() { return moment(this.version.mtime).format('LLL') }, + + /** @return {boolean} */ + enableLabeling() { + return this.capabilities.files.version_labeling === true && this.fileInfo.mountType !== 'group' + }, + + /** @return {boolean} */ + enableDeletion() { + return this.capabilities.files.version_deletion === true && this.fileInfo.mountType !== 'group' + } }, methods: { openVersionLabelModal() { |