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

View File

@ -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"> &gt; </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>