fix(kanban): update task done status after moving it into done bucket
Resolves https://kolaente.dev/vikunja/vikunja/issues/2518
This commit is contained in:
parent
8711f7a935
commit
ec0c05fd47
@ -490,12 +490,6 @@ async function updateTaskPosition(e) {
|
|||||||
taskBefore !== null ? taskBefore.position : null,
|
taskBefore !== null ? taskBefore.position : null,
|
||||||
taskAfter !== null ? taskAfter.position : null,
|
taskAfter !== null ? taskAfter.position : null,
|
||||||
)
|
)
|
||||||
if (
|
|
||||||
oldBucket !== undefined && // This shouldn't actually be `undefined`, but let's play it safe.
|
|
||||||
newBucket.id !== oldBucket.id
|
|
||||||
) {
|
|
||||||
newTask.done = project.value?.doneBucketId === newBucket.id
|
|
||||||
}
|
|
||||||
|
|
||||||
let bucketHasChanged = false
|
let bucketHasChanged = false
|
||||||
if (
|
if (
|
||||||
@ -522,12 +516,14 @@ async function updateTaskPosition(e) {
|
|||||||
await taskPositionService.value.update(newPosition)
|
await taskPositionService.value.update(newPosition)
|
||||||
|
|
||||||
if(bucketHasChanged) {
|
if(bucketHasChanged) {
|
||||||
await taskBucketService.value.update(new TaskBucketModel({
|
const updatedTaskBucket = await taskBucketService.value.update(new TaskBucketModel({
|
||||||
taskId: newTask.id,
|
taskId: newTask.id,
|
||||||
bucketId: newTask.bucketId,
|
bucketId: newTask.bucketId,
|
||||||
projectViewId: viewId,
|
projectViewId: viewId,
|
||||||
projectId: project.value.id,
|
projectId: project.value.id,
|
||||||
}))
|
}))
|
||||||
|
newTask.done = updatedTaskBucket.taskDone
|
||||||
|
kanbanStore.setTaskInBucket(newTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the first and second task don't both get position 0 assigned
|
// Make sure the first and second task don't both get position 0 assigned
|
||||||
|
Loading…
x
Reference in New Issue
Block a user