From 5d799c15fafbee91ee0d3e840210e8874bbb2a51 Mon Sep 17 00:00:00 2001 From: JayashTripathy <76092296+JayashTripathy@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:49:53 +0530 Subject: [PATCH] [WEB-4381] fix: Default value to completion percentage in project analytics table (#3496) * fix: handle division by zero in projects insight table percentage calculation * fix: handle NaN in percentage calculation for completed work items in projects insight table --- .../analytics/projects/projects-insight-table.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/ee/components/analytics/projects/projects-insight-table.tsx b/web/ee/components/analytics/projects/projects-insight-table.tsx index 8a599e35eb..c499925788 100644 --- a/web/ee/components/analytics/projects/projects-insight-table.tsx +++ b/web/ee/components/analytics/projects/projects-insight-table.tsx @@ -75,7 +75,13 @@ const ProjectsInsightTable = observer(() => { {row.original.name} 0 + ? isNaN((row.original.completed_work_items / row.original.total_work_items) * 100) + ? 0 + : (row.original.completed_work_items / row.original.total_work_items) * 100 + : 0 + } variant="tinted" trendIconVisible={false} />