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

68 lines
1.4 KiB
Vue
Raw Normal View History

2018-11-18 11:00:15 +05:30
<script>
2021-09-30 23:02:18 +05:30
import {
components,
componentNames,
iconComponents,
iconComponentNames,
} from 'ee_else_ce/reports/components/issue_body';
2018-11-18 11:00:15 +05:30
export default {
2018-12-13 13:39:08 +05:30
name: 'ReportItem',
2018-11-18 11:00:15 +05:30
components: {
...components,
2021-09-30 23:02:18 +05:30
...iconComponents,
2018-11-18 11:00:15 +05:30
},
props: {
2018-12-13 13:39:08 +05:30
issue: {
type: Object,
2018-11-18 11:00:15 +05:30
required: true,
},
component: {
type: String,
required: false,
default: '',
2021-03-08 18:12:59 +05:30
validator: (value) => value === '' || Object.values(componentNames).includes(value),
2018-11-18 11:00:15 +05:30
},
2021-09-30 23:02:18 +05:30
iconComponent: {
type: String,
required: false,
default: iconComponentNames.IssueStatusIcon,
validator: (value) => Object.values(iconComponentNames).includes(value),
},
2018-11-18 11:00:15 +05:30
// failed || success
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
isNew: {
type: Boolean,
required: false,
default: false,
},
2019-09-04 21:01:54 +05:30
showReportSectionStatusIcon: {
type: Boolean,
required: false,
default: true,
},
2018-11-18 11:00:15 +05:30
},
};
</script>
<template>
2021-11-11 11:23:49 +05:30
<li class="report-block-list-issue align-items-center" data-qa-selector="report_item_row">
2021-09-30 23:02:18 +05:30
<component
:is="iconComponent"
2019-09-04 21:01:54 +05:30
v-if="showReportSectionStatusIcon"
:status="status"
:status-icon-size="statusIconSize"
2021-09-30 23:02:18 +05:30
class="gl-mr-2"
2019-09-04 21:01:54 +05:30
/>
2018-11-18 11:00:15 +05:30
2019-02-15 15:39:39 +05:30
<component :is="component" v-if="component" :issue="issue" :status="status" :is-new="isNew" />
2018-12-13 13:39:08 +05:30
</li>
2018-11-18 11:00:15 +05:30
</template>