loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[UI] Remove unnecessary vertical space in empty labels list' (#4486) from gusted/space-label-list into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4486
Reviewed-by: 0ko <0ko@noreply.codeberg.org>

0ko 6fb25896 6e83c39f

+39 -8
+10 -8
templates/repo/issue/labels/labels_sidebar.tmpl
··· 1 1 <div class="ui labels list"> 2 2 <span class="no-select item {{if .root.HasSelectedLabel}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span> 3 - <span class="labels-list"> 4 - {{range .root.Labels}} 5 - {{template "repo/issue/labels/label" dict "root" $.root "label" .}} 6 - {{end}} 7 - {{range .root.OrgLabels}} 8 - {{template "repo/issue/labels/label" dict "root" $.root "label" .}} 9 - {{end}} 10 - </span> 3 + {{if .root.HasSelectedLabel}} 4 + <span class="labels-list"> 5 + {{range .root.Labels}} 6 + {{template "repo/issue/labels/label" dict "root" $.root "label" .}} 7 + {{end}} 8 + {{range .root.OrgLabels}} 9 + {{template "repo/issue/labels/label" dict "root" $.root "label" .}} 10 + {{end}} 11 + </span> 12 + {{end}} 11 13 </div>
+29
tests/integration/issue_test.go
··· 1126 1126 session.MakeRequest(t, req, http.StatusOK) 1127 1127 }) 1128 1128 } 1129 + 1130 + func TestIssueLabelList(t *testing.T) { 1131 + defer tests.PrepareTestEnv(t)() 1132 + labelListSelector := ".labels.list .labels-list" 1133 + hiddenClass := "tw-hidden" 1134 + 1135 + t.Run("Show label list", func(t *testing.T) { 1136 + defer tests.PrintCurrentTest(t)() 1137 + 1138 + req := NewRequest(t, "GET", "/user2/repo1/issues/1") 1139 + resp := MakeRequest(t, req, http.StatusOK) 1140 + htmlDoc := NewHTMLParser(t, resp.Body) 1141 + 1142 + htmlDoc.AssertElement(t, labelListSelector, true) 1143 + htmlDoc.AssertElement(t, ".labels.list .no-select.item."+hiddenClass, true) 1144 + }) 1145 + 1146 + t.Run("Show no label list", func(t *testing.T) { 1147 + defer tests.PrintCurrentTest(t)() 1148 + session := loginUser(t, "user2") 1149 + 1150 + req := NewRequest(t, "GET", "/user2/repo2/issues/1") 1151 + resp := session.MakeRequest(t, req, http.StatusOK) 1152 + htmlDoc := NewHTMLParser(t, resp.Body) 1153 + 1154 + htmlDoc.AssertElement(t, labelListSelector, false) 1155 + htmlDoc.AssertElement(t, ".labels.list .no-select.item:not([class*='"+hiddenClass+"'])", true) 1156 + }) 1157 + }