summaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-01-08 09:17:07 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-01-15 11:00:31 +0100
commitad1aec3085aa4d9da6470a89bc73b8406894afa9 (patch)
tree6ec8f19222c14da471d95549f002f4f439167202 /apps/files/src
parent8a5632d3a13bd84cda3c5bd499020e962e549f50 (diff)
downloadnextcloud-server-ad1aec3085aa4d9da6470a89bc73b8406894afa9.tar.gz
nextcloud-server-ad1aec3085aa4d9da6470a89bc73b8406894afa9.zip
Only show tag selector if tags are set
Signed-off-by: Julius Härtl <jus@bitgrid.net> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/views/Sidebar.vue25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue
index 4bee3c67759..9c2bab960c4 100644
--- a/apps/files/src/views/Sidebar.vue
+++ b/apps/files/src/views/Sidebar.vue
@@ -25,6 +25,7 @@
v-if="file"
ref="sidebar"
v-bind="appSidebar"
+ :force-menu="true"
@close="onClose"
@update:active="setActiveTab"
@update:starred="toggleStarred"
@@ -37,6 +38,15 @@
:file-info="fileInfo" />
</template>
+ <!-- Actions menu -->
+ <template v-if="fileInfo" #secondary-actions>
+ <!-- TODO: create proper api for apps to register actions
+ And inject themselves here. -->
+ <ActionButton v-if="isSystemTagsEnabled" icon="icon-tag" @click="toggleTags">
+ {{ t('files_sharing', 'Manage tags') }}
+ </ActionButton>
+ </template>
+
<!-- Error display -->
<div v-if="error" class="emptycontent">
<div class="icon-error" />
@@ -60,6 +70,7 @@
import $ from 'jquery'
import axios from '@nextcloud/axios'
import AppSidebar from 'nextcloud-vue/dist/Components/AppSidebar'
+import ActionButton from 'nextcloud-vue/dist/Components/ActionButton'
import FileInfo from '../services/FileInfo'
import LegacyTab from '../components/LegacyTab'
import LegacyView from '../components/LegacyView'
@@ -69,6 +80,7 @@ export default {
name: 'Sidebar',
components: {
+ ActionButton,
AppSidebar,
LegacyView,
},
@@ -218,6 +230,10 @@ export default {
defaultActionListener() {
return this.defaultAction ? 'figure-click' : null
},
+
+ isSystemTagsEnabled() {
+ return OCA && 'SystemTags' in OCA
+ }
},
watch: {
@@ -377,6 +393,15 @@ export default {
})
}
},
+
+ /**
+ * Toggle the tags selector
+ */
+ toggleTags() {
+ if (OCA.SystemTags && OCA.SystemTags.View) {
+ OCA.SystemTags.View.toggle()
+ }
+ }
},
}
</script>