Skip to content

Commit

Permalink
exclude transverse criteria to calculate not applicable and compliant…
Browse files Browse the repository at this point in the history
… criteria
  • Loading branch information
bellangerq committed Sep 20, 2024
1 parent 1ca2db6 commit be29bcf
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions confiture-web-app/src/composables/useAuditStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit be29bcf

Please sign in to comment.