diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 00:07:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 00:07:54 +0300 |
commit | 99ddca0d88f1e4e49d61b1aa9d41b5785528d1dc (patch) | |
tree | 556577b458832ebbc43b299e5bf436adf8b1c606 /app | |
parent | e1867c38fc5a4b931b4b2256d4909182e94f1051 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
3 files changed, 26 insertions, 3 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 65e523715e2..10312e64a24 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 @@ -2,9 +2,9 @@ import _ from 'underscore'; import successSvg from 'icons/_icon_status_success.svg'; import warningSvg from 'icons/_icon_status_warning.svg'; +import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge'; import simplePoll from '~/lib/utils/simple_poll'; import { __, sprintf } from '~/locale'; -import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge'; import { GlIcon } from '@gitlab/ui'; import MergeRequest from '../../../merge_request'; import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests'; @@ -26,6 +26,10 @@ export default { CommitEdit, CommitMessageDropdown, GlIcon, + MergeImmediatelyConfirmationDialog: () => + import( + 'ee_component/vue_merge_request_widget/components/merge_immediately_confirmation_dialog.vue' + ), }, mixins: [readyToMergeMixin], props: { @@ -165,6 +169,16 @@ export default { new Flash(__('Something went wrong. Please try again.')); // eslint-disable-line }); }, + handleMergeImmediatelyButtonClick() { + if (this.isMergeImmediatelyDangerous) { + this.$refs.confirmationDialog.show(); + } else { + this.handleMergeButtonClick(false, true); + } + }, + onMergeImmediatelyConfirmation() { + this.handleMergeButtonClick(false, true); + }, initiateMergePolling() { simplePoll( (continuePolling, stopPolling) => { @@ -286,11 +300,16 @@ export default { </a> </li> <li> + <merge-immediately-confirmation-dialog + ref="confirmationDialog" + :docs-url="mr.mergeImmediatelyDocsPath" + @mergeImmediately="onMergeImmediatelyConfirmation" + /> <a - class="accept-merge-request" + class="accept-merge-request js-merge-immediately-button" data-qa-selector="merge_immediately_option" href="#" - @click.prevent="handleMergeButtonClick(false, true)" + @click.prevent="handleMergeImmediatelyButtonClick" > <span class="media"> <span class="merge-opt-icon" aria-hidden="true" v-html="warningSvg"></span> 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 40e6203599f..32a2b7b83f4 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 @@ -23,5 +23,8 @@ export default { shouldShowMergeImmediatelyDropdown() { return this.mr.isPipelineActive && !this.mr.onlyAllowMergeIfPipelineSucceeds; }, + isMergeImmediatelyDangerous() { + return false; + }, }, }; diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js index 4c178950ec1..1a25edee9b8 100644 --- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js +++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js @@ -173,6 +173,7 @@ export default class MergeRequestStore { this.ciEnvironmentsStatusPath = data.ci_environments_status_path; this.securityApprovalsHelpPagePath = data.security_approvals_help_page_path; this.eligibleApproversDocsPath = data.eligible_approvers_docs_path; + this.mergeImmediatelyDocsPath = data.merge_immediately_docs_path; } get isNothingToMergeState() { |