debian-mirror-gitlab/app/assets/javascripts/reports/components/issue_status_icon.vue

55 lines
1.1 KiB
Vue
Raw Normal View History

2018-11-18 11:00:15 +05:30
<script>
2020-11-24 15:15:51 +05:30
import { GlIcon } from '@gitlab/ui';
2018-12-13 13:39:08 +05:30
import { STATUS_FAILED, STATUS_NEUTRAL, STATUS_SUCCESS } from '../constants';
2018-11-18 11:00:15 +05:30
export default {
name: 'IssueStatusIcon',
components: {
2020-11-24 15:15:51 +05:30
GlIcon,
2018-11-18 11:00:15 +05:30
},
props: {
status: {
type: String,
required: true,
},
2019-07-07 11:18:12 +05:30
statusIconSize: {
type: Number,
required: false,
2019-09-30 21:07:59 +05:30
default: 24,
2019-07-07 11:18:12 +05:30
},
2018-11-18 11:00:15 +05:30
},
computed: {
iconName() {
if (this.isStatusFailed) {
return 'status_failed_borderless';
} else if (this.isStatusSuccess) {
return 'status_success_borderless';
}
2020-05-24 23:13:21 +05:30
return 'dash';
2018-11-18 11:00:15 +05:30
},
isStatusFailed() {
return this.status === STATUS_FAILED;
},
isStatusSuccess() {
return this.status === STATUS_SUCCESS;
},
isStatusNeutral() {
return this.status === STATUS_NEUTRAL;
},
},
};
</script>
<template>
<div
:class="{
failed: isStatusFailed,
success: isStatusSuccess,
neutral: isStatusNeutral,
}"
class="report-block-list-icon"
>
2020-11-24 15:15:51 +05:30
<gl-icon :name="iconName" :size="statusIconSize" :data-qa-selector="`status_${status}_icon`" />
2018-11-18 11:00:15 +05:30
</div>
</template>