From e7b560f3fe07a0abf0321935d2a33d18a0f27acd Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 21 Feb 2023 18:03:41 +0800 Subject: [PATCH] Fix the Manually Merged form (#23015) Regression bug of #19650 Close #20983 Close #21912 ### The "Manually Merged" form ![image](https://user-images.githubusercontent.com/2114189/220170503-32638994-b509-4251-8aa1-d8393dda7184.png) ### Mark a PR as Manually Merged and close it ![image](https://user-images.githubusercontent.com/2114189/220170537-25c91b2c-7a9a-44d1-9e6a-ebe3f1dfc26a.png) --------- Co-authored-by: Jason Song Co-authored-by: Lunny Xiao --- templates/repo/issue/view_content/pull.tmpl | 20 +++++++------------ .../js/components/PullRequestMergeForm.vue | 4 ++++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index cbcc163df..f0bf23c9e 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -129,6 +129,7 @@
{{template "repo/pulls/status" .}} {{$canAutoMerge := false}} + {{$showGeneralMergeForm := false}}
{{if .Issue.PullRequest.HasMerged}}
@@ -320,6 +321,7 @@ 'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}}, 'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}}, 'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}}, + 'textMergeCommitId': {{$.locale.Tr "repo.pulls.merge_commit_id"}}, 'canMergeNow': {{$canMergeNow}}, 'allOverridableChecksOk': {{not $notAllOverridableChecksOk}}, @@ -379,6 +381,7 @@ window.config.pageData.pullRequestMergeForm = mergeForm; + {{$showGeneralMergeForm = true}}
{{else}} {{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}} @@ -452,30 +455,21 @@ {{$.locale.Tr "repo.pulls.cannot_auto_merge_helper"}}
{{end}} - {{end}} + {{end}}{{/* end if: pull request status */}} - {{if $.StillCanManualMerge}} + {{if and $.StillCanManualMerge (not $showGeneralMergeForm)}}
-
+
{{.CsrfTokenHtml}}
- +
-
- -
- -
{{end}} {{if and .ShowMergeInstructions .Issue.PullRequest.HeadRepo}} diff --git a/web_src/js/components/PullRequestMergeForm.vue b/web_src/js/components/PullRequestMergeForm.vue index 2e10ce253..bc960c1e7 100644 --- a/web_src/js/components/PullRequestMergeForm.vue +++ b/web_src/js/components/PullRequestMergeForm.vue @@ -36,6 +36,10 @@
+
+ +
+