diff --git a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx index 06004602ec..3cfe3be1da 100644 --- a/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx +++ b/frontend/src/app/projects/dashboard/metrics/[projectKey]/page.tsx @@ -58,19 +58,21 @@ const ProjectHealthMetricsDetails: FC = () => { day: 'numeric', }) ) || [] + return ( -
+
{metricsList && metricsLatest ? ( - <> -
-
+
+ {/* Header */} +
+

{metricsLatest.projectName}

-
+
{ />
+ + {/* Charts */}
- m.starsCount), - }, - ]} - labels={labels} - round - /> - m.forksCount), - }, - ]} - labels={labels} - round - /> +
+ m.starsCount), + }, + ]} + labels={labels} + round + /> +
+ +
+ m.forksCount), + }, + ]} + labels={labels} + round + /> +
+
- m.openIssuesCount), - }, - { - name: 'Unassigned Issues', - data: metricsList.map((m) => m.unassignedIssuesCount), - }, - { - name: 'Unanswered Issues', - data: metricsList.map((m) => m.unansweredIssuesCount), - }, - { - name: 'Total Issues', - data: metricsList.map((m) => m.totalIssuesCount), - }, - ]} - labels={labels} - round - /> - m.openPullRequestsCount), - }, - ]} - labels={labels} - round - /> +
+ m.openIssuesCount), + }, + { + name: 'Unassigned Issues', + data: metricsList.map((m) => m.unassignedIssuesCount), + }, + { + name: 'Unanswered Issues', + data: metricsList.map((m) => m.unansweredIssuesCount), + }, + { + name: 'Total Issues', + data: metricsList.map((m) => m.totalIssuesCount), + }, + ]} + labels={labels} + round + /> +
+ +
+ m.openPullRequestsCount), + }, + ]} + labels={labels} + round + /> +
+
- m.recentReleasesCount), - }, - { - name: 'Total Releases', - data: metricsList.map((m) => m.totalReleasesCount), - }, +
+ m.recentReleasesCount), + }, + { + name: 'Total Releases', + data: metricsList.map((m) => m.totalReleasesCount), + }, + ]} + labels={labels} + round + /> +
+ +
+ m.contributorsCount), + }, + ]} + labels={labels} + round + /> +
+
+ + {/* Bar chart */} +
+ - m.contributorsCount), - }, + days={[ + metricsLatest.ageDays, + metricsLatest.lastCommitDays, + metricsLatest.lastReleaseDays, + metricsLatest.lastPullRequestDays, + metricsLatest.owaspPageLastUpdateDays, + ]} + requirements={[ + metricsLatest.ageDaysRequirement, + metricsLatest.lastCommitDaysRequirement, + metricsLatest.lastReleaseDaysRequirement, + metricsLatest.lastPullRequestDaysRequirement, + metricsLatest.owaspPageLastUpdateDaysRequirement, ]} - labels={labels} - round + reverseColors={[true, false, false, false, false]} />
- - +
) : ( -
No metrics data available for this project.
+
+ No metrics data available for this project. +
)}
) diff --git a/frontend/src/app/projects/dashboard/page.tsx b/frontend/src/app/projects/dashboard/page.tsx index 6ff4809714..a4fa26d88e 100644 --- a/frontend/src/app/projects/dashboard/page.tsx +++ b/frontend/src/app/projects/dashboard/page.tsx @@ -53,32 +53,25 @@ const ProjectsDashboardPage: FC = () => { ) } - const projectsCardsItems: { - type: 'healthy' | 'needsAttention' | 'unhealthy' - count: number - icon: IconType - }[] = [ + const projectsCardsItems = [ { - type: 'healthy', + type: 'healthy' as const, count: stats.projectsCountHealthy, icon: FaCheck, }, { - type: 'needsAttention', + type: 'needsAttention' as const, count: stats.projectsCountNeedAttention, icon: FaTriangleExclamation, }, { - type: 'unhealthy', + type: 'unhealthy' as const, count: stats.projectsCountUnhealthy, icon: FaRectangleXmark, }, ] - const dashboardCardsItems: { - title: string - icon: IconType - stats?: string - }[] = [ + + const dashboardCardsItems = [ { title: 'Average Score', icon: FaChartLine, @@ -100,12 +93,17 @@ const ProjectsDashboardPage: FC = () => { stats: millify(stats.totalStars), }, ] + return ( - <> -
+
+

Project Health Dashboard Overview

- +
+
{projectsCardsItems.map((item) => ( { /> ))}
+
{dashboardCardsItems.map((item) => ( - + ))}
+ + {/* Charts section */}
- { - const date = new Date(2025, month - 1, 1) - return date.toLocaleString('default', { month: 'short' }) - })} - /> - +
+ { + const date = new Date(2025, month - 1, 1) + return date.toLocaleString('default', { month: 'short' }) + })} + /> +
+ +
+ +
- +
) }