Skip to content

Commit

Permalink
Renomme le CTA principal sur la liste des audits pour les audits non …
Browse files Browse the repository at this point in the history
…démarrés (#843)

* rename audit list cta for not started audits

* fix merge forget

* update changelog
  • Loading branch information
bellangerq authored Nov 22, 2024
1 parent f7f5609 commit a9d2364
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 6 additions & 1 deletion confiture-rest-api/src/audits/audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
29 changes: 23 additions & 6 deletions confiture-web-app/src/components/account/dashboard/AuditRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -166,11 +170,11 @@ function copyStatementLink(uniqueId: string) {
<p
class="fr-badge fr-badge--sm audit-status"
:class="{
'fr-badge--purple-glycine': isInProgress
'fr-badge--purple-glycine': isInProgress || isNotStarted
}"
>
<span class="fr-sr-only">Statut </span>
{{ isInProgress ? "En cours" : "Terminé" }}
{{ isInProgress || isNotStarted ? "En cours" : "Terminé" }}
</p>

<!-- Creation date -->
Expand All @@ -193,7 +197,7 @@ function copyStatementLink(uniqueId: string) {
<p
class="fr-badge fr-badge--sm fr-badge--no-icon fr-mb-0"
:class="
isInProgress
isInProgress || isNotStarted
? null
: {
'fr-badge--green-emeraude': audit.complianceLevel === 100,
Expand All @@ -205,9 +209,16 @@ function copyStatementLink(uniqueId: string) {
<span v-if="!isInProgress" class="fr-sr-only"
>Taux de conformité
</span>
{{ isInProgress ? "Audit en cours" : `${audit.complianceLevel}%` }}
{{
isInProgress || isNotStarted
? "Audit en cours"
: `${audit.complianceLevel}%`
}}
</p>
<p v-if="!isInProgress" class="fr-text--xs fr-mb-0 fr-mt-1v">
<p
v-if="!isInProgress && !isNotStarted"
class="fr-text--xs fr-mb-0 fr-mt-1v"
>
{{
audit.complianceLevel === 100
? "Totalement conforme"
Expand Down Expand Up @@ -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"
}}
<span v-if="isInProgress" class="fr-sr-only">
{{ audit.procedureName }}</span
>
Expand Down
4 changes: 3 additions & 1 deletion confiture-web-app/src/pages/account/AccountDashboardPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
});
Expand Down
5 changes: 4 additions & 1 deletion confiture-web-app/src/types/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions confiture-web-app/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum AuditType {
}

export enum AuditStatus {
NOT_STARTED = "NOT_STARTED",
IN_PROGRESS = "IN_PROGRESS",
COMPLETED = "COMPLETED",
PUBLISHABLE = "PUBLISHABLE"
Expand Down

0 comments on commit a9d2364

Please sign in to comment.