Add a "done" option to kanban buckets #821

Merged
konrad merged 13 commits from feature/kanban-done-column into main 2021-03-24 20:16:36 +00:00
3 changed files with 32 additions and 0 deletions
Showing only changes of commit 37ebff8752 - Show all commits

View File

@ -16,6 +16,7 @@
title: testbucket3
list_id: 1
created_by_id: 1
is_done_bucket: 1
created: 2020-04-18 21:13:52
updated: 2020-04-18 21:13:52
- id: 4

View File

@ -970,6 +970,10 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
}
}
if bucket.IsDoneBucket {
t.Done = true
}
// Update the labels
//
// Maybe FIXME:

View File

@ -218,8 +218,35 @@ func TestTask_Update(t *testing.T) {
assert.Error(t, err)
assert.True(t, IsErrBucketDoesNotBelongToList(err))
})
t.Run("moving a task to the done bucket", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
s := db.NewSession()
defer s.Close()
task := &Task{
ID: 1,
Title: "test",
ListID: 1,
BucketID: 3, // Bucket 3 is the done bucket
}
err := task.Update(s, u)
assert.NoError(t, err)
err = s.Commit()
assert.NoError(t, err)
assert.True(t, task.Done)
db.AssertExists(t, "tasks", map[string]interface{}{
"id": 1,
"done": true,
"title": "test",
"list_id": 1,
"bucket_id": 3,
}, false)
})
}
// TODO: Add test to assert moving a task between lists assigns it the default bucket of the new list + done bucket (-> If the default bucket of the new list is the done bucket)
func TestTask_Delete(t *testing.T) {
t.Run("normal", func(t *testing.T) {
db.LoadAndAssertFixtures(t)