aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--options/locale/locale_en-US.ini2
-rw-r--r--templates/repo/issue/view_content/pull.tmpl3
-rw-r--r--web_src/js/components/PullRequestMergeForm.vue11
3 files changed, 16 insertions, 0 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 02598dc3dc..8503cb78d7 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1630,6 +1630,8 @@ pulls.reopened_at = `reopened this pull request <a id="%[1]s" href="#%[1]s">%[2]
pulls.merge_instruction_hint = `You can also view <a class="show-instruction">command line instructions</a>.`
pulls.merge_instruction_step1_desc = From your project repository, check out a new branch and test the changes.
pulls.merge_instruction_step2_desc = Merge the changes and update on Gitea.
+pulls.clear_merge_message = Clear merge message
+pulls.clear_merge_message_hint = Clearing the merge message will only remove the commit message content and keep generated git trailers such as "Co-Authored-By …".
pulls.auto_merge_button_when_succeed = (When checks succeed)
pulls.auto_merge_when_succeed = Auto merge when all checks succeed
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 1e07225300..9e0909064d 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -351,6 +351,8 @@
'textAutoMergeButtonWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
'textAutoMergeWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_when_succeed"}},
'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"}},
'canMergeNow': {{$canMergeNow}},
'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
@@ -360,6 +362,7 @@
'defaultMergeStyle': {{.MergeStyle}},
'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
'mergeMessageFieldPlaceHolder': {{$.locale.Tr "repo.editor.commit_message_desc"}},
+ 'defaultMergeMessage': defaultMergeMessage,
'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
diff --git a/web_src/js/components/PullRequestMergeForm.vue b/web_src/js/components/PullRequestMergeForm.vue
index bfe05628e8..1fec12dd5a 100644
--- a/web_src/js/components/PullRequestMergeForm.vue
+++ b/web_src/js/components/PullRequestMergeForm.vue
@@ -25,6 +25,14 @@
</div>
<div class="field">
<textarea name="merge_message_field" rows="5" :placeholder="mergeForm.mergeMessageFieldPlaceHolder" v-model="mergeMessageFieldValue"/>
+ <template v-if="mergeMessageFieldValue !== mergeForm.defaultMergeMessage">
+ <button @click.prevent="clearMergeMessage" class="ui tertiary button">
+ {{ mergeForm.textClearMergeMessage }}
+ </button>
+ <div class="ui label"><!-- TODO: Convert to tooltip once we can use tooltips in Vue templates -->
+ {{ mergeForm.textClearMergeMessageHint }}
+ </div>
+ </template>
</div>
</template>
@@ -174,6 +182,9 @@ export default {
this.mergeStyle = name;
this.autoMergeWhenSucceed = autoMerge;
},
+ clearMergeMessage() {
+ this.mergeMessageFieldValue = this.mergeForm.defaultMergeMessage;
+ },
},
};
</script>