Skip to content

Commit

Permalink
Merge pull request #1062 from MTES-MCT/issue/2275
Browse files Browse the repository at this point in the history
#minor (2275) Permettre de téléverser la décision du tribunal
  • Loading branch information
superfeedboy authored Dec 19, 2024
2 parents 23151f4 + f03cb7b commit eff74f5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/api/server/services/attachment/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default async (entityType: AttachmentEntityType, entityId: number, create
}
}
}

const previews: Buffer[] = await Promise.all(
files.map((f) => {
if (!f.mimetype.startsWith('image/')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default {
justice_rendered: "Décision de justice rendue",
justice_rendered_at: "Date de la décision",
justice_rendered_by: "Origine de la décision",
justice_rendered_upload: "Téléverser la décision de justice",
justice_rendered_decrees: "Décision de justice",
justice_challenged: "Y a-t-il un appel en cours ?",
police_status: "Statut du concours de la force publique",
police_requested_at: "Date de la demande du CFP",
Expand All @@ -51,7 +53,7 @@ export default {
administrative_order_decision_at: "Date de l'arrêté",
administrative_order_decision_rendered_by: "Qui a pris l'arrêté ?",
administrative_order_evacuation_at: "Date de l'évacuation",
evacuation_upload: "Télécharger l'arrêté d'évacuation",
evacuation_upload: "Téléverser l'arrêté d'évacuation",
evacuation_decrees: "Arrêté d'évacuation",
// Arrêté d'insalubrité
insalubrity_order:
Expand All @@ -63,7 +65,7 @@ export default {
insalubrity_order_at: "Date de l'arrêté",
insalubrity_parcels:
"Parcelles concernées par l'arrêté (numéros de parcelles)",
insalubrity_upload: "Télécharger l'arrêté d'insalubrité",
insalubrity_upload: "Téléverser l'arrêté d'insalubrité",
insalubrity_decrees: "Arrêté d'insalubrité",
living_conditions_version:
"Souhaitez-vous remplir le nouveau formulaire des conditions de vie ?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
>
{{ procedure.value }}
</FicheSiteProceduresLigne>
<FicheSiteProceduresLigne
v-if="filteredDecreesAttachments('justice_rendered').length > 0"
icon="paperclip"
:label="labels.justice_rendered_decrees"
>
<FilePreviewGrid
class="mb-3"
:files="filteredDecreesAttachments('justice_rendered')"
/>
</FicheSiteProceduresLigne>
</FicheSiteProceduresRubrique>

<FicheSiteProceduresRubrique>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,22 +318,20 @@ function formatValuesForApi(v) {
];
const completeAttachments = [];
if (v.insalubrity_attachments && v.insalubrity_attachments.length > 0) {
completeAttachments.push(
...formatAttachments(
Array.from(v.insalubrity_attachments),
"insalubrity"
)
);
}
if (v.evacuation_attachments && v.evacuation_attachments.length > 0) {
completeAttachments.push(
...formatAttachments(
Array.from(v.evacuation_attachments),
"evacuation"
)
);
}
const attachmentTypes = [
{ key: "justice_rendered_attachments", type: "justice_rendered" },
{ key: "insalubrity_attachments", type: "insalubrity" },
{ key: "evacuation_attachments", type: "evacuation" },
];
attachmentTypes.forEach(({ key, type }) => {
if (v[key] && v[key].length > 0) {
completeAttachments.push(
...formatAttachments(Array.from(v[key]), type)
);
}
});
return {
...Object.keys(validationSchema.value.fields).reduce((acc, key) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:multiple="true"
ref="input"
@change="updateAttachments"
class="!mb-2"
/>
<FilePreviewGrid
class="mb-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
v-model="values.justice_rendered_at"
/>
<InputJusticeRenderedBy v-if="values.justice_rendered === 1" />
<UploadArrete
type="justice_rendered"
v-if="values.justice_rendered === 1"
v-model="values"
:townId="townId"
@update:attachments="updateAttachments"
@delete:OriginalAttachment="deleteOriginalAttachment"
class="mb-4"
/>
<InputJusticeChallenged v-if="values.justice_rendered === 1" />
</Fieldset>

Expand Down

0 comments on commit eff74f5

Please sign in to comment.