fix: 1101 correctifs etape 3 (formattage adresse)#1284
fix: 1101 correctifs etape 3 (formattage adresse)#1284olivier-rabot wants to merge 4 commits intomainfrom
Conversation
revu-bot
left a comment
There was a problem hiding this comment.
PR Review: fix/1101 — Address formatting & step 3 corrections
This PR extracts a normalizeAdresse utility into shared-bridge, fixes a bug where allResults was populated even on failed validations, and adds TypeScript types to several Vue components. The overall direction is good, but there are a few issues worth addressing.
| File | Lines | Severity | Issue |
|---|---|---|---|
shared-bridge/src/utils/normalizeAdresse.ts |
3 | CRITICAL | Null-input type mismatch — function signature says AdresseDto but passes null/undefined through |
shared-bridge/src/utils/normalizeAdresse.ts |
13–17 | IMPORTANT | Redundant null-checks inside already-guarded branch |
frontend-usagers/…/listeSejours.vue |
175–180 | IMPORTANT | values cast to Record<string, any> defeats the purpose of the typed useForm<SejourFormValues> |
frontend-usagers/…/typeDeficiences.vue |
51–64 | IMPORTANT | validationObligatoire prop declared but never used — dead code |
frontend-usagers/…/tranchesAge.vue |
49–62 | IMPORTANT | Same requiredUnlessBrouillon wrapper is kept for non-BROUILLON statuses, making the BROUILLON branch redundant with the existing helper |
|
|
🎉 Deployment for commit 1c47fe8 : Ingresses
Docker images
|
l-scherer
left a comment
There was a problem hiding this comment.
RAS globalement
Par contre il te faut ajouter des tests sur normalizeAdresse.ts
Créer au moins un normalizeAdresse.spec.ts au même niveau
| codeInsee: adresse.codeInsee, | ||
| codePostal: adresse.codePostal, | ||
| coordinates: coords ?? null, | ||
| departement: adresse.departement, |
There was a problem hiding this comment.
adresse.codeInsee,
adresse.codePostal,
adresse.departement,
sont redondants par rapport à ...adresse,
Tu peux te contenter de retourner ça non ?
return {
...adresse,
coordinates: coords ?? null,
lat,
long,
};


Ticket(s) lié(s)
https://jira-mcas.atlassian.net/jira/software/c/projects/VAO/boards/336?selectedIssue=VAO-1194
Description
Correction du problème lié à l'ajout d'un séjour sur l'etape 3. Ajout d'une fonction de formattage de l'adresse.
Activation conditionnelle de certains champs (type deficiences, periode) > non required quand l'agrement est en statut brouillon
Screenshot / liens loom
Check-list
console.log<script lang="ts">Testing instructions