fix(task detail view): make project display show the task's project
This commit is contained in:
parent
5e65814b8c
commit
a6f524e7af
@ -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,27 +536,18 @@ 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)
|
const project = projectStore.getProjectById(task.projectId)
|
||||||
|
baseStore.handleSetCurrentProject({project})
|
||||||
|
return project
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
parent,
|
|
||||||
(parent) => {
|
|
||||||
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 &&
|
||||||
task.maxRight > RIGHTS.READ
|
task.maxRight > RIGHTS.READ
|
||||||
|
Loading…
x
Reference in New Issue
Block a user