aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/user
diff options
context:
space:
mode:
authorparnic <github@parnic.com>2022-04-26 17:40:01 -0500
committerGitHub <noreply@github.com>2022-04-26 23:40:01 +0100
commitcdab46220d62805b21474bfc1d3c2b5d9a63750f (patch)
tree924edb015e94f6ac68b3a70ad99b66139bd0a9bf /routers/web/user
parent0b38084baa0b27389850edde05ce3105f96a04b0 (diff)
downloadgitea-cdab46220d62805b21474bfc1d3c2b5d9a63750f.tar.gz
gitea-cdab46220d62805b21474bfc1d3c2b5d9a63750f.zip
Add commit status popup to issuelist (#19375)
This gets the necessary data to the issuelist for it to support a clickable commit status icon which pops up the full list of commit statuses related to the commit. It accomplishes this without any additional queries or fetching as the existing codepath was already doing the necessary work but only returning the "last" status. All methods were wrapped to call the least-filtered version of each function in order to maximize code reuse. Note that I originally left `getLastCommitStatus()` in `pull.go` which called to the new function, but `make lint` complained that it was unused, so I removed it. I would have preferred to keep it, but alas. The only thing I'd still like to do here is force these popups to happen to the right by default instead of the left. I see that the only other place this is popping up right is on view_list.tmpl, but I can't figure out how/why right now. Fixes #18810
Diffstat (limited to 'routers/web/user')
-rw-r--r--routers/web/user/home.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index 73a1e9e556..2e7b382de6 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -573,7 +573,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
}
}
- commitStatus, err := pull_service.GetIssuesLastCommitStatus(ctx, issues)
+ commitStatuses, lastStatus, err := pull_service.GetIssuesAllCommitStatus(ctx, issues)
if err != nil {
ctx.ServerError("GetIssuesLastCommitStatus", err)
return
@@ -650,7 +650,8 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
}
return 0
}
- ctx.Data["CommitStatus"] = commitStatus
+ ctx.Data["CommitLastStatus"] = lastStatus
+ ctx.Data["CommitStatuses"] = commitStatuses
ctx.Data["Repos"] = showRepos
ctx.Data["Counts"] = issueCountByRepo
ctx.Data["IssueStats"] = issueStats