Commit 138afd05 authored by Phil Hughes's avatar Phil Hughes

Merge branch '10099-ee-differences-for-ready-to-merge' into 'master'

Move EE differences for `ready_to_merge.vue`

Closes #10099

See merge request gitlab-org/gitlab-ee!11429
parents e0b6a577 c027ebfb
......@@ -3,6 +3,7 @@ import successSvg from 'icons/_icon_status_success.svg';
import warningSvg from 'icons/_icon_status_warning.svg';
import simplePoll from '~/lib/utils/simple_poll';
import { __ } from '~/locale';
import readyToMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/ready_to_merge';
import MergeRequest from '../../../merge_request';
import Flash from '../../../flash';
import statusIcon from '../mr_widget_status_icon.vue';
......@@ -21,6 +22,7 @@ export default {
CommitEdit,
CommitMessageDropdown,
},
mixins: [readyToMergeMixin],
props: {
mr: { type: Object, required: true },
service: { type: Object, required: true },
......@@ -94,16 +96,6 @@ export default {
shouldShowMergeOptionsDropdown() {
return this.mr.isPipelineActive && !this.mr.onlyAllowMergeIfPipelineSucceeds;
},
isMergeButtonDisabled() {
const { commitMessage } = this;
return Boolean(
!commitMessage.length ||
!this.shouldShowMergeControls ||
this.isMakingRequest ||
this.isApprovalNeeded ||
this.mr.preventMerge,
);
},
isRemoveSourceBranchButtonDisabled() {
return this.isMergeButtonDisabled;
},
......@@ -111,9 +103,6 @@ export default {
const { commitsCount, enableSquashBeforeMerge } = this.mr;
return enableSquashBeforeMerge && commitsCount > 1;
},
isApprovalNeeded() {
return this.mr.hasApprovalsAvailable ? !this.mr.isApproved : false;
},
shouldShowMergeControls() {
return this.mr.isMergeAllowed || this.shouldShowMergeWhenPipelineSucceedsText;
},
......
export default {
computed: {
isMergeButtonDisabled() {
const { commitMessage } = this;
return Boolean(
!commitMessage.length ||
!this.shouldShowMergeControls ||
this.isMakingRequest ||
this.mr.preventMerge,
);
},
},
};
export default {
computed: {
isApprovalNeeded() {
return this.mr.hasApprovalsAvailable ? !this.mr.isApproved : false;
},
isMergeButtonDisabled() {
const { commitMessage } = this;
return Boolean(
!commitMessage.length ||
!this.shouldShowMergeControls ||
this.isMakingRequest ||
this.isApprovalNeeded ||
this.mr.preventMerge,
);
},
},
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment