chore: fine tune pull request merge box and commit status item (#38060)

This commit is contained in:
wxiaoguang
2026-06-10 22:44:21 +00:00
committed by GitHub
parent 988f0ea54a
commit 442f5e7d06
6 changed files with 15 additions and 29 deletions
+3 -8
View File
@@ -13,7 +13,6 @@ import (
)
type pullMergeBoxInfoItem struct {
ItemClass string
SvgIconHTML template.HTML
InfoHTML template.HTML
ListItems []template.HTML
@@ -42,10 +41,9 @@ func (c *pullMergeBoxInfoItemCollection) AddInfoItem(svg, info template.HTML, op
})
}
func (c *pullMergeBoxInfoItemCollection) AddErrorItem(svg, info template.HTML, optItems ...[]template.HTML) {
func (c *pullMergeBoxInfoItemCollection) AddErrorItem(info template.HTML, optItems ...[]template.HTML) {
c.items = append(c.items, &pullMergeBoxInfoItem{
ItemClass: "tw-text-red",
SvgIconHTML: svg,
SvgIconHTML: svg.RenderHTML("octicon-x", 16, "tw-text-red"),
InfoHTML: info,
ListItems: util.OptionalArg(optItems),
})
@@ -151,10 +149,7 @@ func (prInfo *pullRequestViewInfo) prepareMergeBoxInfoItems(ctx *context.Context
ctx.Locale.Tr("repo.pulls.is_empty"),
)
} else {
prInfo.MergeBoxData.infoProtectionBlockers.AddErrorItem(
svg.RenderHTML("octicon-x"),
ctx.Locale.Tr("repo.pulls.cannot_auto_merge_desc"),
)
prInfo.MergeBoxData.infoProtectionBlockers.AddErrorItem(ctx.Locale.Tr("repo.pulls.cannot_auto_merge_desc"))
prInfo.MergeBoxData.infoProtectionBlockers.AddInfoItem(
svg.RenderHTML("octicon-info"),
ctx.Locale.Tr("repo.pulls.cannot_auto_merge_helper"),