1
0

Reorder tasks, lists and kanban buckets (#923)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/923
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad
2021-07-28 19:06:40 +00:00
parent dac315db59
commit 6ccb85a0dc
22 changed files with 475 additions and 96 deletions

View File

@ -90,6 +90,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
ListID: 1,
BucketID: 1,
IsFavorite: true,
Position: 2,
Labels: []*Label{
label4,
},
@ -160,6 +161,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
CreatedBy: user1,
ListID: 1,
BucketID: 1,
Position: 4,
Labels: []*Label{
label4,
},
@ -517,6 +519,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
BucketID: 1,
Position: 2,
},
},
},
@ -1033,6 +1036,51 @@ func TestTaskCollection_ReadAll(t *testing.T) {
},
wantErr: false,
},
{
name: "order by position",
fields: fields{
SortBy: []string{"position", "id"},
OrderBy: []string{"asc", "asc"},
},
args: args{
a: &user.User{ID: 1},
},
want: []*Task{
// the other ones don't have a position set
task3,
task4,
task5,
task6,
task7,
task8,
task9,
task10,
task11,
task12,
task15,
task16,
task17,
task18,
task19,
task20,
task21,
task22,
task23,
task24,
task25,
task26,
task27,
task28,
task29,
task30,
task31,
task32,
task33,
// The only tasks with a position set
task1,
task2,
},
},
}
for _, tt := range tests {