From be29bcfae0f9137a9147b9ff1e000de1a8b8c3ce Mon Sep 17 00:00:00 2001 From: Quentin Bellanger Date: Fri, 20 Sep 2024 17:25:24 +0200 Subject: [PATCH] exclude transverse criteria to calculate not applicable and compliant criteria --- .../src/composables/useAuditStats.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/confiture-web-app/src/composables/useAuditStats.ts b/confiture-web-app/src/composables/useAuditStats.ts index d94a7ae7..d030c873 100644 --- a/confiture-web-app/src/composables/useAuditStats.ts +++ b/confiture-web-app/src/composables/useAuditStats.ts @@ -32,18 +32,22 @@ export function useAuditStats() { const notApplicableCriteriaCount = computed(() => { return Object.values(groupedCriteria.value).filter((criteria) => { - return criteria.every((c) => c.status === "NOT_APPLICABLE"); + return criteria + .slice(1) + .every((c) => c.status === CriteriumResultStatus.NOT_APPLICABLE); }).length; }); const compliantCriteriaCount = computed(() => { - return applicableCriteria.value.filter((criteria) => - criteria.every( - (c) => - c.status === CriteriumResultStatus.COMPLIANT || - c.status === CriteriumResultStatus.NOT_APPLICABLE - ) - ).length; + return applicableCriteria.value.filter((criteria) => { + return criteria + .slice(1) + .every( + (c) => + c.status === CriteriumResultStatus.COMPLIANT || + c.status === CriteriumResultStatus.NOT_APPLICABLE + ); + }).length; }); const notCompliantCriteriaCount = computed(() => {