From d6922708621e464f798e2ddcf72625f10385a900 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 16 Jan 2025 23:01:27 -0800 Subject: [PATCH 1/4] Add missed auto merge feed message on dashboard --- templates/user/dashboard/feeds.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 1c1ba5566fcf5..1a1d2c73a87fc 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -77,6 +77,10 @@ {{$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}} + {{$title := index .GetIssueInfos 1}} + {{ctx.Locale.Tr "action.auto_merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $title}} {{end}} {{DateUtils.TimeSince .GetCreate}} From 0aa77f672e62df772baca420885bc424882566d4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 16 Jan 2025 23:10:29 -0800 Subject: [PATCH 2/4] Fix more bug on feeds.tmpl --- models/activities/action.go | 4 ++-- templates/user/dashboard/feeds.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/activities/action.go b/models/activities/action.go index f96621b7d5bc2..adc442b88bc10 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 1a1d2c73a87fc..01c291369b8f0 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -73,7 +73,7 @@ {{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}} From 20e9054149a45c143d5c466d24a70167ecb2c346 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 17 Jan 2025 20:54:14 -0800 Subject: [PATCH 3/4] Fix bug --- templates/user/dashboard/feeds.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 01c291369b8f0..ca778e40f25e1 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -80,7 +80,7 @@ {{else if .GetOpType.InActions "auto_merge_pull_request"}} {{$index := index .GetIssueInfos 0}} {{$title := index .GetIssueInfos 1}} - {{ctx.Locale.Tr "action.auto_merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $title}} + {{ctx.Locale.Tr "action.auto_merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}} {{end}} {{DateUtils.TimeSince .GetCreate}} From 361d72fbc2d6ef2c99f395e20383abd35e427dd4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 19 Jan 2025 23:10:22 -0800 Subject: [PATCH 4/4] Remove unused variable --- templates/user/dashboard/feeds.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index ca778e40f25e1..739be586b856f 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -79,7 +79,6 @@ {{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}} - {{$title := index .GetIssueInfos 1}} {{ctx.Locale.Tr "action.auto_merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}} {{end}} {{DateUtils.TimeSince .GetCreate}}