2021-11-11 11:23:49 +05:30
|
|
|
<script>
|
|
|
|
import { s__ } from '~/locale';
|
|
|
|
import StatusIcon from '../mr_widget_status_icon.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
i18n: {
|
2022-01-26 12:08:38 +05:30
|
|
|
approvalNeeded: s__('mrWidget|Merge blocked: this merge request must be approved.'),
|
2022-03-02 08:16:31 +05:30
|
|
|
blockingMergeRequests: s__(
|
|
|
|
'mrWidget|Merge blocked: you can only merge after the above items are resolved.',
|
|
|
|
),
|
2021-11-11 11:23:49 +05:30
|
|
|
},
|
|
|
|
components: {
|
|
|
|
StatusIcon,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
mr: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
failedText() {
|
2022-03-02 08:16:31 +05:30
|
|
|
if (this.mr.approvals && !this.mr.isApproved) {
|
2021-11-11 11:23:49 +05:30
|
|
|
return this.$options.i18n.approvalNeeded;
|
2022-03-02 08:16:31 +05:30
|
|
|
} else if (this.mr.blockingMergeRequests?.total_count > 0) {
|
|
|
|
return this.$options.i18n.blockingMergeRequests;
|
2021-11-11 11:23:49 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="mr-widget-body media gl-flex-wrap">
|
|
|
|
<status-icon status="warning" />
|
|
|
|
<p class="media-body gl-m-0! gl-font-weight-bold gl-text-black-normal!">
|
|
|
|
{{ failedText }}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</template>
|