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.

ui: fix issue labels

0ko 32695831 573ba5e9

+22 -26
+1 -1
templates/repo/issue/labels/labels_selector_field.tmpl
··· 5 5 {{svg "octicon-gear" 16 "tw-ml-1"}} 6 6 {{end}} 7 7 </span> 8 - <div class="filter menu" {{if .Issue}}data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/labels"{{else}}data-id="#label_ids"{{end}}> 8 + <div class="filter menu ugc-labels" {{if .Issue}}data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/labels"{{else}}data-id="#label_ids"{{end}}> 9 9 {{if or .Labels .OrgLabels}} 10 10 <div class="ui icon search input"> 11 11 <i class="icon">{{svg "octicon-search" 16}}</i>
+9 -11
templates/repo/issue/labels/labels_sidebar.tmpl
··· 1 1 <div class="ui labels list"> 2 - <span class="no-select item {{if .root.HasSelectedLabel}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</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}} 2 + <span class="no-select {{if .root.HasSelectedLabel}}tw-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_label"}}</span> 3 + <span class="labels-list ugc-labels"> 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> 13 11 </div>
+3 -14
tests/integration/issue_test.go
··· 1129 1129 1130 1130 func TestIssueLabelList(t *testing.T) { 1131 1131 defer tests.PrepareTestEnv(t)() 1132 + // The label list should always be present. When no labels are selected, .no-select is visible, otherwise hidden. 1132 1133 labelListSelector := ".labels.list .labels-list" 1133 1134 hiddenClass := "tw-hidden" 1134 1135 1135 - t.Run("Show label list", func(t *testing.T) { 1136 + t.Run("Test label list", func(t *testing.T) { 1136 1137 defer tests.PrintCurrentTest(t)() 1137 1138 1138 1139 req := NewRequest(t, "GET", "/user2/repo1/issues/1") ··· 1140 1141 htmlDoc := NewHTMLParser(t, resp.Body) 1141 1142 1142 1143 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) 1144 + htmlDoc.AssertElement(t, ".labels.list .no-select."+hiddenClass, true) 1156 1145 }) 1157 1146 }
+9
web_src/css/modules/label.css
··· 98 98 display: inline-block !important; 99 99 } 100 100 101 + .ugc-labels .item { 102 + text-overflow: unset !important; 103 + } 104 + 105 + .ugc-labels .item .ui.label { 106 + text-wrap: auto; 107 + overflow-wrap: anywhere; 108 + } 109 + 101 110 .ui.basic.label { 102 111 background: var(--color-button); 103 112 border: 1px solid var(--color-light-border);