refactor(search): rename Query.String to StandardSearchString
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
efddea720f
commit
ef69901f05
5 changed files with 8 additions and 8 deletions
|
|
@ -228,7 +228,7 @@ func SearchQueryBuild(options FilterOptions, advancedIssueSearchSyntax bool) str
|
|||
if advancedIssueSearchSyntax {
|
||||
q = query.AdvancedIssueSearchString()
|
||||
} else {
|
||||
q = query.String()
|
||||
q = query.StandardSearchString()
|
||||
}
|
||||
|
||||
if options.Search != "" {
|
||||
|
|
|
|||
|
|
@ -213,5 +213,5 @@ func searchQuery(owner string, filter FilterOptions) string {
|
|||
},
|
||||
}
|
||||
|
||||
return q.String()
|
||||
return q.StandardSearchString()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ type Qualifiers struct {
|
|||
//
|
||||
// At the moment, the advanced search syntax is only available for searching
|
||||
// issues, and it's called advanced issue search.
|
||||
func (q Query) String() string {
|
||||
func (q Query) StandardSearchString() string {
|
||||
qualifiers := formatQualifiers(q.Qualifiers, nil)
|
||||
keywords := formatKeywords(q.Keywords)
|
||||
all := append(keywords, qualifiers...)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
var trueBool = true
|
||||
|
||||
func TestQueryString(t *testing.T) {
|
||||
func TestStandardSearchString(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
query Query
|
||||
|
|
@ -73,7 +73,7 @@ func TestQueryString(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
assert.Equal(t, tt.out, tt.query.String())
|
||||
assert.Equal(t, tt.out, tt.query.StandardSearchString())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ func (s searcher) search(query Query, result interface{}) (*http.Response, error
|
|||
}
|
||||
|
||||
if !features.AdvancedIssueSearchAPI {
|
||||
qs.Set("q", query.String())
|
||||
qs.Set("q", query.StandardSearchString())
|
||||
} else {
|
||||
qs.Set("q", query.AdvancedIssueSearchString())
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ func (s searcher) search(query Query, result interface{}) (*http.Response, error
|
|||
}
|
||||
}
|
||||
} else {
|
||||
qs.Set("q", query.String())
|
||||
qs.Set("q", query.StandardSearchString())
|
||||
}
|
||||
|
||||
if query.Order != "" {
|
||||
|
|
@ -278,7 +278,7 @@ func (s searcher) URL(query Query) string {
|
|||
// search syntax (even for the issues/PRs tab on the sidebar). When the GUI
|
||||
// is updated, we can use feature detection, and, if available, use the
|
||||
// advanced search syntax.
|
||||
qs.Set("q", query.String())
|
||||
qs.Set("q", query.StandardSearchString())
|
||||
|
||||
if query.Order != "" {
|
||||
qs.Set(orderKey, query.Order)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue