@@ -65,6 +65,8 @@ const rollupRanking = computed(() => {
65
65
const category = getMetricCategory (key, value / 100 )
66
66
ranking[key] = { category, score: value }
67
67
68
+ if (category .name .toLowerCase () === " offline" ) continue
69
+
68
70
description .push ({
69
71
text: getMetricDescription (key),
70
72
category,
@@ -77,11 +79,20 @@ const rollupRanking = computed(() => {
77
79
score: rawRanking .rank ,
78
80
}
79
81
80
- description = sortArrayOfObjects (description, " category.rank" , false ).slice (0 , 3 )
81
- description[0 ].text += " , "
82
- description[1 ].text += " and "
83
- description[2 ].text += " ."
84
-
82
+ if (description .length ) {
83
+ description = sortArrayOfObjects (description, " category.rank" , false ).slice (0 , Math .min (3 , description .length ))
84
+ if (description[2 ]? .text ) {
85
+ description[0 ].text += " , "
86
+ description[1 ].text += " and "
87
+ description[2 ].text += " ."
88
+ } else if (description[1 ]? .text ) {
89
+ description[0 ].text += " and "
90
+ description[1 ].text += " ."
91
+ } else {
92
+ description[0 ].text += " ."
93
+ }
94
+ }
95
+
85
96
return {
86
97
... rollupRaw,
87
98
ranking,
@@ -428,7 +439,7 @@ onMounted(() => {
428
439
</Flex>
429
440
</Flex>
430
441
431
- <Text size="13" color="primary" weight="600" :style="{ lineHeight: '1.4' }">
442
+ <Text v-if="rollupRanking?.description.length" size="13" color="primary" weight="600" :style="{ lineHeight: '1.4' }">
432
443
{{ rollup.name }}
433
444
<Text weight="500" color="secondary">shows the </Text>
434
445
<span v-for="d in rollupRanking?.description">
@@ -438,6 +449,10 @@ onMounted(() => {
438
449
<Text weight="500" color="secondary"> {{ d.text }} </Text>
439
450
</span>
440
451
</Text>
452
+ <Text v-else size="13" color="primary" weight="600" :style="{ lineHeight: '1.4' }">
453
+ {{ rollup.name }}
454
+ <Text weight="500" color="secondary"> is possible offline. </Text>
455
+ </Text>
441
456
</Flex>
442
457
<div :class="$style.divider" />
443
458
0 commit comments