blob: 38b99dae264ae79869b1b5eb782ee73ca8d8309a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<script>
import { s__ } from '~/locale';
import StatusIcon from '../mr_widget_status_icon.vue';
import { DETAILED_MERGE_STATUS } from '../../constants';
export default {
i18n: {
approvalNeeded: s__('mrWidget|Merge blocked: all required approvals must be given.'),
blockingMergeRequests: s__(
'mrWidget|Merge blocked: you can only merge after the above items are resolved.',
),
externalStatusChecksFailed: s__('mrWidget|Merge blocked: all status checks must pass.'),
},
components: {
StatusIcon,
},
props: {
mr: {
type: Object,
required: true,
},
},
computed: {
failedText() {
if (this.mr.approvals && !this.mr.isApproved) {
return this.$options.i18n.approvalNeeded;
} else if (this.mr.detailedMergeStatus === DETAILED_MERGE_STATUS.BLOCKED_STATUS) {
return this.$options.i18n.blockingMergeRequests;
} else if (this.mr.detailedMergeStatus === DETAILED_MERGE_STATUS.EXTERNAL_STATUS_CHECKS) {
return this.$options.i18n.externalStatusChecksFailed;
}
return null;
},
},
};
</script>
<template>
<div class="mr-widget-body media gl-flex-wrap">
<status-icon status="failed" />
<p class="media-body gl-m-0! gl-font-weight-bold gl-text-black-normal!">
{{ failedText }}
</p>
</div>
</template>
|