debian-mirror-gitlab/app/assets/javascripts/reports/components/summary_row.vue
2019-09-30 21:07:59 +05:30

65 lines
1.4 KiB
Vue

<script>
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Popover from '~/vue_shared/components/help_popover.vue';
import { GlLoadingIcon } from '@gitlab/ui';
/**
* Renders the summary row for each report
*
* Used both in MR widget and Pipeline's view for:
* - Unit tests reports
* - Security reports
*/
export default {
name: 'ReportSummaryRow',
components: {
CiIcon,
Popover,
GlLoadingIcon,
},
props: {
summary: {
type: String,
required: true,
},
statusIcon: {
type: String,
required: true,
},
popoverOptions: {
type: Object,
required: false,
default: null,
},
},
computed: {
iconStatus() {
return {
group: this.statusIcon,
icon: `status_${this.statusIcon}`,
};
},
},
};
</script>
<template>
<div
class="report-block-list-issue report-block-list-issue-parent justify-content-center align-items-center"
>
<div class="report-block-list-icon append-right-default">
<gl-loading-icon
v-if="statusIcon === 'loading'"
css-class="report-block-list-loading-icon"
size="md"
/>
<ci-icon v-else :status="iconStatus" :size="24" />
</div>
<div class="report-block-list-issue-description">
<div class="report-block-list-issue-description-text">{{ summary }}</div>
<popover v-if="popoverOptions" :options="popoverOptions" />
</div>
</div>
</template>