Skip to content

Commit

Permalink
harmonize nc and c gauges on both audit and report
Browse files Browse the repository at this point in the history
  • Loading branch information
bellangerq committed Oct 10, 2024
1 parent a53c585 commit 8190e84
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion confiture-web-app/src/components/report/ReportResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const stats = computed(() => {
{
title: "Critères<br/> conformes",
value: report.data?.criteriaCount.compliant,
total: report.data?.criteriaCount.total,
total: report.data?.criteriaCount.applicable,
theme: "green" as StatDonutTheme
}
];
Expand Down
7 changes: 6 additions & 1 deletion confiture-web-app/src/composables/useAuditStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export function useAuditStats() {

const applicableCriteria = computed(() => {
return Object.values(groupedCriteria.value).filter((criteria) =>
criteria.some((c) => c.status !== CriteriumResultStatus.NOT_APPLICABLE)
criteria.some(
(c) =>
c.status !== CriteriumResultStatus.NOT_APPLICABLE &&
c.status !== CriteriumResultStatus.NOT_TESTED
)
);
});

Expand Down Expand Up @@ -118,6 +122,7 @@ export function useAuditStats() {

return {
groupedCriteria,
applicableCriteriaCount: applicableCriteria,
notApplicableCriteriaCount,
compliantCriteriaCount,
notCompliantCriteriaCount,
Expand Down
7 changes: 4 additions & 3 deletions confiture-web-app/src/pages/audit/AuditGenerationPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import rgaa from "../../criteres.json";
import { CRITERIA_BY_AUDIT_TYPE } from "../../criteria";
import { useAuditStore, useFiltersStore, useResultsStore } from "../../store";
import { AuditPage, AuditType, CriteriumResultStatus } from "../../types";
import { getCriteriaCount, pluralize } from "../../utils";
import { pluralize } from "../../utils";
const route = useRoute();
Expand Down Expand Up @@ -89,6 +89,7 @@ function updateCurrentPageId(i: number) {
const {
complianceLevel,
compliantCriteriaCount,
applicableCriteriaCount,
notCompliantCriteriaCount,
blockingCriteriaCount
} = useAuditStats();
Expand Down Expand Up @@ -119,13 +120,13 @@ const headerInfos = computed(() => [
blockingCriteriaCount.value
)} pour l’usager`,
value: notCompliantCriteriaCount.value,
total: getCriteriaCount(auditStore.currentAudit?.auditType as AuditType),
total: applicableCriteriaCount.value.length,
theme: "red" as StatDonutTheme
},
{
title: "Critères<br/> conformes",
value: compliantCriteriaCount.value,
total: getCriteriaCount(auditStore.currentAudit?.auditType as AuditType),
total: applicableCriteriaCount.value.length,
theme: "green" as StatDonutTheme
}
]);
Expand Down

0 comments on commit 8190e84

Please sign in to comment.