Skip to content

Commit

Permalink
Merge pull request #39165 from nextcloud/artonge/feat/enable_versions…
Browse files Browse the repository at this point in the history
…_features_with_groupfolders_enabled

Enable all files_versions features when groupfolders is enabled
  • Loading branch information
artonge authored Jul 6, 2023
2 parents 3a50491 + eb71ee9 commit 5538a40
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 2 additions & 4 deletions apps/files_versions/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ public function __construct(
* 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),
]
];
}
Expand Down
14 changes: 12 additions & 2 deletions apps/files_versions/src/components/Version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions dist/files_versions-files_versions.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_versions-files_versions.js.map

Large diffs are not rendered by default.

0 comments on commit 5538a40

Please sign in to comment.