Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Enable all files versions features when groupfolders is enabled
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Jul 5, 2023
commit eb71ee950df10111910c68b76ec75e991d9dbc42
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.