1
0

feat: rename lists to projects

This commit is contained in:
kolaente
2022-11-13 17:07:01 +01:00
parent 80266d1383
commit 349e6a5905
113 changed files with 2753 additions and 2750 deletions

View File

@ -90,7 +90,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
BucketID: 1,
IsFavorite: true,
Position: 2,
@ -104,7 +104,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Title: "task #29 with parent task (1)",
Index: 14,
CreatedByID: 1,
ListID: 1,
ProjectID: 1,
BucketID: 1,
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -162,7 +162,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Done: true,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
BucketID: 1,
Position: 4,
Labels: []*Label{
@ -182,7 +182,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 3,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -196,7 +196,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 4,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -210,7 +210,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 5,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -224,7 +224,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 6,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -238,7 +238,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 7,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -252,7 +252,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 8,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -266,7 +266,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 9,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 1,
Created: time.Unix(1543626724, 0).In(loc),
@ -281,7 +281,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 10,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 1,
Created: time.Unix(1543626724, 0).In(loc),
@ -294,7 +294,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 11,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 1,
Created: time.Unix(1543626724, 0).In(loc),
@ -307,7 +307,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 12,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 1,
Created: time.Unix(1543626724, 0).In(loc),
@ -320,7 +320,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 6,
ProjectID: 6,
IsFavorite: true,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 6,
@ -334,7 +334,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 7,
ProjectID: 7,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 7,
Created: time.Unix(1543626724, 0).In(loc),
@ -347,7 +347,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 8,
ProjectID: 8,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 8,
Created: time.Unix(1543626724, 0).In(loc),
@ -360,7 +360,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 9,
ProjectID: 9,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 9,
Created: time.Unix(1543626724, 0).In(loc),
@ -373,7 +373,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 10,
ProjectID: 10,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 10,
Created: time.Unix(1543626724, 0).In(loc),
@ -386,7 +386,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 11,
ProjectID: 11,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 11,
Created: time.Unix(1543626724, 0).In(loc),
@ -399,7 +399,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 12,
ProjectID: 12,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 12,
Created: time.Unix(1543626724, 0).In(loc),
@ -412,7 +412,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 13,
ProjectID: 13,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 13,
Created: time.Unix(1543626724, 0).In(loc),
@ -425,7 +425,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 14,
ProjectID: 14,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 14,
Created: time.Unix(1543626724, 0).In(loc),
@ -438,7 +438,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 15,
ProjectID: 15,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 15,
Created: time.Unix(1543626724, 0).In(loc),
@ -451,7 +451,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 16,
ProjectID: 16,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 16,
Created: time.Unix(1543626724, 0).In(loc),
@ -464,7 +464,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 6,
CreatedBy: user6,
ListID: 17,
ProjectID: 17,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 17,
Created: time.Unix(1543626724, 0).In(loc),
@ -481,7 +481,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
time.Unix(1543626724, 0).In(loc),
time.Unix(1543626824, 0).In(loc),
},
ListID: 1,
ProjectID: 1,
BucketID: 1,
RelatedTasks: map[RelationKind][]*Task{},
Created: time.Unix(1543626724, 0).In(loc),
@ -494,7 +494,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 13,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
RepeatAfter: 3600,
BucketID: 1,
@ -508,7 +508,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 14,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{
RelationKindParenttask: {
{
@ -517,7 +517,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Description: "Lorem Ipsum",
Index: 1,
CreatedByID: 1,
ListID: 1,
ProjectID: 1,
IsFavorite: true,
Created: time.Unix(1543626724, 0).In(loc),
Updated: time.Unix(1543626724, 0).In(loc),
@ -537,7 +537,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 15,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
Assignees: []*user.User{
user1,
user2,
@ -555,7 +555,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
HexColor: "f0f0f0",
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 1,
Created: time.Unix(1543626724, 0).In(loc),
@ -568,7 +568,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 1,
CreatedByID: 1,
CreatedBy: user1,
ListID: 3,
ProjectID: 3,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 21,
Created: time.Unix(1543626724, 0).In(loc),
@ -581,7 +581,7 @@ func TestTaskCollection_ReadAll(t *testing.T) {
Index: 17,
CreatedByID: 1,
CreatedBy: user1,
ListID: 1,
ProjectID: 1,
PercentDone: 0.5,
RelatedTasks: map[RelationKind][]*Task{},
BucketID: 1,
@ -590,10 +590,10 @@ func TestTaskCollection_ReadAll(t *testing.T) {
}
type fields struct {
ListID int64
Lists []*List
SortBy []string // Is a string, since this is the place where a query string comes from the user
OrderBy []string
ProjectID int64
Projects []*Project
SortBy []string // Is a string, since this is the place where a query string comes from the user
OrderBy []string
FilterBy []string
FilterValue []string
@ -876,12 +876,12 @@ func TestTaskCollection_ReadAll(t *testing.T) {
name: "favorited tasks",
args: defaultArgs,
fields: fields{
ListID: FavoritesPseudoList.ID,
ProjectID: FavoritesPseudoProject.ID,
},
want: []*Task{
task1,
task15,
// Task 34 is also a favorite, but on a list user 1 has no access to.
// Task 34 is also a favorite, but on a project user 1 has no access to.
},
},
{
@ -1042,9 +1042,9 @@ func TestTaskCollection_ReadAll(t *testing.T) {
wantErr: false,
},
{
name: "filter list",
name: "filter project",
fields: fields{
FilterBy: []string{"list_id"},
FilterBy: []string{"project_id"},
FilterValue: []string{"6"},
FilterComparator: []string{"equals"},
},
@ -1200,9 +1200,9 @@ func TestTaskCollection_ReadAll(t *testing.T) {
{
name: "saved filter with sort order",
fields: fields{
ListID: -2,
SortBy: []string{"title", "id"},
OrderBy: []string{"desc", "asc"},
ProjectID: -2,
SortBy: []string{"title", "id"},
OrderBy: []string{"desc", "asc"},
},
args: args{
a: &user.User{ID: 1},
@ -1224,9 +1224,9 @@ func TestTaskCollection_ReadAll(t *testing.T) {
defer s.Close()
lt := &TaskCollection{
ListID: tt.fields.ListID,
SortBy: tt.fields.SortBy,
OrderBy: tt.fields.OrderBy,
ProjectID: tt.fields.ProjectID,
SortBy: tt.fields.SortBy,
OrderBy: tt.fields.OrderBy,
FilterBy: tt.fields.FilterBy,
FilterValue: tt.fields.FilterValue,