Hide tabs if comments/activity is disabled
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -47,7 +47,8 @@
|
||||
<DeletedTabSidebar :board="board" />
|
||||
</AppSidebarTab>
|
||||
|
||||
<AppSidebarTab id="activity"
|
||||
<AppSidebarTab v-if="hasActivity"
|
||||
id="activity"
|
||||
:order="3"
|
||||
:name="t('deck', 'Timeline')"
|
||||
icon="icon-activity">
|
||||
@@ -64,6 +65,8 @@ import DeletedTabSidebar from './DeletedTabSidebar'
|
||||
import TimelineTabSidebar from './TimelineTabSidebar'
|
||||
import { AppSidebar, AppSidebarTab } from '@nextcloud/vue'
|
||||
|
||||
const capabilities = window.OC.getCapabilities()
|
||||
|
||||
export default {
|
||||
name: 'BoardSidebar',
|
||||
components: {
|
||||
@@ -80,6 +83,11 @@ export default {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hasActivity: capabilities && capabilities.activity,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
board: state => state.currentBoard,
|
||||
|
||||
@@ -127,14 +127,16 @@
|
||||
<CardSidebarTabAttachments :card="currentCard" />
|
||||
</AppSidebarTab>
|
||||
|
||||
<AppSidebarTab id="comments"
|
||||
<AppSidebarTab v-if="hasComments"
|
||||
id="comments"
|
||||
:order="2"
|
||||
:name="t('deck', 'Comments')"
|
||||
icon="icon-comment">
|
||||
<CardSidebarTabComments :card="currentCard" />
|
||||
</AppSidebarTab>
|
||||
|
||||
<AppSidebarTab id="timeline"
|
||||
<AppSidebarTab v-if="hasActivity"
|
||||
id="timeline"
|
||||
:order="3"
|
||||
:name="t('deck', 'Timeline')"
|
||||
icon="icon-activity">
|
||||
@@ -153,6 +155,8 @@ import CardSidebarTabAttachments from './CardSidebarTabAttachments'
|
||||
import CardSidebarTabComments from './CardSidebarTabComments'
|
||||
import CardSidebarTabActivity from './CardSidebarTabActivity'
|
||||
|
||||
const capabilities = window.OC.getCapabilities()
|
||||
|
||||
export default {
|
||||
name: 'CardSidebar',
|
||||
components: {
|
||||
@@ -194,6 +198,8 @@ export default {
|
||||
},
|
||||
lastModifiedRelative: null,
|
||||
lastCreatedRemative: null,
|
||||
hasActivity: capabilities && capabilities.activity,
|
||||
hasComments: window.OCP && window.OCP.Comments,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user