fix(tasks): make sure tasks show up if their parent task is not available in the current view
Related https://github.com/go-vikunja/frontend/issues/136 Related https://community.vikunja.io/t/subtasks-are-hidden-when-parent-tasks-are-moved/1911
This commit is contained in:
parent
5e991f3024
commit
664bf0a5f4
@ -179,7 +179,23 @@ watch(
|
|||||||
if (projectId < 0) {
|
if (projectId < 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
tasks.value = tasks.value.filter(t => typeof t.relatedTasks?.parenttask === 'undefined')
|
const tasksById = {}
|
||||||
|
tasks.value.forEach(t => tasksById[t.id] = true)
|
||||||
|
|
||||||
|
tasks.value = tasks.value.filter(t => {
|
||||||
|
if (typeof t.relatedTasks?.parenttask === 'undefined') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the task is a subtask, make sure the parent task is available in the current view as well
|
||||||
|
for (const pt of t.relatedTasks.parenttask) {
|
||||||
|
if(typeof tasksById[pt.id] === 'undefined') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user