Skip to content
Prev Previous commit
Next Next commit
Add card sidebar tab navigation to router
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Apr 13, 2021
commit 030cc4eb57542590a040ea25fd2d2a16b891b267
13 changes: 12 additions & 1 deletion src/components/card/CardSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<template>
<AppSidebar v-if="currentBoard && currentCard"
:active="tabId"
:title="title"
:subtitle="subtitle"
:title-editable="titleEditable"
Expand Down Expand Up @@ -65,7 +66,7 @@
:order="2"
:name="t('deck', 'Comments')"
icon="icon-comment">
<CardSidebarTabComments :card="currentCard" />
<CardSidebarTabComments :card="currentCard" :tab-query="tabQuery" />
</AppSidebarTab>

<AppSidebarTab v-if="hasActivity"
Expand Down Expand Up @@ -109,6 +110,16 @@ export default {
type: Number,
required: true,
},
tabId: {
type: String,
required: false,
default: null,
},
tabQuery: {
type: String,
required: false,
default: null,
},
},
data() {
return {
Expand Down
5 changes: 5 additions & 0 deletions src/components/card/CardSidebarTabComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export default {
type: Object,
default: undefined,
},
tabQuery: {
type: String,
required: false,
default: null,
},
},
data() {
return {
Expand Down
4 changes: 3 additions & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default new Router({
},
},
{
path: 'card/:cardId',
path: 'card/:cardId/:tabId?/:tabQuery?',
name: 'card',
components: {
sidebar: CardSidebar,
Expand All @@ -130,6 +130,8 @@ export default new Router({
sidebar: (route) => {
return {
id: parseInt(route.params.cardId, 10),
tabId: route.params.tabId,
tabQuery: route.params.tabQuery,
}
},
},
Expand Down