From df08b466b2d4d0cfb775f0509aff1542e6a28f5c Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Fri, 26 Apr 2024 16:56:33 +0200 Subject: [PATCH] fix: statusCounts on score equal to 0 --- .../routes/(app)/compliance-assessments/[id=uuid]/+page.svelte | 2 +- .../src/routes/(app)/compliance-assessments/[id=uuid]/types.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte index fac372376..d43674ad8 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte @@ -39,7 +39,7 @@ if (node.status && node.assessable) { statusCounts[node.status] = (statusCounts[node.status] || 0) + 1; } - if (node.score && node.assessable && node.status !== 'not_applicable') { + if (node.is_scored && node.assessable && node.status !== 'not_applicable') { statusCounts['scored'] = (statusCounts['scored'] || 0) + 1; statusCounts['total_score'] = (statusCounts['total_score'] || 0) + node.score; } diff --git a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/types.ts b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/types.ts index f56aec876..5f86ff04d 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/types.ts +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/types.ts @@ -9,4 +9,5 @@ export interface Node { children?: Record; status?: string; // Assuming that the status field exists in nodes similar to leaves score?: number; // Assuming that the score field exists in nodes similar to leaves + is_scored?: boolean; // Assuming that the is_scored field exists in nodes similar to leaves }