1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-21 13:47:39 +02:00

feat: rename health insights to technical debt insights on dashboard (#10082)

This commit is contained in:
Tymoteusz Czech 2025-06-09 13:00:17 +02:00 committed by GitHub
parent 7f14cc2c3d
commit c8933cc8e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,8 +65,29 @@ const ProjectHealthMessage: FC<{
: 'Remember to archive your stale feature flags to keep the project health growing.';
const keepDoingMessage =
'This indicates that you are doing a good job of archiving your feature flags.';
const avgCurrentTechnicalDebt = 100 - (avgHealthCurrentWindow ?? 0);
const avgPastTechnicalDebt = 100 - (avgHealthPastWindow ?? 0);
if (trend === 'improved') {
if (healthToTechDebtEnabled) {
return (
<>
<Typography>
On average, your project technical debt went down from{' '}
<PercentageScore>
{avgPastTechnicalDebt}%
</PercentageScore>{' '}
to{' '}
<PercentageScore>
{avgCurrentTechnicalDebt}%
</PercentageScore>{' '}
during the last 4 weeks.
</Typography>
<Typography>{keepDoingMessage}</Typography>
</>
);
}
return (
<>
<Typography>
@ -81,6 +102,25 @@ const ProjectHealthMessage: FC<{
}
if (trend === 'declined') {
if (healthToTechDebtEnabled) {
return (
<>
<Typography>
On average, your project technical debt went up from{' '}
<PercentageScore>
{avgPastTechnicalDebt}%
</PercentageScore>{' '}
to{' '}
<PercentageScore>
{avgCurrentTechnicalDebt}%
</PercentageScore>{' '}
during the last 4 weeks.
</Typography>
<Typography>{improveMessage}</Typography>
</>
);
}
return (
<>
<Typography>
@ -95,6 +135,21 @@ const ProjectHealthMessage: FC<{
}
if (trend === 'consistent') {
if (healthToTechDebtEnabled) {
return (
<>
<Typography>
On average, your project technical debt has remained at{' '}
<PercentageScore>
{avgCurrentTechnicalDebt}%
</PercentageScore>{' '}
during the last 4 weeks.
</Typography>
<Typography>{keepDoingMessage}</Typography>
</>
);
}
return (
<>
<Typography>
@ -112,6 +167,21 @@ const ProjectHealthMessage: FC<{
}
if (trend === 'unknown') {
if (healthToTechDebtEnabled) {
return (
<>
<Typography>
Your current project technical debt is{' '}
<PercentageScore>
{avgCurrentTechnicalDebt}%
</PercentageScore>
.
</Typography>
<Typography>{improveMessage}</Typography>
</>
);
}
return (
<>
<Typography>
@ -132,6 +202,7 @@ export const ProjectSetupComplete: FC<{
project: string;
insights: PersonalDashboardProjectDetailsSchemaInsights;
}> = ({ project, insights }) => {
const healthToTechDebtEnabled = useFlag('healthToTechDebt');
const projectHealthTrend = determineProjectHealthTrend(insights);
return (
@ -140,7 +211,9 @@ export const ProjectSetupComplete: FC<{
<>
<Lightbulb color='primary' />
<Typography sx={{ fontWeight: 'bold' }} component='h4'>
Project health
{healthToTechDebtEnabled
? 'Technical debt'
: 'Project health'}
</Typography>
</>
}