[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
This commit is contained in:
JayashTripathy
2025-06-25 20:49:53 +05:30
committed by GitHub
parent e6744fc9ed
commit 5d799c15fa

View File

@@ -75,7 +75,13 @@ const ProjectsInsightTable = observer(() => {
{row.original.name}
</div>
<TrendPiece
percentage={(row.original.completed_work_items / row.original.total_work_items) * 100}
percentage={
row.original.total_work_items > 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}
/>