From b082e816294902cfdf369be306c8aadf5ee2f0ad Mon Sep 17 00:00:00 2001 From: WofWca Date: Tue, 28 Mar 2023 14:02:58 +0400 Subject: [PATCH] feat: mark undone if task moved from isDoneBucket Addresses #545 It already is marked as done if it's moved _into_ the done bucket on the backend: https://kolaente.dev/vikunja/api/src/commit/6aadaaaffc1fff4a94e35e8fa3f6eab397cbc3ce/pkg/models/tasks.go#L867-L869 So now it happens on both ends --- src/views/project/ProjectKanban.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/project/ProjectKanban.vue b/src/views/project/ProjectKanban.vue index 4d8233594..ff15e11f2 100644 --- a/src/views/project/ProjectKanban.vue +++ b/src/views/project/ProjectKanban.vue @@ -415,6 +415,7 @@ async function updateTaskPosition(e) { : e.newIndex const task = newBucket.tasks[newTaskIndex] + const oldBucket = buckets.value.find(b => b.id === task.bucketId) const taskBefore = newBucket.tasks[newTaskIndex - 1] ?? null const taskAfter = newBucket.tasks[newTaskIndex + 1] ?? null taskUpdating.value[task.id] = true @@ -425,6 +426,13 @@ async function updateTaskPosition(e) { taskBefore !== null ? taskBefore.kanbanPosition : null, taskAfter !== null ? taskAfter.kanbanPosition : null, ) + if ( + oldBucket != undefined && // This shouldn't actually be `undefined`, but let's play it safe. + newBucket.id !== oldBucket.id && + newBucket.isDoneBucket !== oldBucket.isDoneBucket + ) { + newTask.done = newBucket.isDoneBucket + } try { await taskStore.update(newTask) -- 2.45.1