-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.go
More file actions
35 lines (31 loc) · 807 Bytes
/
data.go
File metadata and controls
35 lines (31 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import "github.com/charmbracelet/bubbles/list"
// Provides the mock data to fill the kanban board
func (b *Board) initLists() {
tasks := GetTasks()
var todoTasks, inProgTasks, doneTasks []list.Item
for _, t := range tasks {
switch t.status {
case todo:
todoTasks = append(todoTasks, t)
case inProgress:
inProgTasks = append(inProgTasks, t)
case done:
doneTasks = append(doneTasks, t)
}
}
b.cols = []column{
newColumn(todo),
newColumn(inProgress),
newColumn(done),
}
// Init To Do
b.cols[todo].list.Title = "To Do"
b.cols[todo].list.SetItems(todoTasks)
// Init in progress
b.cols[inProgress].list.Title = "In Progress"
b.cols[inProgress].list.SetItems(inProgTasks)
// Init done
b.cols[done].list.Title = "Done"
b.cols[done].list.SetItems(doneTasks)
}