Skip to content

Commit

Permalink
Merge master into dev (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitguigal authored Nov 20, 2024
2 parents dd5bc77 + 2ce3329 commit e5752aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions front/src/form/bsdd/StepList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ export default function StepsList(props: Props) {
}

async function onSubmit(values: FormFormikValues) {
const initialForm = formQuery?.data?.form;

// Hotfix Zammad #43735
// COMPAT suite à TRA-14522 https://github.com/MTES-MCT/trackdechets/pull/3717
// La valeur de `isSubjectToADR` sur les bordereaux historiques est `null`.
// Or dans ce cas, le switch "Le déchet est soumis à l'ADR" est initialisé
// à `false`. Lors d'une modififcation d'un BSDD, `false` était envoyé
// et une erreur de verrouillage de champ était levée.
if (
!!initialForm?.emittedAt &&
values.wasteDetails?.isSubjectToADR === false &&
initialForm?.wasteDetails?.isSubjectToADR === null
) {
values.wasteDetails.isSubjectToADR = null;
}

const {
temporaryStorageDetail,
ecoOrganisme,
Expand Down
1 change: 1 addition & 0 deletions front/src/form/bsdd/WasteInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export default connect<{ disabled }, Values>(function WasteInfo({
inputTitle={"Test"}
label="Le déchet est soumis à l'ADR"
checked={values.wasteDetails.isSubjectToADR ?? false}
disabled={disabled}
/>

{values.wasteDetails.isSubjectToADR && (
Expand Down

0 comments on commit e5752aa

Please sign in to comment.