From b15502ec5e1b51b03a2b7f5f2f848b01165b8133 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Mon, 17 Feb 2025 13:41:04 +0100 Subject: [PATCH] fix(1-3377): handle singular counts in project status lifecycle boxes (#9317) If the average number of days in a stage is 1, use `1 day` instead of `1 days`. Likewise, if your total number of archived flags is 1, use `1 flag archived` instead of `1 flags archived`. I grepped through the file, but couldn't find any other hardcoded instances of "flags" or "days", so I think this is everything. --- .../Project/ProjectStatus/ProjectLifecycleSummary.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectStatus/ProjectLifecycleSummary.tsx b/frontend/src/component/project/Project/ProjectStatus/ProjectLifecycleSummary.tsx index eb4cdcfb74..967b1fde9e 100644 --- a/frontend/src/component/project/Project/ProjectStatus/ProjectLifecycleSummary.tsx +++ b/frontend/src/component/project/Project/ProjectStatus/ProjectLifecycleSummary.tsx @@ -116,6 +116,8 @@ const AverageDaysStat: FC<{ averageDays?: number | null }> = ({ if (averageDays < 1) { return 'less than a day'; + } else if (averageDays === 1) { + return '1 day'; } return `${averageDays} days`; }; @@ -165,6 +167,10 @@ export const ProjectLifecycleSummary = () => { ); }; + const archivedLast30DaysCount = + data?.lifecycleSummary.archived.last30Days ?? 0; + const totalArchivedText = `${archivedLast30DaysCount} ${archivedLast30DaysCount === 1 ? 'flag' : 'flags'} archived`; + return ( @@ -258,8 +264,7 @@ export const ProjectLifecycleSummary = () => {
Last 30 days
- {data?.lifecycleSummary.archived.last30Days ?? 0} flags - archived + {totalArchivedText}