mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-02-23 11:55:48 -05:00
fix(ui): remove code search git grep warning (#6794)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6794 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org> Co-authored-by: Robert Wolff <mahlzahn@posteo.de> Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
This commit is contained in:
parent
0d10d0971e
commit
862f4ad60c
4 changed files with 0 additions and 14 deletions
|
@ -182,7 +182,6 @@ org_kind = Search orgs...
|
||||||
team_kind = Search teams...
|
team_kind = Search teams...
|
||||||
code_kind = Search code...
|
code_kind = Search code...
|
||||||
code_search_unavailable = Code search is currently not available. Please contact the site administrator.
|
code_search_unavailable = Code search is currently not available. Please contact the site administrator.
|
||||||
code_search_by_git_grep = Current code search results are provided by "git grep". There might be better results if site administrator enables code indexer.
|
|
||||||
package_kind = Search packages...
|
package_kind = Search packages...
|
||||||
project_kind = Search projects...
|
project_kind = Search projects...
|
||||||
branch_kind = Search branches...
|
branch_kind = Search branches...
|
||||||
|
|
|
@ -31,11 +31,6 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .CodeIndexerDisabled}}
|
|
||||||
<div class="ui message" data-test-tag="grep">
|
|
||||||
<p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
{{if .SearchResults}}
|
{{if .SearchResults}}
|
||||||
{{template "shared/search/code/results" .}}
|
{{template "shared/search/code/results" .}}
|
||||||
{{else if .Keyword}}
|
{{else if .Keyword}}
|
||||||
|
|
|
@ -20,11 +20,6 @@ func TestExploreCodeSearchIndexer(t *testing.T) {
|
||||||
resp := MakeRequest(t, req, http.StatusOK)
|
resp := MakeRequest(t, req, http.StatusOK)
|
||||||
doc := NewHTMLParser(t, resp.Body).Find(".explore")
|
doc := NewHTMLParser(t, resp.Body).Find(".explore")
|
||||||
|
|
||||||
msg := doc.
|
|
||||||
Find(".ui.container").
|
|
||||||
Find(".ui.message[data-test-tag=grep]")
|
|
||||||
assert.EqualValues(t, 0, msg.Length())
|
|
||||||
|
|
||||||
doc.Find(".file-body").Each(func(i int, sel *goquery.Selection) {
|
doc.Find(".file-body").Each(func(i int, sel *goquery.Selection) {
|
||||||
assert.Positive(t, sel.Find(".code-inner").Find(".search-highlight").Length(), 0)
|
assert.Positive(t, sel.Find(".code-inner").Find(".search-highlight").Length(), 0)
|
||||||
})
|
})
|
||||||
|
|
|
@ -108,9 +108,6 @@ func testSearch(t *testing.T, url string, expected []string, indexer bool) {
|
||||||
doc := NewHTMLParser(t, resp.Body)
|
doc := NewHTMLParser(t, resp.Body)
|
||||||
container := doc.Find(".repository").Find(".ui.container")
|
container := doc.Find(".repository").Find(".ui.container")
|
||||||
|
|
||||||
grepMsg := container.Find(".ui.message[data-test-tag=grep]")
|
|
||||||
assert.EqualValues(t, indexer, len(grepMsg.Nodes) == 0)
|
|
||||||
|
|
||||||
branchDropdown := container.Find(".js-branch-tag-selector")
|
branchDropdown := container.Find(".js-branch-tag-selector")
|
||||||
assert.EqualValues(t, indexer, len(branchDropdown.Nodes) == 0)
|
assert.EqualValues(t, indexer, len(branchDropdown.Nodes) == 0)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue