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
13 NegatedKeywords []string
14 NegatedPhrases []string
15 NegatedLabels []string
16 NegatedAuthorDid string
17
18 Page pagination.Page
19}
20
21func (o *IssueSearchOptions) HasSearchFilters() bool {
22 return len(o.Keywords) > 0 || len(o.Phrases) > 0 ||
23 o.AuthorDid != "" || o.NegatedAuthorDid != "" ||
24 len(o.Labels) > 0 || len(o.NegatedLabels) > 0 ||
25 len(o.NegatedKeywords) > 0 || len(o.NegatedPhrases) > 0
26}
27
28type PullSearchOptions struct {
29 Keywords []string
30 Phrases []string
31 RepoAt string
32 State *PullState
33 AuthorDid string
34 Labels []string
35
36 NegatedKeywords []string
37 NegatedPhrases []string
38 NegatedLabels []string
39 NegatedAuthorDid string
40
41 Page pagination.Page
42}
43
44func (o *PullSearchOptions) HasSearchFilters() bool {
45 return len(o.Keywords) > 0 || len(o.Phrases) > 0 ||
46 o.AuthorDid != "" || o.NegatedAuthorDid != "" ||
47 len(o.Labels) > 0 || len(o.NegatedLabels) > 0 ||
48 len(o.NegatedKeywords) > 0 || len(o.NegatedPhrases) > 0
49}