Skip to content

Commit 79fa1c1

Browse files
authored
Use the total issue count for UI (#20785) (#20827)
Backport #20785 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
1 parent 78dabdd commit 79fa1c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

routers/web/user/home.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,8 @@ 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
@@ -619,6 +617,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
619617
}
620618
}
621619

620+
var allIssueCount int64
621+
for _, issueCount := range issueCountByRepo {
622+
allIssueCount += issueCount
623+
}
624+
ctx.Data["TotalIssueCount"] = allIssueCount
625+
622626
ctx.Data["IsShowClosed"] = isShowClosed
623627

624628
ctx.Data["IssueRefEndNames"], ctx.Data["IssueRefURLs"] = issue_service.GetRefEndNamesAndURLs(issues, ctx.FormString("RepoLink"))

0 commit comments

Comments
 (0)