Skip to content

Commit 5ad8a17

Browse files
Fix/1086 correctifs etape quatre renouvellement (#1265)
## Ticket(s) lié(s) https://jira-mcas.atlassian.net/jira/software/c/projects/VAO/boards/336?selectedIssue=VAO-1194 <!-- If you have a Jira Ticket / Sentry Ticket / GitHub Issue --> ## Description Correctifs etape 4 <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? screenshot? --> ## Screenshot / liens loom ## Check-list - [x] Ma branche est rebase sur main - [ ] Des tests ont été écrits pour tous les endpoints créés ou modifiés - [ ] Refacto "à la volée" des parties sur lesquelles j'ai codée - [x] Plus de `console.log` - [ ] J'ai ajouté une validation de schéma sur la route que j'ai ajouté ou modifié - [ ] J'ai converti les fichiers vue en `<script lang="ts">` - [ ] Mon code est en Typescript (autant que possible) **Testing instructions** <!-- Explain how another dev can test this PR. Create a workflow using checkboxes to explain how to run your code and the expected outputs: ${{ Test the following }} - [x] ${{ QA Scenario 1 }} - [x] ${{ QA Scenario 2 }} - [x] ${{ QA Scenario 3 }} -->
2 parents f5d349b + daf08c3 commit 5ad8a17

12 files changed

Lines changed: 144 additions & 46 deletions

File tree

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ fileignoreconfig:
334334
- filename: packages/migrations/src/scripts/reset-s3.js
335335
checksum: 7b52636c4c49bf85a592f649f8fbf653e0203b390f4f9d220fe3ae4da06422a7
336336
- filename: packages/shared-bridge/src/constantes/file.ts
337-
checksum: 90e946e20101879e9860b96c6727e9eb83adfd59f9137f3b43ffb520c00a511d
337+
checksum: 98506edb29a6a5c32f64abdcec9b0d7aba98f8cf677511c834b2d97fab6336b3
338338
- filename: packages/shared-bridge/src/dto/userDto.ts
339339
checksum: 1d22cd52289c17a26f78bdb035db9d7f65d60c4d2aa924ef9af8d9a507b57978
340340
- filename: packages/shared-bridge/src/utils/file.ts

packages/backend/src/usagers/agrements/agrements.route.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ router.get(
1616
AgrementController.getList,
1717
);
1818

19+
router.get(
20+
"/activites",
21+
checkJWT,
22+
requestValidatorMiddleware(AgrementUsagersRoutesSchema["GetAllActivites"]),
23+
AgrementController.getAllActivites,
24+
);
25+
1926
router.get(
2027
"/:agrementId",
2128
checkJWT,
@@ -31,9 +38,6 @@ router.post(
3138
AgrementController.post,
3239
);
3340

34-
// TODO: Ajouter requestValidatorMiddleware(AgrementUsagersRoutesSchema["GetAllActivites"]) pour valider la route des activités
35-
router.get("/activites", checkJWT, AgrementController.getAllActivites);
36-
3741
router.get(
3842
"/:agrementId/history",
3943
checkJWT,

packages/frontend-usagers/src/components/agrement/bilan/bilanFinancier.vue

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,24 @@ const validationSchema = yup.object({
160160
bilanFinancierComptabilite: requiredUnlessBrouillon(
161161
yup.string().min(20, "Merci de décrire au moins 20 caractères."),
162162
),
163-
bilanFinancierComparatif: requiredUnlessBrouillon(
164-
yup.string().min(20, "Merci de décrire au moins 20 caractères."),
165-
),
166-
bilanFinancierRessourcesHumaines: requiredUnlessBrouillon(
167-
yup.string().min(20, "Merci de décrire au moins 20 caractères."),
168-
),
163+
bilanFinancierComparatif: yup
164+
.string()
165+
.nullable()
166+
.when([], {
167+
is: (val: string | null) => val && val.length > 0,
168+
then: (schema) =>
169+
schema.min(20, "Merci de décrire au moins 20 caractères."),
170+
otherwise: (schema) => schema,
171+
}),
172+
bilanFinancierRessourcesHumaines: yup
173+
.string()
174+
.nullable()
175+
.when([], {
176+
is: (val: string | null) => val && val.length > 0,
177+
then: (schema) =>
178+
schema.min(20, "Merci de décrire au moins 20 caractères."),
179+
otherwise: (schema) => schema,
180+
}),
169181
bilanFinancierCommentaire: yup
170182
.string()
171183
.nullable()

packages/frontend-usagers/src/components/agrement/bilan/sejourDetails.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
/>
6363
<UtilsDisplayInput
6464
v-else
65-
:value="nbHommes"
66-
:input="displayInput.AgrementBilanAnnuelInput['nbFemmes']"
65+
:value="nbFemmes"
66+
:input="displayInput.IAgrementBilanAnnuel['nbFemmes']"
6767
:is-valid="nbFemmesMeta.valid"
6868
:error-message="nbFemmesErrorMessage"
6969
/>

packages/frontend-usagers/src/components/agrement/projets/accompagnantsResponsables.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@
109109
/>
110110
</div>
111111
</div>
112-
<div class="fr-fieldset__element fr-mt-6v">
112+
<!-- <div class="fr-fieldset__element fr-mt-6v">
113113
<UtilsMultiFilesUpload
114114
v-model="filesProjetsSejoursComplementaires"
115115
:modifiable="props.modifiable"
116116
label="Ajouter des fichiers complémentaires (optionnel)"
117117
/>
118-
</div>
118+
</div> -->
119119
</template>
120120

121121
<script setup lang="ts">

packages/frontend-usagers/src/components/agrement/projets/index.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
:modifiable="props.modifiable"
2121
/>
2222
<hr class="fr-mt-8v" />
23-
<!-- <AgrementProjetsCasierJudiciaire
23+
<AgrementProjetsCasierJudiciaire
2424
ref="casierJudiciaireRef"
2525
:cdn-url="props.cdnUrl"
2626
:init-agrement="props.initAgrement"
2727
:modifiable="props.modifiable"
28-
/> -->
28+
/>
2929
<hr class="fr-mt-8v" />
3030
<AgrementProjetsOrganisationTransports
3131
ref="organisationTransportsRef"
@@ -93,7 +93,7 @@ const emit = defineEmits(["update:valid", "update", "previous", "next"]);
9393
const sejoursPrevusRef = ref(null);
9494
const animationsActivitesRef = ref(null);
9595
const accompagnantsResponsablesRef = ref(null);
96-
// const casierJudiciaireRef = ref(null);
96+
const casierJudiciaireRef = ref(null);
9797
const organisationTransportsRef = ref(null);
9898
const suiviMedicalRef = ref(null);
9999
const protocoleRef = ref(null);
@@ -157,11 +157,11 @@ const handleSuivant = async () => {
157157
nom: "Accompagnants et responsables",
158158
cle: "accompagnantsResponsables",
159159
},
160-
// {
161-
// ref: casierJudiciaireRef,
162-
// nom: "Casier judiciaire",
163-
// cle: "casierJudiciaire",
164-
// },
160+
{
161+
ref: casierJudiciaireRef,
162+
nom: "Casier judiciaire",
163+
cle: "casierJudiciaire",
164+
},
165165
{
166166
ref: organisationTransportsRef,
167167
nom: "Organisation des transports",

packages/frontend-usagers/src/components/agrement/projets/listeSejours.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<div class="headings">
3+
<div v-if="sejours.length > 0" class="headings">
44
<p class="fr-mb-0">Nom de l'hébergement</p>
55
<p class="fr-mb-0">Adresse de l'hébergement</p>
66
<p class="fr-mb-0">Période</p>
@@ -49,7 +49,10 @@
4949
</div>
5050
<div class="fr-mt-6v">
5151
<p class="fr-mb-0">Période</p>
52-
<AgrementBilanSelectMonths :modifiable="props.modifiable" @update:selected="handleMonths" />
52+
<AgrementBilanSelectMonths
53+
:modifiable="props.modifiable"
54+
@update:selected="handleMonths"
55+
/>
5356
<p v-if="moisMeta.touched && moisErrorMessage" class="fr-error-text">
5457
{{ moisErrorMessage }}
5558
</p>
@@ -86,7 +89,7 @@ import HebergementDetail from "@/components/agrement/bilan/hebergementDetail.vue
8689
const props = defineProps({
8790
agrementId: { type: String, required: true },
8891
initialSejours: { type: Array, required: false, default: () => [] },
89-
statut: { type: String, required: false,default: "BROUILLON" },
92+
statut: { type: String, required: false, default: "BROUILLON" },
9093
modifiable: { type: Boolean, default: false },
9194
});
9295

packages/frontend-usagers/src/utils/display-input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,12 @@ const AgrementBilanAnnuelInput = {
696696
},
697697
bilanFinancierComparatif: {
698698
inputType: InputTypes.TEXT,
699-
label: "Comparatif entre les périodes N et N-1",
699+
label: "Comparatif entre les périodes N et N-1 (optionnel)",
700700
},
701701
bilanFinancierRessourcesHumaines: {
702702
inputType: InputTypes.TEXT,
703703
label:
704-
"Ressources humaines mobilisées et montants financiers engagés pour l’action",
704+
"Ressources humaines mobilisées et montants financiers engagés pour l’action (optionnel)",
705705
},
706706
bilanFinancierCommentaire: {
707707
inputType: InputTypes.TEXT,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Migration pour augmenter la taille du champ category dans agrement_files
3+
* PostgreSQL + Knex.js
4+
*/
5+
6+
exports.up = async function (knex) {
7+
await knex.schema.alterTable("front.agrement_files", function (table) {
8+
table.string("category", 50).alter();
9+
});
10+
};
11+
12+
exports.down = async function (knex) {
13+
await knex.schema.alterTable("front.agrement_files", function (table) {
14+
table.string("category", 30).alter();
15+
});
16+
};

packages/shared-bridge/src/constantes/file.ts

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export type FileKey =
4545
| "filesAgrementSejour"
4646
| "filesAccompResp"
4747
| "filesSuiviMed"
48+
| "filesBudget"
4849
| "filesBilanQualitPerception"
4950
| "filesBilanQualitPerspectives"
5051
| "filesBilanQualitElementsMarquants"
@@ -114,8 +115,8 @@ export const FILE_CATEGORY_CONFIG = {
114115
multiple: true,
115116
},
116117
[FILE_CATEGORY.BUDGET]: {
117-
fileKey: "filesProjSejoursBudgetPersonnes",
118-
label: "Budget des personnes",
118+
fileKey: "filesBudget",
119+
label: "Budget",
119120
multiple: true,
120121
},
121122
[FILE_CATEGORY.CHANGEEVOL]: {
@@ -133,6 +134,77 @@ export const FILE_CATEGORY_CONFIG = {
133134
label: "Bilan financier 4 dernières années",
134135
multiple: true,
135136
},
137+
// ...existing code...
138+
[FILE_CATEGORY.BILANQUALITPERCEPTION]: {
139+
fileKey: "filesBilanQualitPerception",
140+
label: "Bilan qualitatif - Perception et ressenti",
141+
multiple: true,
142+
},
143+
[FILE_CATEGORY.BILANQUALITPERSPECTIVE]: {
144+
fileKey: "filesBilanQualitPerspectives",
145+
label: "Bilan qualitatif - Perspectives d'évolution",
146+
multiple: true,
147+
},
148+
[FILE_CATEGORY.BILANQUALITELEMARQ]: {
149+
fileKey: "filesBilanQualitElementsMarquants",
150+
label: "Bilan qualitatif - Éléments marquants",
151+
multiple: true,
152+
},
153+
[FILE_CATEGORY.BILANQUALITCOMPLEMENTAIRES]: {
154+
fileKey: "filesBilanQualitComplementaires",
155+
label: "Bilan qualitatif - Fichiers complémentaires",
156+
multiple: true,
157+
},
158+
[FILE_CATEGORY.PROJETSSEJOURSCOMPETENCESEXPERIENCE]: {
159+
fileKey: "filesProjetsSejoursCompetencesExperience",
160+
label: "Compétences et expériences des accompagnants",
161+
multiple: true,
162+
},
163+
[FILE_CATEGORY.PROJETSSEJOURSMESURES]: {
164+
fileKey: "filesProjetsSejoursMesures",
165+
label: "Mesures en cas de recrutement d'urgence",
166+
multiple: true,
167+
},
168+
[FILE_CATEGORY.PROJETSSEJOURSCOMPLEMENTAIRES]: {
169+
fileKey: "filesProjetsSejoursComplementaires",
170+
label: "Fichiers complémentaires accompagnants",
171+
multiple: true,
172+
},
173+
[FILE_CATEGORY.PROJETSSEJOURSPREVUS]: {
174+
fileKey: "filesProjetsSejoursPrevus",
175+
label: "Séjours prévus",
176+
multiple: true,
177+
},
178+
[FILE_CATEGORY.PROJETSSEJOURSCASIER]: {
179+
fileKey: "fileProjetsSejoursCasier",
180+
label: "Casier judiciaire",
181+
multiple: false,
182+
},
183+
[FILE_CATEGORY.PROJETSSEJOURSORGATRANSPORT]: {
184+
fileKey: "filesProjetsSejoursOrgaTransports",
185+
label: "Organisation des transports prévus",
186+
multiple: true,
187+
},
188+
[FILE_CATEGORY.PROJETSSEJOURSSUIVIMED]: {
189+
fileKey: "filesProjetsSejoursSuiviMed",
190+
label: "Suivi médical prévu",
191+
multiple: true,
192+
},
193+
[FILE_CATEGORY.PROJSEJPROTCOREORIENT]: {
194+
fileKey: "filesProjetsSejoursProtocoleReorientation",
195+
label: "Protocole de réorientation/évacuation",
196+
multiple: true,
197+
},
198+
[FILE_CATEGORY.PROJSSEJOURSPROTCOLERAPATR]: {
199+
fileKey: "filesProjetsSejoursProtocoleRapatriement",
200+
label: "Protocole de rapatriement",
201+
multiple: true,
202+
},
203+
[FILE_CATEGORY.PROJSEJOURSBUDGETPERSONNES]: {
204+
fileKey: "filesProjSejoursBudgetPersonnes",
205+
label: "Budget des personnes prévu",
206+
multiple: true,
207+
},
136208
} as const;
137209

138210
export type FileCategoryConfig = typeof FILE_CATEGORY_CONFIG;

0 commit comments

Comments
 (0)