feat: show all parent projects in task detail view
This commit is contained in:
parent
9d9fb959d8
commit
63ba2982c9
@ -14,9 +14,12 @@
|
|||||||
ref="heading"
|
ref="heading"
|
||||||
/>
|
/>
|
||||||
<h6 class="subtitle" v-if="project?.id">
|
<h6 class="subtitle" v-if="project?.id">
|
||||||
<router-link :to="{ name: 'project.index', params: { projectId: project.id } }">
|
<template v-for="p in getAllParentProjects(project)">
|
||||||
{{ getProjectTitle(project) }}
|
<router-link :to="{ name: 'project.index', params: { projectId: p.id } }">
|
||||||
</router-link>
|
{{ getProjectTitle(p) }}
|
||||||
|
</router-link>
|
||||||
|
<span class="has-text-grey-light" v-if="p.id !== project.id"> > </span>
|
||||||
|
</template>
|
||||||
</h6>
|
</h6>
|
||||||
|
|
||||||
<checklist-summary :task="task"/>
|
<checklist-summary :task="task"/>
|
||||||
@ -781,6 +784,19 @@ async function setPercentDone(percentDone: number) {
|
|||||||
task: newTask,
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user