Monorepo for Tangled
1package models
2
3import "tangled.org/core/appview/pagination"
4
5type IssueSearchOptions struct {
6 Keywords []string
7 Phrases []string
8 RepoAt string
9 IsOpen *bool
10 AuthorDid string
11 Labels []string
12 LabelValues []string
13
14 NegatedKeywords []string
15 NegatedPhrases []string
16 NegatedLabels []string
17 NegatedLabelValues []string
18 NegatedAuthorDids []string
19
20 Page pagination.Page
21}
22
23func (o *IssueSearchOptions) HasSearchFilters() bool {
24 return len(o.Keywords) > 0 || len(o.Phrases) > 0 ||
25 o.AuthorDid != "" || len(o.NegatedAuthorDids) > 0 ||
26 len(o.Labels) > 0 || len(o.NegatedLabels) > 0 ||
27 len(o.LabelValues) > 0 || len(o.NegatedLabelValues) > 0 ||
28 len(o.NegatedKeywords) > 0 || len(o.NegatedPhrases) > 0
29}
30
31type PullSearchOptions struct {
32 Keywords []string
33 Phrases []string
34 RepoAt string
35 State *PullState
36 AuthorDid string
37 Labels []string
38 LabelValues []string
39
40 NegatedKeywords []string
41 NegatedPhrases []string
42 NegatedLabels []string
43 NegatedLabelValues []string
44 NegatedAuthorDids []string
45
46 Page pagination.Page
47}
48
49func (o *PullSearchOptions) HasSearchFilters() bool {
50 return len(o.Keywords) > 0 || len(o.Phrases) > 0 ||
51 o.AuthorDid != "" || len(o.NegatedAuthorDids) > 0 ||
52 len(o.Labels) > 0 || len(o.NegatedLabels) > 0 ||
53 len(o.LabelValues) > 0 || len(o.NegatedLabelValues) > 0 ||
54 len(o.NegatedKeywords) > 0 || len(o.NegatedPhrases) > 0
55}