Skip to content

Commit c2af149

Browse files
authored
Merge pull request #39265 from nextcloud/artonge/backport/stable27/39165
[stable27] Enable all files_versions features when groupfolders is enabled
2 parents 70e2243 + e7d5432 commit c2af149

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

apps/files_versions/lib/Capabilities.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ public function __construct(
4646
* @return array
4747
*/
4848
public function getCapabilities() {
49-
$groupFolderInstalled = $this->appManager->isInstalled('groupfolders');
50-
5149
return [
5250
'files' => [
5351
'versioning' => true,
54-
'version_labeling' => !$groupFolderInstalled && $this->config->getSystemValueBool('enable_version_labeling', true),
55-
'version_deletion' => !$groupFolderInstalled && $this->config->getSystemValueBool('enable_version_deletion', true),
52+
'version_labeling' => $this->config->getSystemValueBool('enable_version_labeling', true),
53+
'version_deletion' => $this->config->getSystemValueBool('enable_version_deletion', true),
5654
]
5755
];
5856
}

apps/files_versions/src/components/Version.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747
</template>
4848
<template #actions>
49-
<NcActionButton v-if="capabilities.files.version_labeling === true"
49+
<NcActionButton v-if="enableLabeling"
5050
:close-after-click="true"
5151
@click="openVersionLabelModal">
5252
<template #icon>
@@ -70,7 +70,7 @@
7070
</template>
7171
{{ t('files_versions', 'Download version') }}
7272
</NcActionLink>
73-
<NcActionButton v-if="!isCurrent && capabilities.files.version_deletion === true"
73+
<NcActionButton v-if="!isCurrent && enableDeletion"
7474
:close-after-click="true"
7575
@click="deleteVersion">
7676
<template #icon>
@@ -244,6 +244,16 @@ export default {
244244
formattedDate() {
245245
return moment(this.version.mtime).format('LLL')
246246
},
247+
248+
/** @return {boolean} */
249+
enableLabeling() {
250+
return this.capabilities.files.version_labeling === true && this.fileInfo.mountType !== 'group'
251+
},
252+
253+
/** @return {boolean} */
254+
enableDeletion() {
255+
return this.capabilities.files.version_deletion === true && this.fileInfo.mountType !== 'group'
256+
}
247257
},
248258
methods: {
249259
openVersionLabelModal() {

0 commit comments

Comments
 (0)