@@ -6,11 +6,48 @@ SPDX-License-Identifier: MIT
66 <lfx-tabs-panels >
77 <lfx-tabs
88 v-model =" selectedTab"
9- :tabs =" tabs "
9+ :tabs =" tabsOptions "
1010 >
1111 <template #slotItem =" { option } " >
12- <div class =" flex flex-col gap-2 items-start" >
13- <div class =" text-neutral-900 font-secondary text-sm tab-label" >
12+ <lfx-tooltip
13+ v-if =" !scoreDisplay[option.value as keyof typeof scoreDisplay]"
14+ class =" !w-full"
15+ >
16+ <template #content >
17+ <p class =" max-w-60" >
18+ {{ option.label }} metrics are unavailable because the required data isn't available for this project.
19+ <a
20+ :href =" links.securityScore"
21+ target =" _blank"
22+ class =" text-brand-500"
23+ >Learn more</a
24+ >
25+ </p >
26+ </template >
27+ <div class =" flex flex-col gap-2 items-start cursor-not-allowed" >
28+ <div class =" text-sm tab-label text-neutral-400" >
29+ {{ option.label }}
30+ </div >
31+ <div class =" text-sm text-gray-500 w-full" >
32+ <lfx-skeleton-state
33+ :status =" status"
34+ height =" .188rem"
35+ width =" 100%"
36+ >
37+ <lfx-progress-bar
38+ size =" small"
39+ :values =" [getValues(option.value)]"
40+ :color =" getColor(getValues(option.value))"
41+ />
42+ </lfx-skeleton-state >
43+ </div >
44+ </div >
45+ </lfx-tooltip >
46+ <div
47+ v-else
48+ class =" flex flex-col gap-2 items-start"
49+ >
50+ <div class =" text-sm tab-label text-neutral-900" >
1451 {{ option.label }}
1552 </div >
1653 <div class =" text-sm text-gray-500 w-full" >
@@ -79,6 +116,8 @@ import type { ScoreDisplay } from '~~/types/overview/score-display.types';
79116import LfxProjectLoadState from ' ~~/app/components/modules/project/components/shared/load-state.vue' ;
80117import LfxSkeletonState from ' ~/components/modules/project/components/shared/skeleton-state.vue' ;
81118import type { WidgetArea } from ' ~/components/modules/widget/types/widget-area' ;
119+ import { links } from ' ~/config/links' ;
120+ import LfxTooltip from ' ~/components/uikit/tooltip/tooltip.vue' ;
82121
83122const props = defineProps <{
84123 trustScoreSummary: TrustScoreSummary | undefined ;
@@ -97,6 +136,13 @@ const selectedTab = computed({
97136 set : (value : string ) => emit (' update:modelValue' , value ),
98137});
99138
139+ const tabsOptions = computed (() => {
140+ return props .tabs .map ((tab ) => ({
141+ ... tab ,
142+ disabled: ! props .scoreDisplay [tab .value as keyof typeof props .scoreDisplay ],
143+ }));
144+ });
145+
100146const getColor = (value : number ) => {
101147 switch (true ) {
102148 case value > 75 :
0 commit comments