debian-mirror-gitlab/app/assets/javascripts/sidebar/components/severity/severity.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.1 KiB
Vue
Raw Normal View History

2020-11-24 15:15:51 +05:30
<script>
import { GlIcon } from '@gitlab/ui';
2022-05-07 20:08:51 +05:30
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue';
2020-11-24 15:15:51 +05:30
export default {
components: {
GlIcon,
2022-05-07 20:08:51 +05:30
TooltipOnTruncate,
2020-11-24 15:15:51 +05:30
},
props: {
severity: {
type: Object,
required: true,
validator(severity) {
const { value, label, icon } = severity;
return value && label && icon;
},
},
iconSize: {
type: Number,
required: false,
default: 12,
},
iconOnly: {
type: Boolean,
required: false,
default: false,
},
},
};
</script>
<template>
<div
2022-05-07 20:08:51 +05:30
class="incident-severity gl-display-inline-flex gl-align-items-center gl-justify-content-between gl-max-w-full"
2020-11-24 15:15:51 +05:30
>
<gl-icon
:size="iconSize"
:name="`severity-${severity.icon}`"
2022-08-27 11:52:29 +05:30
:class="[`icon-${severity.icon}`, { 'gl-mr-3 gl-flex-shrink-0': !iconOnly }]"
2020-11-24 15:15:51 +05:30
/>
2022-08-27 11:52:29 +05:30
<tooltip-on-truncate v-if="!iconOnly" :title="severity.label" class="gl-text-truncate">
{{ severity.label }}
</tooltip-on-truncate>
2020-11-24 15:15:51 +05:30
</div>
</template>