Skip to content

Commit 7503cd3

Browse files
parniczeripathlunny
authored
Use the total issue count for UI (#20785)
* Use the total issue count for UI This fixes a problem where the "All" line item on the Issues or Pull Requests page was only showing the count of the selected repos instead of the total of all issues/prs in all repos. The "total number of shown issues" number is now stashed in a different context variable in case it wants to be used by the frontend later. It's currently not being used. Fixes #20574 * Remove unused context variable Co-authored-by: zeripath <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent a4e91c4 commit 7503cd3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

routers/web/user/home.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -607,17 +607,22 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
607607
var shownIssues int
608608
if !isShowClosed {
609609
shownIssues = int(issueStats.OpenCount)
610-
ctx.Data["TotalIssueCount"] = shownIssues
611610
} else {
612611
shownIssues = int(issueStats.ClosedCount)
613-
ctx.Data["TotalIssueCount"] = shownIssues
614612
}
615613
if len(repoIDs) != 0 {
616614
shownIssues = 0
617615
for _, repoID := range repoIDs {
618616
shownIssues += int(issueCountByRepo[repoID])
619617
}
620618
}
619+
620+
var allIssueCount int64
621+
for _, issueCount := range issueCountByRepo {
622+
allIssueCount += issueCount
623+
}
624+
ctx.Data["TotalIssueCount"] = allIssueCount
625+
621626
if len(repoIDs) == 1 {
622627
repo := showReposMap[repoIDs[0]]
623628
if repo != nil {

0 commit comments

Comments
 (0)