diff --git a/CHANGELOG.md b/CHANGELOG.md index a97addcc..7693432f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Tous les changements notables de Ara sont documentés ici avec leur date, leur c ## 22/11/2024 +### Autres changements ⚙️ + +- Change le texte du bouton principal des audits à 0% dans la liste des audits de "Continuer l’audit" à "Commencer l’audit" ([#843](https://github.com/DISIC/Ara/pull/843)) + ### Corrections 🐛 - Corrige le problème des filtres des critères qui décalait l’ordre des pages de l’échantillon sur la page d’audit ([#877](https://github.com/DISIC/Ara/pull/877)) diff --git a/confiture-rest-api/src/audits/audit.service.ts b/confiture-rest-api/src/audits/audit.service.ts index f613c9e8..99c77820 100644 --- a/confiture-rest-api/src/audits/audit.service.ts +++ b/confiture-rest-api/src/audits/audit.service.ts @@ -1382,7 +1382,12 @@ export class AuditService { "auditType" ), complianceLevel, - status: auditIsComplete ? "COMPLETED" : "IN_PROGRESS", + status: + progress === 0 + ? "NOT_STARTED" + : auditIsComplete + ? "COMPLETED" + : "IN_PROGRESS", estimatedCsvSize: 502 + a.pages.length * 318, statementIsPublished }; diff --git a/confiture-web-app/src/components/account/dashboard/AuditRow.vue b/confiture-web-app/src/components/account/dashboard/AuditRow.vue index 3c31b7fc..029b2c12 100644 --- a/confiture-web-app/src/components/account/dashboard/AuditRow.vue +++ b/confiture-web-app/src/components/account/dashboard/AuditRow.vue @@ -25,6 +25,10 @@ const props = defineProps<{ const notify = useNotifications(); const auditStore = useAuditStore(); +const isNotStarted = computed( + () => props.audit.status === AuditStatus.NOT_STARTED +); + const isInProgress = computed( () => props.audit.status === AuditStatus.IN_PROGRESS ); @@ -166,11 +170,11 @@ function copyStatementLink(uniqueId: string) {

Statut - {{ isInProgress ? "En cours" : "Terminé" }} + {{ isInProgress || isNotStarted ? "En cours" : "Terminé" }}

@@ -193,7 +197,7 @@ function copyStatementLink(uniqueId: string) {

Taux de conformité - {{ isInProgress ? "Audit en cours" : `${audit.complianceLevel}%` }} + {{ + isInProgress || isNotStarted + ? "Audit en cours" + : `${audit.complianceLevel}%` + }}

-

+

{{ audit.complianceLevel === 100 ? "Totalement conforme" @@ -252,7 +263,13 @@ function copyStatementLink(uniqueId: string) { " :target="isInProgress ? null : '_blank'" > - {{ isInProgress ? "Continuer l’audit" : "Voir le rapport" }} + {{ + isNotStarted + ? "Commencer l’audit" + : isInProgress + ? "Continuer l’audit" + : "Voir le rapport" + }} {{ audit.procedureName }} diff --git a/confiture-web-app/src/pages/account/AccountDashboardPage.vue b/confiture-web-app/src/pages/account/AccountDashboardPage.vue index b1e25267..e33537af 100644 --- a/confiture-web-app/src/pages/account/AccountDashboardPage.vue +++ b/confiture-web-app/src/pages/account/AccountDashboardPage.vue @@ -37,7 +37,9 @@ async function hideAuditsAlert() { // TODO: filter audits const inProgressAudits = computed(() => { return auditStore.listing?.filter( - (a) => a.status === AuditStatus.IN_PROGRESS + (a) => + a.status === AuditStatus.IN_PROGRESS || + a.status === AuditStatus.NOT_STARTED ); }); diff --git a/confiture-web-app/src/types/account.ts b/confiture-web-app/src/types/account.ts index 0c088b1b..c4b95c62 100644 --- a/confiture-web-app/src/types/account.ts +++ b/confiture-web-app/src/types/account.ts @@ -20,7 +20,10 @@ export interface AccountDeletionResponse { export interface AccountAudit { procedureName: string; - status: AuditStatus.IN_PROGRESS | AuditStatus.COMPLETED; + status: + | AuditStatus.NOT_STARTED + | AuditStatus.IN_PROGRESS + | AuditStatus.COMPLETED; creationDate: string; auditType: AuditType; complianceLevel: number; diff --git a/confiture-web-app/src/types/types.ts b/confiture-web-app/src/types/types.ts index fc48a08d..fe73fb97 100644 --- a/confiture-web-app/src/types/types.ts +++ b/confiture-web-app/src/types/types.ts @@ -26,6 +26,7 @@ export enum AuditType { } export enum AuditStatus { + NOT_STARTED = "NOT_STARTED", IN_PROGRESS = "IN_PROGRESS", COMPLETED = "COMPLETED", PUBLISHABLE = "PUBLISHABLE"