Add card sidebar tab navigation to router

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2021-04-12 08:12:28 +02:00
parent 73fce1d4ee
commit 030cc4eb57
3 changed files with 20 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
<template> <template>
<AppSidebar v-if="currentBoard && currentCard" <AppSidebar v-if="currentBoard && currentCard"
:active="tabId"
:title="title" :title="title"
:subtitle="subtitle" :subtitle="subtitle"
:title-editable="titleEditable" :title-editable="titleEditable"
@@ -65,7 +66,7 @@
:order="2" :order="2"
:name="t('deck', 'Comments')" :name="t('deck', 'Comments')"
icon="icon-comment"> icon="icon-comment">
<CardSidebarTabComments :card="currentCard" /> <CardSidebarTabComments :card="currentCard" :tab-query="tabQuery" />
</AppSidebarTab> </AppSidebarTab>
<AppSidebarTab v-if="hasActivity" <AppSidebarTab v-if="hasActivity"
@@ -109,6 +110,16 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
tabId: {
type: String,
required: false,
default: null,
},
tabQuery: {
type: String,
required: false,
default: null,
},
}, },
data() { data() {
return { return {

View File

@@ -49,6 +49,11 @@ export default {
type: Object, type: Object,
default: undefined, default: undefined,
}, },
tabQuery: {
type: String,
required: false,
default: null,
},
}, },
data() { data() {
return { return {

View File

@@ -116,7 +116,7 @@ export default new Router({
}, },
}, },
{ {
path: 'card/:cardId', path: 'card/:cardId/:tabId?/:tabQuery?',
name: 'card', name: 'card',
components: { components: {
sidebar: CardSidebar, sidebar: CardSidebar,
@@ -130,6 +130,8 @@ export default new Router({
sidebar: (route) => { sidebar: (route) => {
return { return {
id: parseInt(route.params.cardId, 10), id: parseInt(route.params.cardId, 10),
tabId: route.params.tabId,
tabQuery: route.params.tabQuery,
} }
}, },
}, },