Monorepo for Tangled tangled.org
854
fork

Configure Feed

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

appview: issues: filter issues by clicking a label #283

open opened by nove-b.dev targeting master from nove-b.dev/tangled-core: href-issue-label

When contributing to a project, it's common to start by browsing issues with a label like "good-first-issue". Clicking a label to automatically filter issues by that label makes this workflow more convenient.

When a label is clicked, a query parameter is appended to the URL to filter the issue listing.

Closes #499

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:2atly2y5kfyjcj5zap6pv4wd/sh.tangled.repo.pull/3mkpenmah6d22
+14 -1
Interdiff #2 #3
appview/issues/issues.go

This file has not been changed.

+1
appview/pages/pages.go
··· 1285 1285 Active string 1286 1286 FilterState string 1287 1287 FilterQuery string 1288 + BaseFilterQuery string 1288 1289 Stacks []models.Stack 1289 1290 Pipelines map[string]models.Pipeline 1290 1291 LabelDefs map[string]*models.LabelDefinition
appview/pages/templates/labels/fragments/label.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/issueListing.html

This file has not been changed.

appview/pages/templates/repo/issues/issues.html

This file has not been changed.

+1 -1
appview/pages/templates/repo/pulls/pulls.html
··· 111 111 {{ $state := $topPR.Labels }} 112 112 {{ range $k, $d := $.LabelDefs }} 113 113 {{ range $v, $s := $state.GetValSet $d.AtUri.String }} 114 - {{ template "labels/fragments/label" (dict "def" $d "val" $v "withPrefix" true) }} 114 + {{ template "labels/fragments/label" (dict "def" $d "val" $v "withPrefix" true "baseFilterQuery" $.BaseFilterQuery "basePath" (printf "/%s/pulls" $.RepoInfo.FullName)) }} 115 115 {{ end }} 116 116 {{ end }} 117 117 </div>
+12
appview/pulls/pulls.go
··· 807 807 } 808 808 } 809 809 810 + baseFilterParts := make([]string, 0, len(query.Items())) 811 + for _, item := range query.Items() { 812 + if item.Kind == searchquery.KindTagValue { 813 + if item.Key == "label" || !searchquery.KnownTags[item.Key] { 814 + continue 815 + } 816 + } 817 + baseFilterParts = append(baseFilterParts, item.Raw) 818 + } 819 + baseFilterQuery := strings.Join(baseFilterParts, " ") 820 + 810 821 err = s.pages.RepoPulls(w, pages.RepoPullsParams{ 811 822 LoggedInUser: s.oauth.GetMultiAccountUser(r), 812 823 RepoInfo: repoInfo, ··· 814 825 LabelDefs: defs, 815 826 FilterState: filterState, 816 827 FilterQuery: query.String(), 828 + BaseFilterQuery: baseFilterQuery, 817 829 Stacks: stacks, 818 830 Pipelines: m, 819 831 Page: page,

History

5 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview: issues: filter issues by label on click
merge conflicts detected
expand
  • appview/issues/issues.go:7
  • appview/pages/pages.go:1172
  • appview/pages/templates/labels/fragments/label.html:2
  • appview/pages/templates/repo/issues/fragments/issueListing.html:46
  • appview/pages/templates/repo/issues/issues.html:71
  • appview/pages/templates/repo/pulls/pulls.html:111
expand 0 comments
1 commit
expand
appview: issues: filter issues by label on click
expand 0 comments
1 commit
expand
appview: issues: filter issues by label on click
expand 0 comments
1 commit
expand
appview: issues: filter issues by label on click
expand 0 comments
1 commit
expand
appview: issues: filter issues by label on click
expand 0 comments