diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-17 00:09:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-17 00:09:14 +0300 |
commit | 06b21ad63ca4f7d0cada7cc44b9cddbf17df2193 (patch) | |
tree | 9f79eb73e6335bc2bef652aaeb19691bc6ae44df /app/assets/javascripts/vue_merge_request_widget/components | |
parent | 204df35415f2b0ed86c83b31b1d276f52e07e577 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/components')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index 239529ed8f6..4f8faeb877f 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -82,6 +82,13 @@ export default { }; this.loading = false; + if (!this.commitMessageIsTouched) { + this.commitMessage = this.state.defaultMergeCommitMessage; + } + if (!this.squashCommitMessageIsTouched) { + this.squashCommitMessage = this.state.defaultSquashCommitMessage; + } + if (this.state.mergeTrainsCount !== null && this.state.mergeTrainsCount !== undefined) { this.initPolling(); } @@ -133,9 +140,11 @@ export default { isMakingRequest: false, isMergingImmediately: false, commitMessage: this.mr.commitMessage, + commitMessageIsTouched: false, squashBeforeMerge: this.mr.squashIsSelected, isSquashReadOnly: this.mr.squashIsReadonly, squashCommitMessage: this.mr.squashCommitMessage, + squashCommitMessageIsTouched: false, isPipelineFailedModalVisibleMergeTrain: false, isPipelineFailedModalVisibleNormalMerge: false, editCommitMessage: false, @@ -465,6 +474,14 @@ export default { }); }); }, + setCommitMessage(val) { + this.commitMessage = val; + this.commitMessageIsTouched = true; + }, + setSquashCommitMessage(val) { + this.squashCommitMessage = val; + this.squashCommitMessageIsTouched = true; + }, }, i18n: { mergeCommitTemplateHintText: s__( @@ -630,21 +647,23 @@ export default { > <commit-edit v-if="shouldShowSquashEdit" - v-model="squashCommitMessage" + :value="squashCommitMessage" :label="__('Squash commit message')" input-id="squash-message-edit" class="gl-m-0! gl-p-0!" + @input="setSquashCommitMessage" > <template #header> - <commit-message-dropdown v-model="squashCommitMessage" :commits="commits" /> + <commit-message-dropdown :commits="commits" @input="setSquashCommitMessage" /> </template> </commit-edit> <commit-edit v-if="shouldShowMergeEdit" - v-model="commitMessage" + :value="commitMessage" :label="__('Merge commit message')" input-id="merge-message-edit" class="gl-m-0! gl-p-0!" + @input="setCommitMessage" /> <li class="gl-m-0! gl-p-0!"> <p class="form-text text-muted"> @@ -748,20 +767,22 @@ export default { <ul class="border-top content-list commits-list flex-list"> <commit-edit v-if="shouldShowSquashEdit" - v-model="squashCommitMessage" + :value="squashCommitMessage" :label="__('Squash commit message')" input-id="squash-message-edit" squash + @input="setSquashCommitMessage" > <template #header> - <commit-message-dropdown v-model="squashCommitMessage" :commits="commits" /> + <commit-message-dropdown :commits="commits" @input="setSquashCommitMessage" /> </template> </commit-edit> <commit-edit v-if="shouldShowMergeEdit" - v-model="commitMessage" + :value="commitMessage" :label="__('Merge commit message')" input-id="merge-message-edit" + @input="setCommitMessage" /> <li> <p class="form-text text-muted"> |