feat(kanban): return the total task count per bucket
This commit is contained in:
parent
ef94e0cf86
commit
72e0e22152
@ -41,6 +41,9 @@ type Bucket struct {
|
||||
// If this bucket is the "done bucket". All tasks moved into this bucket will automatically marked as done. All tasks marked as done from elsewhere will be moved into this bucket.
|
||||
IsDoneBucket bool `xorm:"BOOL" json:"is_done_bucket"`
|
||||
|
||||
// The number of tasks currently in this bucket
|
||||
Count int64 `xorm:"-" json:"count"`
|
||||
|
||||
// The position this bucket has when querying all buckets. See the tasks.position property on how to use this.
|
||||
Position float64 `xorm:"double null" json:"position"`
|
||||
|
||||
@ -202,11 +205,13 @@ func (b *Bucket) ReadAll(s *xorm.Session, auth web.Auth, search string, page int
|
||||
|
||||
opts.filters[bucketFilterIndex].value = id
|
||||
|
||||
ts, _, _, err := getRawTasksForProjects(s, []*Project{{ID: bucket.ProjectID}}, auth, opts)
|
||||
ts, _, total, err := getRawTasksForProjects(s, []*Project{{ID: bucket.ProjectID}}, auth, opts)
|
||||
if err != nil {
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
|
||||
bucket.Count = total
|
||||
|
||||
tasks = append(tasks, ts...)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user