Skip to content

Commit

Permalink
Merge pull request #46316 from nextcloud/backport28SidebarOffTags
Browse files Browse the repository at this point in the history
[stable28] sidebar: allow turning off tags view by default
  • Loading branch information
susnux authored Jul 9, 2024
2 parents 7a3a8cd + 1ee54e3 commit 85e64a2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/files/src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ window.addEventListener('DOMContentLoaded', function() {
window.OCA.Files.Sidebar.open = AppSidebar.open
window.OCA.Files.Sidebar.close = AppSidebar.close
window.OCA.Files.Sidebar.setFullScreenMode = AppSidebar.setFullScreenMode
window.OCA.Files.Sidebar.setShowTagsDefault = AppSidebar.setShowTagsDefault
})
14 changes: 12 additions & 2 deletions apps/files/src/views/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<!-- TODO: create a standard to allow multiple elements here? -->
<template v-if="fileInfo" #description>
<div class="sidebar__description">
<SystemTags v-if="isSystemTagsEnabled"
<SystemTags v-if="isSystemTagsEnabled && showTagsDefault"
v-show="showTags"
:file-id="fileInfo.id"
@has-tags="value => showTags = value" />
Expand Down Expand Up @@ -158,6 +158,7 @@ export default {
// reactive state
Sidebar: OCA.Files.Sidebar.state,
showTags: false,
showTagsDefault: true,
error: null,
loading: true,
fileInfo: null,
Expand Down Expand Up @@ -445,7 +446,7 @@ export default {
* Toggle the tags selector
*/
toggleTags() {
this.showTags = !this.showTags
this.showTagsDefault = this.showTags = !this.showTags
},

/**
Expand Down Expand Up @@ -537,6 +538,15 @@ export default {
}
},

/**
* Allow to set whether tags should be shown by default from OCA.Files.Sidebar
*
* @param {boolean} showTagsDefault - Whether or not to show the tags by default.
*/
setShowTagsDefault(showTagsDefault) {
this.showTagsDefault = showTagsDefault
},

/**
* Emit SideBar events.
*/
Expand Down
Loading

0 comments on commit 85e64a2

Please sign in to comment.