-
Notifications
You must be signed in to change notification settings - Fork 0
/
task_tabs.go
68 lines (51 loc) · 1.18 KB
/
task_tabs.go
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package tdproto
type (
TaskFilterKey string
TaskSortKey string
TaskTabKey string
)
func (key TaskFilterKey) String() string {
return string(key)
}
// Task sort type
type TaskSort struct {
// Field
Key TaskSortKey `json:"key"`
// Sort title
Title string `json:"title"`
}
// Task filter
type TaskFilter struct {
// Task filter field
Field TaskFilterKey `json:"field"`
// Filter title
Title string `json:"title"`
}
// Tasks counters
type TaskCounters struct {
// Task jid
Jid JID `json:"jid"`
// Unreads counter
NumUnread uint `json:"num_unread,omitempty"`
// Mentions (@) counter
NumUnreadNotices uint `json:"num_unread_notices,omitempty"`
}
// Task tab
type TaskTab struct {
// Tab name
Key TaskTabKey `json:"key"`
// Tab title
Title string `json:"title"`
// Disable this tab when it has no contents
HideEmpty bool `json:"hide_empty"`
// Show unread badge
ShowCounter bool `json:"show_counter"`
// Enable pagination
Pagination bool `json:"pagination"`
// Filters inside tab
Filters []TaskFilter `json:"filters"`
// Sort available in tab
Sort []TaskSort `json:"sort"`
// Unread tasks with jid and counters
UnreadTasks []TaskCounters `json:"unread_tasks"`
}