feat: show all parent projects in task detail view
This commit is contained in:
parent
9d9fb959d8
commit
63ba2982c9
@ -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) }}
|
||||
<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"> > </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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user