From 4d9e9b18d037c85b3c92f756ae2732eb8917852c Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 8 May 2022 03:51:41 +0800 Subject: [PATCH 1/7] Use Vue to refactor pull merge UI --- templates/repo/issue/view_content/pull.tmpl | 220 +++++------------- .../js/components/PullRequestMergeForm.vue | 127 ++++++++++ web_src/js/features/repo-issue-pr-form.js | 12 + web_src/js/features/repo-issue.js | 26 --- web_src/js/features/repo-legacy.js | 6 +- 5 files changed, 195 insertions(+), 196 deletions(-) create mode 100644 web_src/js/components/PullRequestMergeForm.vue create mode 100644 web_src/js/features/repo-issue-pr-form.js diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 8c43ace32e134..710e58577c472 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -322,176 +322,60 @@ {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}} {{$approvers := .Issue.PullRequest.GetApprovers}} {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}} +
- {{if $prUnit.PullRequestsConfig.AllowMerge}} - - {{end}} - {{if $prUnit.PullRequestsConfig.AllowRebase}} - - {{end}} - {{if $prUnit.PullRequestsConfig.AllowRebaseMerge}} - - {{end}} - {{if $prUnit.PullRequestsConfig.AllowSquash}} - - {{end}} - {{if and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}} - - {{end}} -
-
- - {{if gt $prUnit.PullRequestsConfig.AllowedMergeStyleCount 1}} - - {{end}} -
-
+ + + +
+ {{if .ShowMergeInstructions}} -
{{$.i18n.Tr "repo.pulls.merge_instruction_hint" | Safe}}
+
{{$.i18n.Tr "repo.pulls.merge_instruction_hint" | Safe}}