fix(task detail view): make project display show the task's project

This commit is contained in:
kolaente 2023-03-27 14:26:39 +02:00
parent 5e65814b8c
commit a6f524e7af
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 17 deletions

View File

@ -13,9 +13,9 @@
:can-write="canWrite" :can-write="canWrite"
ref="heading" ref="heading"
/> />
<h6 class="subtitle" v-if="parent && parent.project"> <h6 class="subtitle" v-if="project?.id">
<router-link :to="{ name: 'project.index', params: { projectId: parent.project.id } }"> <router-link :to="{ name: 'project.index', params: { projectId: project.id } }">
{{ getProjectTitle(parent.project) }} {{ getProjectTitle(project) }}
</router-link> </router-link>
</h6> </h6>
@ -536,26 +536,17 @@ const visible = ref(false)
const taskId = toRef(props, 'taskId') const taskId = toRef(props, 'taskId')
const parent = computed(() => { const project = computed(() => {
if (!task.projectId) { if (!task.projectId) {
return { return {
project: null, project: null,
} }
} }
return projectStore.getProjectById(task.projectId)
})
watch( const project = projectStore.getProjectById(task.projectId)
parent, baseStore.handleSetCurrentProject({project})
(parent) => { return project
const parentProject = parent !== null ? parent.project : null })
if (parentProject !== null) {
baseStore.handleSetCurrentProject({project: parentProject})
}
},
{immediate: true},
)
const canWrite = computed(() => ( const canWrite = computed(() => (
task.maxRight !== null && task.maxRight !== null &&