2019-06-11 14:19:22 +00:00
|
|
|
import { __ } from '~/locale';
|
|
|
|
|
2019-09-18 14:02:45 +00:00
|
|
|
export const MERGE_DISABLED_TEXT = __('You can only merge once the items above are resolved.');
|
2020-05-07 15:09:29 +00:00
|
|
|
export const PIPELINE_MUST_SUCCEED_CONFLICT_TEXT = __(
|
2020-07-08 00:09:06 +00:00
|
|
|
'A CI/CD pipeline must run and be successful before merge.',
|
2020-05-07 15:09:29 +00:00
|
|
|
);
|
2019-09-18 14:02:45 +00:00
|
|
|
|
2019-04-24 14:09:04 +00:00
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
isMergeButtonDisabled() {
|
|
|
|
const { commitMessage } = this;
|
|
|
|
return Boolean(
|
|
|
|
!commitMessage.length ||
|
|
|
|
!this.shouldShowMergeControls ||
|
|
|
|
this.isMakingRequest ||
|
|
|
|
this.mr.preventMerge,
|
|
|
|
);
|
|
|
|
},
|
2019-09-18 14:02:45 +00:00
|
|
|
mergeDisabledText() {
|
|
|
|
return MERGE_DISABLED_TEXT;
|
|
|
|
},
|
2020-05-07 15:09:29 +00:00
|
|
|
pipelineMustSucceedConflictText() {
|
|
|
|
return PIPELINE_MUST_SUCCEED_CONFLICT_TEXT;
|
|
|
|
},
|
2019-06-11 14:19:22 +00:00
|
|
|
autoMergeText() {
|
|
|
|
// MWPS is currently the only auto merge strategy available in CE
|
|
|
|
return __('Merge when pipeline succeeds');
|
|
|
|
},
|
2019-08-12 16:27:13 +00:00
|
|
|
shouldShowMergeImmediatelyDropdown() {
|
2021-01-04 18:10:11 +00:00
|
|
|
return this.isPipelineActive && !this.stateData.onlyAllowMergeIfPipelineSucceeds;
|
2019-08-12 16:27:13 +00:00
|
|
|
},
|
2019-12-06 21:07:54 +00:00
|
|
|
isMergeImmediatelyDangerous() {
|
|
|
|
return false;
|
|
|
|
},
|
2020-08-14 00:10:28 +00:00
|
|
|
shouldRenderMergeTrainHelperText() {
|
|
|
|
return false;
|
|
|
|
},
|
2021-02-04 12:09:25 +00:00
|
|
|
pipelineId() {
|
|
|
|
return this.pipeline.id;
|
|
|
|
},
|
2019-04-24 14:09:04 +00:00
|
|
|
},
|
|
|
|
};
|