mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-28 11:14:54 -04:00
fix: always display the pull request merge box if there are actions pending approvals
For the same reason the merge box is displayed when the user can delete the branch from which the pull request was proposed, the trust panel must be displayed when runs are waiting approval, either for information or to approve/deny runs from untrusted users. Closes forgejo/forgejo#12576
This commit is contained in:
parent
d25f7ae70d
commit
699cc47485
2 changed files with 5 additions and 3 deletions
|
|
@ -4,9 +4,7 @@
|
|||
{{$manualMergeStyleAllowed := $prConfig.AllowManualMerge}}
|
||||
{{$hasUnsignedMergeStyle := or $fastForwardStyleAllowed $manualMergeStyleAllowed}}
|
||||
{{$signingBlocksAllMergeStyles := and .AllowMerge .RequireSigned (not .WillSign) (not $hasUnsignedMergeStyle)}}
|
||||
{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
|
||||
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
|
||||
{{else}}
|
||||
{{if or (not .Issue.PullRequest.HasMerged) .IsPullBranchDeletable .SomePullRequestRunsNeedApproval}}
|
||||
<div class="timeline-item comment merge box">
|
||||
<div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
|
||||
{{- else if .Issue.IsClosed}}grey
|
||||
|
|
|
|||
|
|
@ -486,6 +486,10 @@ func TestActionsPullRequestTrustPanelMergedOrClosed(t *testing.T) {
|
|||
t.Run("Regular user sees pending approval even though PR is a merged PR", func(t *testing.T) {
|
||||
actionsTrustTestAssertTrustPanel(t, regularSession, pullRequestLink)
|
||||
})
|
||||
t.Run("Owner user sees pending approval even though PR is a merged PR", func(t *testing.T) {
|
||||
ownerSession := loginUser(t, ownerUser.Name)
|
||||
actionsTrustTestAssertTrustPanel(t, ownerSession, pullRequestLink)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue