From 826fffb59ed05c70742228fdeea71da6d450e157 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 27 Jan 2025 02:57:45 +0800 Subject: [PATCH] Add missed auto merge feed message on dashboard (#33309) (#33405) Backport #33309 by @lunny Co-authored-by: Lunny Xiao --- models/activities/action.go | 4 ++-- templates/user/dashboard/feeds.tmpl | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/models/activities/action.go b/models/activities/action.go index 65d95fbe66..4c71810c61 100644 --- a/models/activities/action.go +++ b/models/activities/action.go @@ -72,9 +72,9 @@ func (at ActionType) String() string { case ActionRenameRepo: return "rename_repo" case ActionStarRepo: - return "star_repo" + return "star_repo" // will not displayed in feeds.tmpl case ActionWatchRepo: - return "watch_repo" + return "watch_repo" // will not displayed in feeds.tmpl case ActionCommitRepo: return "commit_repo" case ActionCreateIssue: diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 1c1ba5566f..739be586b8 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -73,10 +73,13 @@ {{else if .GetOpType.InActions "publish_release"}} {{$linkText := .Content | ctx.RenderUtils.RenderEmoji}} {{ctx.Locale.Tr "action.publish_release" (.GetRepoLink ctx) (printf "%s/releases/tag/%s" (.GetRepoLink ctx) .GetTag) (.ShortRepoPath ctx) $linkText}} - {{else if .GetOpType.InActions "review_dismissed"}} + {{else if .GetOpType.InActions "pull_review_dismissed"}} {{$index := index .GetIssueInfos 0}} {{$reviewer := index .GetIssueInfos 1}} {{ctx.Locale.Tr "action.review_dismissed" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $reviewer}} + {{else if .GetOpType.InActions "auto_merge_pull_request"}} + {{$index := index .GetIssueInfos 0}} + {{ctx.Locale.Tr "action.auto_merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}} {{end}} {{DateUtils.TimeSince .GetCreate}}