feat: show all parent projects in task detail view

This commit is contained in:
kolaente 2023-03-28 17:48:26 +02:00
parent 9d9fb959d8
commit 63ba2982c9
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 19 additions and 3 deletions

View File

@ -14,9 +14,12 @@
ref="heading"
/>
<h6 class="subtitle" v-if="project?.id">
<router-link :to="{ name: 'project.index', params: { projectId: project.id } }">
{{ getProjectTitle(project) }}
</router-link>
<template v-for="p in getAllParentProjects(project)">
<router-link :to="{ name: 'project.index', params: { projectId: p.id } }">
{{ getProjectTitle(p) }}
</router-link>
<span class="has-text-grey-light" v-if="p.id !== project.id"> &gt; </span>
</template>
</h6>
<checklist-summary :task="task"/>
@ -781,6 +784,19 @@ async function setPercentDone(percentDone: number) {
task: newTask,
})
}
function getAllParentProjects(project: IProject): IProject[] {
let parents = []
if (project.parentProjectId) {
const parentProject = projectStore.getProjectById(project.parentProjectId)
parents = getAllParentProjects(parentProject)
}
return [
...parents,
project,
]
}
</script>
<style lang="scss" scoped>