mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-24 01:50:51 +00:00
port(gitea): Retain issue/pull sort type (#8067)
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
port of [gitea#34559](https://github.com/go-gitea/gitea/pull/34559) initial work attributed to [badhezi](https://github.com/badhezi) Co-authored-by: badhezi <zlilaharon@gmail.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8067 Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com> Co-committed-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
This commit is contained in:
parent
8f2c08b8dc
commit
82e4ccc223
2 changed files with 42 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
<input type="hidden" name="project" value="{{$.ProjectID}}">
|
<input type="hidden" name="project" value="{{$.ProjectID}}">
|
||||||
<input type="hidden" name="assignee" value="{{$.AssigneeID}}">
|
<input type="hidden" name="assignee" value="{{$.AssigneeID}}">
|
||||||
<input type="hidden" name="poster" value="{{$.PosterID}}">
|
<input type="hidden" name="poster" value="{{$.PosterID}}">
|
||||||
|
<input type="hidden" name="sort" value="{{$.SortType}}">
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if .PageIsPullList}}
|
{{if .PageIsPullList}}
|
||||||
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.pull_kind") "Tooltip" (ctx.Locale.Tr "explore.go_to")}}
|
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.pull_kind") "Tooltip" (ctx.Locale.Tr "explore.go_to")}}
|
||||||
|
|
|
@ -1438,6 +1438,47 @@ func TestIssueCount(t *testing.T) {
|
||||||
assert.Contains(t, allCount, "2\u00a0All")
|
assert.Contains(t, allCount, "2\u00a0All")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestIssueDefaultValues(t *testing.T) {
|
||||||
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
links := []string{"/user2/repo1/issues", "/user2/repo1/pulls"}
|
||||||
|
values := []url.Values{
|
||||||
|
{
|
||||||
|
"type": {"created_by"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"poster": {"1"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sort": {"latest"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": {"all"},
|
||||||
|
"sort": {"latest"},
|
||||||
|
"poster": {"1"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": {"assigned"},
|
||||||
|
"sort": {"oldest"},
|
||||||
|
"poster": {"1"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, link := range links {
|
||||||
|
t.Run(link[13:], func(t *testing.T) {
|
||||||
|
for _, value := range values {
|
||||||
|
req := NewRequestf(t, "GET", "%s?%s", link, value.Encode())
|
||||||
|
resp := MakeRequest(t, req, http.StatusOK)
|
||||||
|
|
||||||
|
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||||
|
for name := range value {
|
||||||
|
assert.Equal(t, value.Get(name), htmlDoc.GetInputValueByName(name))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestIssuePostersSearch(t *testing.T) {
|
func TestIssuePostersSearch(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue