Skip to content

Commit

Permalink
feat: Add SLA reports overview component (#9167)
Browse files Browse the repository at this point in the history
  • Loading branch information
muhsin-k committed Apr 2, 2024
1 parent 631598b commit fc25f43
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/javascript/dashboard/i18n/locale/en/report.json
Expand Up @@ -505,5 +505,18 @@
"THURSDAY": "Thursday",
"FRIDAY": "Friday",
"SATURDAY": "Saturday"
},
"SLA_REPORTS": {
"HEADER": "SLA Reports",
"METRICS": {
"HIT_RATE": {
"LABEL": "Hit Rate",
"TOOLTIP": "Percentage of SLAs created were completed successfully"
},
"NO_OF_BREACHES": {
"LABEL": "Number of Breaches",
"TOOLTIP": "The total SLA breaches in a certain period."
}
}
}
}
@@ -0,0 +1,46 @@
<template>
<div class="flex flex-col gap-2 items-start justify-center min-w-[10rem]">
<span
class="inline-flex items-center gap-1 text-sm text-slate-700 dark:text-slate-200 font-medium"
>
{{ label }}
<fluent-icon
v-tooltip.right="toolTip"
size="14"
icon="information"
type="outline"
class="flex-shrink-0 text-sm font-normal flex sm:font-medium text-slate-500 dark:text-slate-500"
/>
</span>
<div
v-if="isLoading"
class="w-12 h-6 mb-0.5 rounded-md bg-slate-50 animate-pulse"
/>

<span v-else class="text-2xl font-medium text-slate-900 dark:text-slate-25">
{{ value }}
</span>
</div>
</template>
<script>
export default {
props: {
label: {
type: String,
required: true,
},
value: {
type: [String, Number],
required: true,
},
toolTip: {
type: String,
required: true,
},
isLoading: {
type: Boolean,
default: false,
},
},
};
</script>
@@ -0,0 +1,40 @@
<template>
<div
class="flex sm:flex-row flex-col w-full gap-4 sm:gap-14 bg-white dark:bg-slate-900 rounded-xl border border-slate-75 dark:border-slate-700/50 px-6 py-4"
>
<SLAMetricCard
:label="$t('SLA_REPORTS.METRICS.HIT_RATE.LABEL')"
:value="hitRate"
:tool-tip="$t('SLA_REPORTS.METRICS.HIT_RATE.TOOLTIP')"
:is-loading="isLoading"
/>

<div
class="w-full sm:w-px h-full border border-slate-75 dark:border-slate-700/50"
/>
<SLAMetricCard
:label="$t('SLA_REPORTS.METRICS.NO_OF_BREACHES.LABEL')"
:value="noOfBreaches"
:tool-tip="$t('SLA_REPORTS.METRICS.NO_OF_BREACHES.TOOLTIP')"
:is-loading="isLoading"
/>
</div>
</template>

<script setup>
import SLAMetricCard from './SLAMetricCard.vue';
defineProps({
hitRate: {
type: String,
required: true,
},
noOfBreaches: {
type: Number,
required: true,
},
isLoading: {
type: Boolean,
default: false,
},
});
</script>

0 comments on commit fc25f43

Please sign in to comment.