diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-01-08 09:17:07 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-01-15 17:47:53 +0100 |
commit | 03de502f1f6b4dd91f543d08c2bcf2cfa32cc236 (patch) | |
tree | b4a6f1c49be177c7e0ac9a6e6465e1a85516f2a4 /apps/files | |
parent | fac588297d5b9f9f5a15188fd75ad2596127b0ee (diff) | |
download | nextcloud-server-03de502f1f6b4dd91f543d08c2bcf2cfa32cc236.tar.gz nextcloud-server-03de502f1f6b4dd91f543d08c2bcf2cfa32cc236.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')
-rw-r--r-- | apps/files/src/views/Sidebar.vue | 25 |
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> |