-
Notifications
You must be signed in to change notification settings - Fork 56
feat: migrate health score displays to v2 and implement Health Score v2 content spec IN-1212 #2054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gaspergrom
wants to merge
12
commits into
main
Choose a base branch
from
feat/IN-1212
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0d44926
feat: migrate health score display to v2 IN-1212
gaspergrom f44a61c
refactor: minimize health score v2 migration code IN-1212
gaspergrom 5c22821
fix: correct v2 health score loading state and restore exclusion foot…
gaspergrom 672e11a
fix: remove health score popup, add error state, delete dead v1 overv…
gaspergrom a6a8b5d
fix: correct null-healthLabel badge fallback and dot-color mismatch I…
gaspergrom 6e8ca31
fix: trim unused v2 fields from overview health-score route IN-1212
gaspergrom ba12452
fix: restore archived-state and repo-scoping guards, fix fair-label c…
gaspergrom cce2c46
fix: make archived-state exclusive with score content, gate share bad…
gaspergrom 5b0ad90
feat: rebuild project overview with health/impact breakdown sections …
gaspergrom d422b79
fix: remove false repo-scoping banner, add impact error state, fix br…
gaspergrom 2a325fd
feat: migrate health score displays to v2 backend IN-1212
gaspergrom 556656a
Merge branch 'main' into feat/IN-1212
gaspergrom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
frontend/app/components/modules/project/components/overview/trust-score-v2.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| <!-- | ||
| Copyright (c) 2025 The Linux Foundation and each contributor. | ||
| SPDX-License-Identifier: MIT | ||
| --> | ||
| <template> | ||
| <div class="px-6"> | ||
| <div class="flex flex-row justify-between"> | ||
| <div class="pr-6 w-full"> | ||
| <h2 class="text-heading-3 font-bold font-secondary mb-2">Health score</h2> | ||
|
|
||
| <lfx-skeleton-state | ||
| v-if="status !== 'pending' && !isEmpty" | ||
| :status="status" | ||
| height="1.75rem" | ||
| width="11.5rem" | ||
| > | ||
| <div class="flex items-center gap-3 text-3xl font-bold cursor-default"> | ||
| <div | ||
| class="h-3 w-3 rounded-full shrink-0" | ||
| :class="scoreColorClass" | ||
| /> | ||
| {{ scoreLabel }} | ||
| <span | ||
| v-if="healthScoreV2 !== null" | ||
| class="text-neutral-500 text-lg font-semibold" | ||
| >{{ healthScoreV2 }}/100</span | ||
| > | ||
| </div> | ||
| </lfx-skeleton-state> | ||
|
|
||
| <div | ||
| v-if="isEmpty && status !== 'pending'" | ||
| class="text-xs text-neutral-500 mt-4" | ||
| > | ||
| LFX Insights does not have enough meaningful data to generate an overall Health score for this project. | ||
| </div> | ||
| <p | ||
| v-else | ||
| class="text-xs text-neutral-500 mt-4" | ||
| > | ||
| The Insights Health Score measures an open source project's overall trustworthiness. | ||
| <a | ||
| :href="links.trustScore" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="text-brand-500" | ||
| >Learn more</a | ||
| > | ||
| </p> | ||
| </div> | ||
| <div | ||
| v-if="!isEmpty && status === 'success'" | ||
| class="w-[200px] hidden sm:block" | ||
| > | ||
| <lfx-project-trust-score-share-badge /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { computed } from 'vue'; | ||
| import type { AsyncDataRequestStatus } from 'nuxt/app'; | ||
| import LfxProjectTrustScoreShareBadge from './trust-score/share-badge.vue'; | ||
| import { links } from '~/config/links'; | ||
| import { getHealthScoreV2Config } from '~~/config/trust-score'; | ||
| import LfxSkeletonState from '~/components/modules/project/components/shared/skeleton-state.vue'; | ||
|
|
||
| const props = defineProps<{ | ||
| healthScoreV2: number | null; | ||
| healthLabel: string | null; | ||
| status: AsyncDataRequestStatus; | ||
| }>(); | ||
|
|
||
| const isEmpty = computed(() => props.healthScoreV2 === null); | ||
|
|
||
| const scoreLabel = computed(() => getHealthScoreV2Config(props.healthLabel).label); | ||
|
|
||
| const scoreColorClass = computed(() => { | ||
| const label = props.healthLabel; | ||
| if (label === 'excellent' || label === 'healthy') return 'bg-positive-500'; | ||
| if (label === 'fair') return 'bg-brand-500'; | ||
| if (label === 'concerning') return 'bg-warning-500'; | ||
| return 'bg-negative-500'; | ||
| }); | ||
| </script> | ||
| <script lang="ts"> | ||
| export default { | ||
| name: 'LfxProjectTrustScoreV2', | ||
| }; | ||
| </script> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.