0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-05 10:44:53 +01:00
gitea/templates/repo/pulls/status.tmpl
Michael Hoang 8e9fb4d14c
Indicate when only optional checks failed (#36367)
Currently it's not clear that you can merge a PR when only optional
checks failed:

<img width="922" height="447" alt="Screenshot 2026-01-14 at 4 08 17 pm"
src="https://github.com/user-attachments/assets/e11670c7-5ab9-42d7-af09-2d8a8fd532d3"
/>

This PR changes the text to say "Some optional checks failed" when only
optional checks failed:

<img width="922" height="443" alt="Screenshot 2026-01-14 at 3 59 08 pm"
src="https://github.com/user-attachments/assets/9ea69b13-38d6-4cfc-b4f7-952eff58e546"
/>

When a required check fails it'll still say "Some checks failed":

<img width="928" height="343" alt="Screenshot 2026-01-14 at 3 59 20 pm"
src="https://github.com/user-attachments/assets/d3764a95-9737-4482-851e-d3406b1e4d76"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-14 14:25:14 -08:00

64 lines
2.5 KiB
Handlebars

{{/* Template Attributes:
* CommitStatus: summary of all commit status state
* CommitStatuses: all commit status elements
* ShowHideChecks: whether use a button to show/hide the checks
* StatusCheckData: additional status check data, see backend pullCommitStatusCheckData struct
*/}}
{{$statusCheckData := .StatusCheckData}}
{{if .CommitStatus}}
<div class="commit-status-panel">
<div class="ui top attached header commit-status-header">
{{$statusCheckData.CommitStatusCheckPrompt ctx.Locale}}
{{if .ShowHideChecks}}
<div class="ui right">
<button class="commit-status-hide-checks btn interact-fg"
data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}"
data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}">
{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}</button>
</div>
{{end}}
</div>
{{if and $statusCheckData $statusCheckData.RequireApprovalRunCount}}
<div class="ui attached segment flex-text-block tw-justify-between" id="approve-status-checks">
<div>
<strong>
{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals" $statusCheckData.RequireApprovalRunCount}}
</strong>
<p>{{ctx.Locale.Tr "repo.pulls.status_checks_need_approvals_helper"}}</p>
</div>
{{if $statusCheckData.CanApprove}}
<button class="ui basic button link-action" data-url="{{$statusCheckData.ApproveLink}}">
{{ctx.Locale.Tr "repo.pulls.status_checks_approve_all"}}
</button>
{{end}}
</div>
{{end}}
<div class="commit-status-list">
{{range .CommitStatuses}}
<div class="commit-status-item">
{{template "repo/commit_status" .}}
<div class="status-context gt-ellipsis">{{.Context}} <span class="text light-2">{{.Description}}</span></div>
<div class="ui status-details">
{{if and $statusCheckData $statusCheckData.IsContextRequired}}
{{if (call $statusCheckData.IsContextRequired .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
{{end}}
<span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
</div>
</div>
{{end}}
{{if $statusCheckData}}
{{range $statusCheckData.MissingRequiredChecks}}
<div class="commit-status-item">
{{svg "octicon-dot-fill" 18 "commit-status icon text yellow"}}
<div class="status-context gt-ellipsis">{{.}}</div>
<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>
</div>
{{end}}
{{end}}
</div>
</div>
{{end}}