mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Improve reviewing PR UX (#19612)
This commit is contained in:
parent
5a9c505e14
commit
0eac09e066
7 changed files with 74 additions and 3 deletions
|
@ -752,11 +752,27 @@ func ViewPullFiles(ctx *context.Context) {
|
|||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
ctx.Data["CurrentReview"], err = models.GetCurrentReview(ctx.Doer, issue)
|
||||
|
||||
currentReview, err := models.GetCurrentReview(ctx.Doer, issue)
|
||||
if err != nil && !models.IsErrReviewNotExist(err) {
|
||||
ctx.ServerError("GetCurrentReview", err)
|
||||
return
|
||||
}
|
||||
numPendingCodeComments := int64(0)
|
||||
if currentReview != nil {
|
||||
numPendingCodeComments, err = models.CountComments(&models.FindCommentsOptions{
|
||||
Type: models.CommentTypeCode,
|
||||
ReviewID: currentReview.ID,
|
||||
IssueID: issue.ID,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("CountComments", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
ctx.Data["CurrentReview"] = currentReview
|
||||
ctx.Data["PendingCodeCommentNumber"] = numPendingCodeComments
|
||||
|
||||
getBranchData(ctx, issue)
|
||||
ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.Doer.ID)
|
||||
ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue