mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
[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:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user