diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-25 09:10:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-25 09:10:52 +0000 |
commit | 326b4d3216d107b40142ee847c06f2c41a1ef220 (patch) | |
tree | f5190e9c606a92c0ed4ce606a52b49366055065e /app/assets/javascripts/vue_merge_request_widget | |
parent | 92e4789eb069d5fe43025601c6b7839fddda3ad1 (diff) | |
download | gitlab-ce-326b4d3216d107b40142ee847c06f2c41a1ef220.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget')
3 files changed, 27 insertions, 2 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 f33f4d3fda0..59010b773f0 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 @@ -28,6 +28,7 @@ import { CONFIRM, WARNING, MT_MERGE_STRATEGY, + PIPELINE_FAILED_STATE, } from '../../constants'; import eventHub from '../../event_hub'; import mergeRequestQueryVariablesMixin from '../../mixins/merge_request_query_variables'; @@ -39,7 +40,6 @@ import CommitsHeader from './commits_header.vue'; import SquashBeforeMerge from './squash_before_merge.vue'; const PIPELINE_RUNNING_STATE = 'running'; -const PIPELINE_FAILED_STATE = 'failed'; const PIPELINE_PENDING_STATE = 'pending'; const PIPELINE_SUCCESS_STATE = 'success'; @@ -105,6 +105,10 @@ export default { import( 'ee_component/vue_merge_request_widget/components/merge_immediately_confirmation_dialog.vue' ), + MergeTrainFailedPipelineConfirmationDialog: () => + import( + 'ee_component/vue_merge_request_widget/components/merge_train_failed_pipeline_confirmation_dialog.vue' + ), }, directives: { GlTooltip: GlTooltipDirective, @@ -125,6 +129,7 @@ export default { squashBeforeMerge: this.mr.squashIsSelected, isSquashReadOnly: this.mr.squashIsReadonly, squashCommitMessage: this.mr.squashCommitMessage, + isPipelineFailedModalVisible: false, }; }, computed: { @@ -327,7 +332,12 @@ export default { : this.mr.commitMessageWithDescription; this.commitMessage = includeDescription ? commitMessageWithDescription : commitMessage; }, - handleMergeButtonClick(useAutoMerge, mergeImmediately = false) { + handleMergeButtonClick(useAutoMerge, mergeImmediately = false, confirmationClicked = false) { + if (this.showFailedPipelineModal && !confirmationClicked) { + this.isPipelineFailedModalVisible = true; + return; + } + if (mergeImmediately) { this.isMergingImmediately = true; } @@ -522,6 +532,11 @@ export default { @mergeImmediately="onMergeImmediatelyConfirmation" /> </gl-dropdown> + <merge-train-failed-pipeline-confirmation-dialog + :visible="isPipelineFailedModalVisible" + @startMergeTrain="onStartMergeTrainConfirmation" + @cancel="isPipelineFailedModalVisible = false" + /> </gl-button-group> <div v-if="shouldShowMergeControls" diff --git a/app/assets/javascripts/vue_merge_request_widget/constants.js b/app/assets/javascripts/vue_merge_request_widget/constants.js index d067e531fad..f5710f46b7e 100644 --- a/app/assets/javascripts/vue_merge_request_widget/constants.js +++ b/app/assets/javascripts/vue_merge_request_widget/constants.js @@ -10,6 +10,8 @@ export const MWPS_MERGE_STRATEGY = 'merge_when_pipeline_succeeds'; export const MTWPS_MERGE_STRATEGY = 'add_to_merge_train_when_pipeline_succeeds'; export const MT_MERGE_STRATEGY = 'merge_train'; +export const PIPELINE_FAILED_STATE = 'failed'; + export const AUTO_MERGE_STRATEGIES = [MWPS_MERGE_STRATEGY, MTWPS_MERGE_STRATEGY, MT_MERGE_STRATEGY]; // SP - "Suggest Pipelines" diff --git a/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js b/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js index 23215982e6e..9d8e5d12d58 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js +++ b/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.js @@ -38,5 +38,13 @@ export default { pipelineId() { return this.pipeline.id; }, + showFailedPipelineModal() { + return false; + }, + }, + methods: { + onStartMergeTrainConfirmation() { + return false; + }, }, }; |