From 0833a8e753e2b565063f2ecd841ad46d369b2a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20D=C3=A9tr=C3=A9?= Date: Wed, 8 Jan 2025 15:05:33 +0100 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20accessibilit=C3=A9=20formulaire=20de?= =?UTF-8?q?mande/intention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.json | 12 ++- .../components/DefinitionTauxTransfoModal.tsx | 10 +- ui/app/(wrapped)/components/EnvBandeau.tsx | 6 +- ui/app/(wrapped)/components/Header.tsx | 3 +- .../components/InformationHeader.tsx | 6 +- .../saisie/components/CapaciteField.tsx | 3 + .../saisie/components/CfdAutocomplete.tsx | 3 + .../components/DisciplineAutoComplete.tsx | 3 + .../saisie/components/MenuFormulaire.tsx | 2 +- .../saisie/components/UaiAutocomplete.tsx | 3 + .../filesSection/UploadField.tsx | 4 +- .../precisionsSection/MotifField.tsx | 8 +- .../DisciplinesFormationRHField.tsx | 51 +++++----- .../DisciplinesProfesseurAssocieRHField.tsx | 51 +++++----- .../DisciplinesReconversionRHField.tsx | 51 +++++----- .../DisciplinesRecrutementRHField.tsx | 51 +++++----- .../RentreeScolaireField.tsx | 6 +- .../typeDemandeSection/TypeDemandeField.tsx | 10 +- .../typeDemandeSection/TypeDemandeSection.tsx | 6 +- .../CapaciteApprentissageActuelleField.tsx | 11 ++- ...aciteApprentissageColoreeActuelleField.tsx | 9 +- .../CapaciteApprentissageColoreeField.tsx | 11 ++- .../CapaciteApprentissageField.tsx | 4 +- .../CapaciteScolaireActuelleField.tsx | 4 +- .../CapaciteScolaireColoreeActuelleField.tsx | 11 ++- .../CapaciteScolaireColoreeField.tsx | 4 +- .../capaciteSection/CapaciteScolaireField.tsx | 38 ++++---- .../capaciteSection/CapaciteSection.tsx | 82 +++++++++++++--- .../capaciteSection/ColorationField.tsx | 1 + .../saisie/components/CapaciteField.tsx | 3 + .../saisie/components/CfdAutocomplete.tsx | 3 + .../components/DisciplineAutoComplete.tsx | 3 + .../saisie/components/UaiAutocomplete.tsx | 3 + .../intentionForm/cfdUaiSection/CfdBlock.tsx | 3 +- .../intentionForm/cfdUaiSection/UaiBlock.tsx | 3 +- .../precisionsSection/MotifField.tsx | 17 ++-- .../DisciplinesFormationRHField.tsx | 51 +++++----- .../DisciplinesProfesseurAssocieRHField.tsx | 50 +++++----- .../DisciplinesReconversionRHField.tsx | 51 +++++----- .../DisciplinesRecrutementRHField.tsx | 51 +++++----- .../RentreeScolaireField.tsx | 6 +- .../typeDemandeSection/TypeDemandeField.tsx | 10 +- .../typeDemandeSection/TypeDemandeSection.tsx | 6 +- .../CapaciteApprentissageActuelleField.tsx | 11 ++- ...aciteApprentissageColoreeActuelleField.tsx | 9 +- .../CapaciteApprentissageColoreeField.tsx | 11 ++- .../CapaciteApprentissageField.tsx | 4 +- .../CapaciteScolaireActuelleField.tsx | 4 +- .../CapaciteScolaireColoreeActuelleField.tsx | 11 ++- .../CapaciteScolaireColoreeField.tsx | 4 +- .../capaciteSection/CapaciteScolaireField.tsx | 37 +++---- .../capaciteSection/CapaciteSection.tsx | 97 ++++++++++++++++--- 52 files changed, 601 insertions(+), 311 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index ddf71124c..40e4c7ed2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,8 +14,16 @@ "project": ["tsconfig.json", "server/tsconfig.json", "shared/tsconfig.json", "ui/tsconfig.json"] }, "plugins": ["react", "@typescript-eslint", "simple-import-sort", "import", "@dword-design/import-alias"], - "rules": { - "max-len": ["warn", { "code": 120 }], + "rules": {"max-len": [ + "warn", + { + "code": 120, + "ignorePattern": "^import\\s.+\\sfrom\\s.+;$", + "ignoreComments": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true + } + ], "simple-import-sort/imports": "error", "no-extra-semi": "error", "semi": ["error", "always"], diff --git a/ui/app/(wrapped)/components/DefinitionTauxTransfoModal.tsx b/ui/app/(wrapped)/components/DefinitionTauxTransfoModal.tsx index 02904a6fc..f1bdbd33a 100644 --- a/ui/app/(wrapped)/components/DefinitionTauxTransfoModal.tsx +++ b/ui/app/(wrapped)/components/DefinitionTauxTransfoModal.tsx @@ -82,9 +82,9 @@ export const DefinitionTauxTransfoModal = ({ isOpen, onClose }: { isOpen: boolea - Le calcul tient compte des places transformées en voie scolaire et en apprentissage{" "} - (diplômes retenus : CAP, Bac Pro, CS, BTS, FCIL, BT, BP, DNMADE, BMA). Le dénominateur concerne les - effectifs en entrée. + Le calcul tient compte des places transformées en voie scolaire et en + apprentissage (diplômes retenus : CAP, Bac Pro, CS, BTS, FCIL, BT, BP, DNMADE, BMA). + Le dénominateur concerne les effectifs en entrée. @@ -103,8 +103,8 @@ export const DefinitionTauxTransfoModal = ({ isOpen, onClose }: { isOpen: boolea - On peut également suivre dans Orion le taux de transformation prévisionnel hors colorations{" "} - (à partir de la Rentrée Scolaire 2025). + On peut également suivre dans Orion le taux de transformation prévisionnel + hors colorations (à partir de la Rentrée Scolaire 2025). diff --git a/ui/app/(wrapped)/components/EnvBandeau.tsx b/ui/app/(wrapped)/components/EnvBandeau.tsx index 6b6f16624..89af19e95 100644 --- a/ui/app/(wrapped)/components/EnvBandeau.tsx +++ b/ui/app/(wrapped)/components/EnvBandeau.tsx @@ -1,6 +1,6 @@ "use client"; -import { Box, Button, chakra, Stack, Text } from "@chakra-ui/react"; +import { Box, Button, chakra, CloseButton, Stack, Text } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import { useState } from "react"; @@ -42,7 +42,7 @@ export const EnvBandeau = chakra(() => { > {publicConfig.env} - + ); diff --git a/ui/app/(wrapped)/components/Header.tsx b/ui/app/(wrapped)/components/Header.tsx index 8337db5ec..af3dc775d 100644 --- a/ui/app/(wrapped)/components/Header.tsx +++ b/ui/app/(wrapped)/components/Header.tsx @@ -94,7 +94,8 @@ export const Header = ({ isMaintenance }: { isMaintenance?: boolean }) => { - }> + + Se déconnecter diff --git a/ui/app/(wrapped)/components/InformationHeader.tsx b/ui/app/(wrapped)/components/InformationHeader.tsx index ef03fa997..7653f9310 100644 --- a/ui/app/(wrapped)/components/InformationHeader.tsx +++ b/ui/app/(wrapped)/components/InformationHeader.tsx @@ -1,4 +1,4 @@ -import { Box, Button, Link, Stack, Text, VStack } from "@chakra-ui/react"; +import { Box, Button, CloseButton, Link, Stack, Text, VStack } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import NextLink from "next/link"; import { useEffect, useState } from "react"; @@ -86,7 +86,7 @@ export const InformationHeader = () => { Voir les détails - + ))} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/components/CapaciteField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/components/CapaciteField.tsx index b3e6a9799..82134a905 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/components/CapaciteField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/components/CapaciteField.tsx @@ -10,10 +10,12 @@ import { Controller, useFormContext } from "react-hook-form"; import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/intentionForm/defaultFormValues"; export const CapaciteField = ({ + id, name, className, isReadOnly, }: { + id: string; name: | "capaciteScolaireActuelle" | "capaciteScolaire" @@ -53,6 +55,7 @@ export const CapaciteField = ({ onFocus={(e) => e.currentTarget.select()} > } + leftIcon={{""}/} > Travaux et équipements diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/components/UaiAutocomplete.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/components/UaiAutocomplete.tsx index 60621457e..75504a227 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/components/UaiAutocomplete.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/components/UaiAutocomplete.tsx @@ -7,12 +7,14 @@ import { client } from "@/api.client"; import { useAuth } from "@/utils/security/useAuth"; export const UaiAutocomplete = ({ + id = "uai-autocomplete", name, defaultValue, disabled, inError, onChange, }: { + id?: string; name: string; defaultValue?: { value: string; label?: string; commune?: string }; disabled?: boolean; @@ -30,6 +32,7 @@ export const UaiAutocomplete = ({ return ( Vous pouvez ajouter des fichiers pour étayer votre demande + Ajout d'un fichier fileInputRef.current?.click()} width={"auto"}> {coloration && !isTypeColoration(typeDemande) && !isTypeFermeture(typeDemande) && ( - Merci de préciser le(s) motif(s) de votre coloration + + + Merci de préciser le(s) motif(s) de votre coloration * + + {getMotifOptions("coloration")?.map(({ value, label }) => ( - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -61,8 +46,30 @@ export const DisciplinesFormationRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx index ad1d3c08d..7db58c519 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx @@ -26,34 +26,19 @@ export const DisciplinesProfesseurAssocieRHField = chakra( className={className} isInvalid={!!errors.discipline1ProfesseurAssocieRH || !!errors.discipline2ProfesseurAssocieRH} > - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -61,8 +46,30 @@ export const DisciplinesProfesseurAssocieRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx index ac158425e..ff4b2070f 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx @@ -26,34 +26,19 @@ export const DisciplinesReconversionRHField = chakra( className={className} isInvalid={!!errors.discipline1ReconversionRH || !!errors.discipline2ReconversionRH} > - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -61,8 +46,30 @@ export const DisciplinesReconversionRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx index d85736a20..7155177be 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx @@ -26,34 +26,19 @@ export const DisciplinesRecrutementRHField = chakra( className={className} isInvalid={!!errors.discipline1RecrutementRH || !!errors.discipline2RecrutementRH} > - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -61,8 +46,30 @@ export const DisciplinesRecrutementRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx index 3d6d05a18..df16a7311 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx @@ -33,10 +33,11 @@ export const RentreeScolaireField = ({ setValue, watch, } = useFormContext(); - const rentreeScolaire = watch("rentreeScolaire"); + const rentreeScolaireOptions = [0, 1, 2, 3, 4, 5].map( (offsetRentree: number) => parseInt(campagne?.annee ?? CURRENT_ANNEE_CAMPAGNE) + offsetRentree ); + const rentreeScolaire = watch("rentreeScolaire") ?? rentreeScolaireOptions[1]; useEffect( () => @@ -54,9 +55,10 @@ export const RentreeScolaireField = ({ return ( - Rentrée scolaire + Rentrée scolaire } diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx index 7527c9780..64767fb69 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx @@ -53,7 +53,6 @@ function RadioCard({ - + {`Icône {title} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx index 2e47d8004..c793697f0 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx @@ -1,4 +1,4 @@ -import { Box, Button, chakra, Divider, Flex, Heading, Highlight, Stack, Text, Tooltip } from "@chakra-ui/react"; +import { Box, Button, chakra, CloseButton, Divider, Flex, Heading, Highlight, Stack, Text, Tooltip } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import type { RefObject } from "react"; import { useState } from "react"; @@ -53,7 +53,7 @@ const InfoAjustementSection = chakra(({ anneeCampagne }: { anneeCampagne: string {`Pour apporter un ajustement à la rentrée scolaire ${anneeCampagne}, sélectionner ${anneeCampagne} dans le champ ci-dessus`} - + ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx index 0cf7671cd..94957a56d 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -22,6 +22,13 @@ export const CapaciteApprentissageActuelleField = chakra( const ouverture = isTypeOuverture(typeDemande); const isReadOnly = disabled || ouverture; - return ; + return ( + + ); } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx index 711472027..b6a918dca 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeColoration, isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageColoreeActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -25,7 +25,12 @@ export const CapaciteApprentissageColoreeActuelleField = chakra( if (!coloration) return <>; return ( - + ); } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx index 327208dc5..0554a7040 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx @@ -8,7 +8,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeColoration } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageColoreeField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -26,6 +26,13 @@ export const CapaciteApprentissageColoreeField = chakra( if (!coloration) return <>; if (fermeture) return <>; - return ; + return ( + + ); } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx index 9bd3e1f1a..f1457e9d8 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeColoration, isTypeFermeture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -27,6 +27,6 @@ export const CapaciteApprentissageField = chakra( const isReadOnly = disabled || fermeture || coloration; - return ; + return ; } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx index ec67d3fdd..c49bcee1f 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteScolaireActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -22,6 +22,6 @@ export const CapaciteScolaireActuelleField = chakra( const ouverture = isTypeOuverture(typeDemande); const isReadOnly = disabled || ouverture; - return ; + return ; } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx index dc2ce0be2..4debc3675 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeColoration, isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteScolaireColoreeActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -24,6 +24,13 @@ export const CapaciteScolaireColoreeActuelleField = chakra( const isReadOnly = disabled || ouverture || !coloration; if (!coloration) return <>; - return ; + return ( + + ); } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx index e8d216b7f..6f3f457e1 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx @@ -8,7 +8,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/in import { isTypeColoration } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteScolaireColoreeField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -26,6 +26,6 @@ export const CapaciteScolaireColoreeField = chakra( if (!coloration) return <>; if (fermeture) return <>; - return ; + return ; } ); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx index 5766c9cb3..b85292c21 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx @@ -6,24 +6,26 @@ import { CapaciteField } from "@/app/(wrapped)/intentions/perdir/saisie/componen import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/intentionForm/defaultFormValues"; import { isTypeColoration, isTypeFermeture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; -export const CapaciteScolaireField = chakra(({ disabled, className }: { disabled?: boolean; className?: string }) => { - const { watch, setValue } = useFormContext(); +export const CapaciteScolaireField = chakra( + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { + const { watch, setValue } = useFormContext(); - useEffect( - () => - watch(({ capaciteScolaireActuelle, typeDemande }, { name }) => { - if (name === "typeDemande") { - setValue("capaciteScolaire", 0); - } else if (name === "capaciteScolaireActuelle" && typeDemande === "coloration") { - setValue("capaciteScolaire", capaciteScolaireActuelle); - } - }).unsubscribe - ); + useEffect( + () => + watch(({ capaciteScolaireActuelle, typeDemande }, { name }) => { + if (name === "typeDemande") { + setValue("capaciteScolaire", 0); + } else if (name === "capaciteScolaireActuelle" && typeDemande === "coloration") { + setValue("capaciteScolaire", capaciteScolaireActuelle); + } + }).unsubscribe, + ); - const typeDemande = watch("typeDemande"); - const fermeture = isTypeFermeture(typeDemande); - const coloration = isTypeColoration(typeDemande); - const isReadOnly = disabled || fermeture || coloration; + const typeDemande = watch("typeDemande"); + const fermeture = isTypeFermeture(typeDemande); + const coloration = isTypeColoration(typeDemande); + const isReadOnly = disabled || fermeture || coloration; - return ; -}); + return ; + }, +); diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx index 289b5a746..dcdcb6109 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx @@ -1,8 +1,7 @@ -import { Box, Flex, FormErrorMessage, Input, Table, Tbody, Td, Th, Thead, Tr } from "@chakra-ui/react"; +import { Box, Flex, FormErrorMessage, Input, Table, Tbody, Td, Th, Thead, Tr, VisuallyHidden } from "@chakra-ui/react"; import { useFormContext } from "react-hook-form"; import type { IntentionForms } from "@/app/(wrapped)/intentions/perdir/saisie/intentionForm/defaultFormValues"; -import { CapaciteScolaireColoreeActuelleField } from "@/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField"; import { isTypeColoration } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; import { CapaciteApprentissageActuelleField } from "./CapaciteApprentissageActuelleField"; @@ -10,13 +9,15 @@ import { CapaciteApprentissageColoreeActuelleField } from "./CapaciteApprentissa import { CapaciteApprentissageColoreeField } from "./CapaciteApprentissageColoreeField"; import { CapaciteApprentissageField } from "./CapaciteApprentissageField"; import { CapaciteScolaireActuelleField } from "./CapaciteScolaireActuelleField"; +import { CapaciteScolaireColoreeActuelleField } from "./CapaciteScolaireColoreeActuelleField"; import { CapaciteScolaireColoreeField } from "./CapaciteScolaireColoreeField"; import { CapaciteScolaireField } from "./CapaciteScolaireField"; import { ColorationField } from "./ColorationField"; import { LibelleColorationField } from "./LibelleColorationField"; -const ConstanteField = ({ value }: { value: string | number | undefined }) => ( +const ConstanteField = ({ id, value }: { id: string; value: string | number | undefined }) => ( { - + @@ -96,23 +97,48 @@ export const CapaciteSection = ({ disabled }: { disabled: boolean }) => { Capacité en voie scolaire {coloration && ( <> )} @@ -120,23 +146,51 @@ export const CapaciteSection = ({ disabled }: { disabled: boolean }) => { Capacité en apprentissage {coloration && ( <> )} diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/ColorationField.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/ColorationField.tsx index 5467c8d95..b8c4daeba 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/ColorationField.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/ColorationField.tsx @@ -37,6 +37,7 @@ export const ColorationField = chakra(({ disabled, className }: { disabled?: boo useEffect(() => { if (getValues("libelleFCIL")) setValue("coloration", false); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const libelleFCIL = watch("libelleFCIL"); diff --git a/ui/app/(wrapped)/intentions/saisie/components/CapaciteField.tsx b/ui/app/(wrapped)/intentions/saisie/components/CapaciteField.tsx index 999525315..cd2ee8986 100644 --- a/ui/app/(wrapped)/intentions/saisie/components/CapaciteField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/components/CapaciteField.tsx @@ -10,10 +10,12 @@ import { Controller, useFormContext } from "react-hook-form"; import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intentionForm/defaultFormValues"; export const CapaciteField = ({ + id, name, className, isReadOnly, }: { + id: string; name: | "capaciteScolaireActuelle" | "capaciteScolaire" @@ -53,6 +55,7 @@ export const CapaciteField = ({ onFocus={(e) => e.currentTarget.select()} > - Recherche d'un diplôme + Recherche d'un diplôme ( - Recherche d'un établissement + Recherche d'un établissement ( {coloration && !isTypeColoration(typeDemande) && !isTypeFermeture(typeDemande) && ( - Merci de préciser le(s) motif(s) de votre coloration + + + Merci de préciser le(s) motif(s) de votre coloration * + + {getMotifOptions("coloration", campagne?.annee)?.map(({ value, label }) => ( - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -62,8 +46,31 @@ export const DisciplinesFormationRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx index aac351854..993450429 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/professeurAssocieRHSection/DisciplinesProfesseurAssocieRHField.tsx @@ -27,35 +27,19 @@ export const DisciplinesProfesseurAssocieRHField = chakra( className={className} isInvalid={!!errors.discipline1ProfesseurAssocieRH || !!errors.discipline2ProfesseurAssocieRH} > - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -63,8 +47,30 @@ export const DisciplinesProfesseurAssocieRHField = chakra( /> )} /> + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx index 6d9cc9af0..2b5beecc9 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/reconversionRHSection/DisciplinesReconversionRHField.tsx @@ -26,35 +26,19 @@ export const DisciplinesReconversionRHField = chakra( className={className} isInvalid={!!errors.discipline1ReconversionRH || !!errors.discipline2ReconversionRH} > - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -62,8 +46,31 @@ export const DisciplinesReconversionRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx index ccbc25814..85603f496 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/rhSection/recrutementRHSection/DisciplinesRecrutementRHField.tsx @@ -27,35 +27,19 @@ export const DisciplinesRecrutementRHField = chakra( className={className} isInvalid={!!errors.discipline1RecrutementRH || !!errors.discipline2RecrutementRH} > - Dans quelle(s) discipline(s) ? - ( - { - onChange(v?.value); - }} - /> - )} - /> - - {hasDoubleDiscipline ? ( + + Dans quelle(s) discipline(s) ? ( { onChange(v?.value); @@ -63,8 +47,31 @@ export const DisciplinesRecrutementRHField = chakra( /> )} /> + + + {hasDoubleDiscipline ? ( + + Discipline 2 + ( + { + onChange(v?.value); + }} + /> + )} + /> + ) : ( - )} diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx index 29f9f9036..c5bfee237 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/RentreeScolaireField.tsx @@ -14,6 +14,7 @@ import { } from "@chakra-ui/react"; import { useEffect } from "react"; import { useFormContext } from "react-hook-form"; +import { CURRENT_RENTREE } from "shared"; import { CURRENT_ANNEE_CAMPAGNE } from "shared/time/CURRENT_ANNEE_CAMPAGNE"; import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intentionForm/defaultFormValues"; @@ -38,7 +39,7 @@ export const RentreeScolaireField = ({ (offsetRentree: number) => parseInt(campagne?.annee ?? CURRENT_ANNEE_CAMPAGNE) + offsetRentree ); - const rentreeScolaire = watch("rentreeScolaire"); + const rentreeScolaire = watch("rentreeScolaire") ?? rentreeScolaireOptions[1]; useEffect( () => @@ -55,9 +56,10 @@ export const RentreeScolaireField = ({ return ( - Rentrée scolaire + Rentrée scolaire } diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx index 7819ca9ee..0e024870b 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeField.tsx @@ -52,7 +52,6 @@ function RadioCard({ - + {`Icône {title} diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx index 49074cef7..48cf0c01b 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx @@ -1,4 +1,4 @@ -import { Box, Button, chakra, Divider, Flex, Heading, Highlight, Stack, Text, Tooltip } from "@chakra-ui/react"; +import { Box, Button, chakra, CloseButton, Divider, Flex, Heading, Highlight, Stack, Text, Tooltip } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import { useRouter, useSearchParams } from "next/navigation"; import type { RefObject } from "react"; @@ -58,7 +58,7 @@ const InfoAjustementSection = chakra(({ anneeCampagne }: { anneeCampagne: string {`Pour apporter un ajustement à la rentrée scolaire ${anneeCampagne}, sélectionner ${anneeCampagne} dans le champ ci-dessus`} - + ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx index 7345fc109..b4c8ae734 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -22,6 +22,13 @@ export const CapaciteApprentissageActuelleField = chakra( const ouverture = isTypeOuverture(typeDemande); const isReadOnly = disabled || ouverture; - return ; + return ( + + ); } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx index 6393b82dc..49d3cb049 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeColoration, isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageColoreeActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -25,7 +25,12 @@ export const CapaciteApprentissageColoreeActuelleField = chakra( if (!coloration) return <>; return ( - + ); } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx index 80b6d0ec5..4bbc0697b 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageColoreeField.tsx @@ -8,7 +8,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeColoration } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageColoreeField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -25,6 +25,13 @@ export const CapaciteApprentissageColoreeField = chakra( const isReadOnly = disabled || fermeture || !coloration; if (!coloration) return <>; - return ; + return ( + + ); } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx index 91293d0e0..e7c46b51e 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteApprentissageField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeColoration, isTypeFermeture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteApprentissageField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -27,6 +27,6 @@ export const CapaciteApprentissageField = chakra( const isReadOnly = disabled || fermeture || coloration; - return ; + return ; } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx index 129783e67..89f2aac60 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteScolaireActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -22,6 +22,6 @@ export const CapaciteScolaireActuelleField = chakra( const ouverture = isTypeOuverture(typeDemande); const isReadOnly = disabled || ouverture; - return ; + return ; } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx index c57e68113..de43f2da4 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeActuelleField.tsx @@ -7,7 +7,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeColoration, isTypeOuverture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteScolaireColoreeActuelleField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -24,6 +24,13 @@ export const CapaciteScolaireColoreeActuelleField = chakra( const isReadOnly = disabled || ouverture || !coloration; if (!coloration) return <>; - return ; + return ( + + ); } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx index 339763fb0..f6108baa1 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireColoreeField.tsx @@ -8,7 +8,7 @@ import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intention import { isTypeColoration } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; export const CapaciteScolaireColoreeField = chakra( - ({ disabled, className }: { disabled?: boolean; className?: string }) => { + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { const { watch, setValue } = useFormContext(); useEffect( @@ -25,6 +25,6 @@ export const CapaciteScolaireColoreeField = chakra( const isReadOnly = disabled || fermeture || !coloration; if (!coloration) return <>; - return ; + return ; } ); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx index 575c282b7..0f4932070 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteScolaireField.tsx @@ -6,24 +6,25 @@ import { CapaciteField } from "@/app/(wrapped)/intentions/saisie/components/Capa import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intentionForm/defaultFormValues"; import { isTypeColoration, isTypeFermeture } from "@/app/(wrapped)/intentions/utils/typeDemandeUtils"; -export const CapaciteScolaireField = chakra(({ disabled, className }: { disabled?: boolean; className?: string }) => { - const { watch, setValue } = useFormContext(); +export const CapaciteScolaireField = chakra( + ({ id, disabled, className }: { id: string; disabled?: boolean; className?: string }) => { + const { watch, setValue } = useFormContext(); - useEffect( - () => - watch(({ capaciteScolaireActuelle, typeDemande }, { name }) => { - if (name === "typeDemande") { - setValue("capaciteScolaire", 0); - } else if (name === "capaciteScolaireActuelle" && typeDemande === "coloration") { - setValue("capaciteScolaire", capaciteScolaireActuelle); - } - }).unsubscribe - ); + useEffect( + () => + watch(({ capaciteScolaireActuelle, typeDemande }, { name }) => { + if (name === "typeDemande") { + setValue("capaciteScolaire", 0); + } else if (name === "capaciteScolaireActuelle" && typeDemande === "coloration") { + setValue("capaciteScolaire", capaciteScolaireActuelle); + } + }).unsubscribe + ); - const typeDemande = watch("typeDemande"); - const fermeture = isTypeFermeture(typeDemande); - const coloration = isTypeColoration(typeDemande); - const isReadOnly = disabled || fermeture || coloration; + const typeDemande = watch("typeDemande"); + const fermeture = isTypeFermeture(typeDemande); + const coloration = isTypeColoration(typeDemande); + const isReadOnly = disabled || fermeture || coloration; - return ; -}); + return ; + }); diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx index 0d7c8f6a3..2ae748224 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, FormErrorMessage, Input, Table, Tbody, Td, Th, Thead, Tr } from "@chakra-ui/react"; +import {Box, Flex, FormErrorMessage, Input, Table, Tbody, Td, Th, Thead, Tr, VisuallyHidden} from '@chakra-ui/react'; import { useFormContext } from "react-hook-form"; import type { IntentionForms } from "@/app/(wrapped)/intentions/saisie/intentionForm/defaultFormValues"; @@ -15,8 +15,9 @@ import { CapaciteScolaireField } from "./CapaciteScolaireField"; import { ColorationField } from "./ColorationField"; import { LibelleColorationField } from "./LibelleColorationField"; -const ConstanteField = ({ value }: { value: string | number | undefined }) => ( +const ConstanteField = ({ id, value }: { id: string; value: string | number | undefined }) => ( {
Tableau des capacités Capacité actuelle - + + Capacité scolaire actuelle + + - + + Capacité scolaire + + - + + Capacité scolaire colorée actuelle + + - + + Capacité scolaire colorée + + - + + Nouvelles places scolaires + +
- + + Capacité en apprentissage actuelle + + - + + Capacité en apprentissage + + - + + Capacité en apprentissage colorée actuelle + + - + + Capacité en apprentissage colorée + + - + + Nouvelles places en apprentissage + +
- + @@ -96,23 +97,58 @@ export const CapaciteSection = ({ disabled }: { disabled: boolean }) => { Capacité en voie scolaire {coloration && ( <> )} @@ -120,23 +156,58 @@ export const CapaciteSection = ({ disabled }: { disabled: boolean }) => { Capacité en apprentissage {coloration && ( <> )} From 0f1ba2b3067b249e989e954c57c20c09ec276a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20D=C3=A9tr=C3=A9?= Date: Wed, 8 Jan 2025 18:23:59 +0100 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20accessibilit=C3=A9=20des=20autres=20?= =?UTF-8?q?formulaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/security/permissions.ts | 36 ++++---- .../admin/roles/components/UserSearchBar.tsx | 7 +- ui/app/(wrapped)/admin/roles/const.ts | 1 + ui/app/(wrapped)/admin/users/CreateUser.tsx | 1 + ui/app/(wrapped)/admin/users/EditUser.tsx | 1 + ui/app/(wrapped)/admin/users/page.tsx | 9 +- ui/app/(wrapped)/components/EnvBandeau.tsx | 3 +- ui/app/(wrapped)/components/Header.tsx | 2 +- .../components/InformationHeader.tsx | 3 +- ui/app/(wrapped)/components/LandingFooter.tsx | 2 +- .../typeDemandeSection/TypeDemandeSection.tsx | 3 +- .../capaciteSection/CapaciteSection.tsx | 2 +- .../[numero]/components/InformationHeader.tsx | 7 +- .../typeDemandeSection/TypeDemandeSection.tsx | 3 +- .../capaciteSection/CapaciteSection.tsx | 2 +- .../[numero]/components/InformationHeader.tsx | 7 +- ui/components/AdvancedExportMenuButton.tsx | 89 +++++++++++-------- ui/components/Multiselect.tsx | 27 +++--- 18 files changed, 124 insertions(+), 81 deletions(-) diff --git a/shared/security/permissions.ts b/shared/security/permissions.ts index 2d994eead..bd55db1f8 100644 --- a/shared/security/permissions.ts +++ b/shared/security/permissions.ts @@ -7,8 +7,6 @@ export type Permission = KeyOfUnion<(typeof PERMISSIONS)[keyof typeof PERMISSION export const PERMISSIONS = { admin: { - "enregistrement-requete/lecture": { default: "national" }, - "enregistrement-requete/ecriture": { default: "national" }, "pilotage_reforme/lecture": { default: "national" }, "intentions/lecture": { default: "national", draft: "national" }, "intentions/ecriture": { default: "national" }, @@ -24,10 +22,10 @@ export const PERMISSIONS = { "intentions-perdir-statut/lecture": { default: "national" }, "intentions-perdir-avis/ecriture": { default: "national" }, "intentions-perdir-avis/lecture": { default: "national" }, - }, - pilote: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + pilote: { "intentions/lecture": { default: "national", draft: "national" }, "pilotage_reforme/lecture": { default: "national" }, "restitution-intentions/lecture": { default: "national" }, @@ -35,10 +33,10 @@ export const PERMISSIONS = { "intentions-perdir/lecture": { default: "national", draft: "national" }, "intentions-perdir-statut/lecture": { default: "national" }, "intentions-perdir-avis/lecture": { default: "national" }, - }, - admin_region: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + admin_region: { "intentions/lecture": { default: "national", draft: "national" }, "intentions/ecriture": { default: "region", draft: "region" }, "restitution-intentions/lecture": { default: "national" }, @@ -51,10 +49,10 @@ export const PERMISSIONS = { "intentions-perdir-statut/lecture": { default: "region" }, "intentions-perdir-avis/ecriture": { default: "region" }, "intentions-perdir-avis/lecture": { default: "region" }, - }, - region: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + region: { "intentions/lecture": { default: "region", draft: "region" }, "restitution-intentions/lecture": { default: "region" }, "pilotage-intentions/lecture": { default: "national" }, @@ -62,10 +60,10 @@ export const PERMISSIONS = { "intentions-perdir-statut/lecture": { default: "region" }, "intentions-perdir-avis/ecriture": { default: "region" }, "intentions-perdir-avis/lecture": { default: "region" }, - }, - pilote_region: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + pilote_region: { "intentions/lecture": { default: "national", draft: "national" }, "intentions/ecriture": { default: "region", draft: "region" }, "restitution-intentions/lecture": { default: "national" }, @@ -76,10 +74,10 @@ export const PERMISSIONS = { "intentions-perdir-statut/lecture": { default: "region" }, "intentions-perdir-avis/ecriture": { default: "region" }, "intentions-perdir-avis/lecture": { default: "region" }, - }, - gestionnaire_region: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + gestionnaire_region: { "intentions/lecture": { default: "region", draft: "region" }, "intentions/ecriture": { default: "region", draft: "region" }, "restitution-intentions/lecture": { default: "region" }, @@ -90,10 +88,10 @@ export const PERMISSIONS = { "intentions-perdir-statut/lecture": { default: "region" }, "intentions-perdir-avis/ecriture": { default: "region" }, "intentions-perdir-avis/lecture": { default: "region" }, - }, - expert_region: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + expert_region: { "intentions/lecture": { default: "region", draft: "region" }, "restitution-intentions/lecture": { default: "region" }, "pilotage-intentions/lecture": { default: "national" }, @@ -101,10 +99,10 @@ export const PERMISSIONS = { "intentions-perdir-statut/lecture": { default: "region" }, "intentions-perdir-avis/ecriture": { default: "region" }, "intentions-perdir-avis/lecture": { default: "region" }, - }, - perdir: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + perdir: { "intentions/lecture": { default: "uai", draft: "uai" }, "intentions-perdir/lecture": { default: "uai", draft: "uai" }, "intentions-perdir/ecriture": { default: "uai", draft: "uai" }, @@ -112,15 +110,17 @@ export const PERMISSIONS = { "pilotage-intentions/lecture": { default: "uai" }, "intentions-perdir-statut/lecture": { default: "uai" }, "intentions-perdir-avis/lecture": { default: "uai" }, - }, - invite: { "enregistrement-requete/lecture": { default: "national" }, "enregistrement-requete/ecriture": { default: "national" }, + }, + invite: { "intentions/lecture": { default: "role", draft: "role" }, "restitution-intentions/lecture": { default: "role" }, "intentions-perdir/lecture": { default: "region", draft: "region" }, "intentions-perdir-statut/lecture": { default: "region" }, "intentions-perdir-avis/lecture": { default: "region" }, + "enregistrement-requete/lecture": { default: "national" }, + "enregistrement-requete/ecriture": { default: "national" }, }, } satisfies { [R: string]: { diff --git a/ui/app/(wrapped)/admin/roles/components/UserSearchBar.tsx b/ui/app/(wrapped)/admin/roles/components/UserSearchBar.tsx index 71745f339..0dcabdb4f 100644 --- a/ui/app/(wrapped)/admin/roles/components/UserSearchBar.tsx +++ b/ui/app/(wrapped)/admin/roles/components/UserSearchBar.tsx @@ -1,4 +1,4 @@ -import { Badge, HStack, Skeleton, Text } from "@chakra-ui/react"; +import { Badge, HStack, Skeleton, Text, VisuallyHidden } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import { useEffect } from "react"; import type { CSSObjectWithLabel, SingleValueProps } from "react-select"; @@ -60,13 +60,18 @@ const UserSearchBar = ({ updateUser, user }: UserSearchBarProps) => { role: defaultValues[0].role!, }); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isLoading, defaultValues]); return ( <> + + Rechercher un utilisateur + {(!user || isLoading) && } {user && !isLoading && ( ({ diff --git a/ui/app/(wrapped)/admin/roles/const.ts b/ui/app/(wrapped)/admin/roles/const.ts index 494c19149..92ba9911b 100644 --- a/ui/app/(wrapped)/admin/roles/const.ts +++ b/ui/app/(wrapped)/admin/roles/const.ts @@ -64,6 +64,7 @@ export const ROLES_LABELS: { export const PERMISSION_GROUP_LABELS: { [key: string]: string; } = { + "enregistrement-requete": "Enregistrement de requêtes", pilotage_reforme: "Pilotage de la réforme", intentions: "Demandes", "restitution-intentions": "Restitution des demandes", diff --git a/ui/app/(wrapped)/admin/users/CreateUser.tsx b/ui/app/(wrapped)/admin/users/CreateUser.tsx index 0c21ca075..994d32b6c 100644 --- a/ui/app/(wrapped)/admin/users/CreateUser.tsx +++ b/ui/app/(wrapped)/admin/users/CreateUser.tsx @@ -81,6 +81,7 @@ export const CreateUser = ({ isOpen, onClose }: { isOpen: boolean; onClose: () = if (isAdminRegion && filteredRegions && filteredRegions.length > 0) { setValue("codeRegion", filteredRegions[0].value); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [filteredRegions]); return ( diff --git a/ui/app/(wrapped)/admin/users/EditUser.tsx b/ui/app/(wrapped)/admin/users/EditUser.tsx index 6238e3d3a..cd7009aef 100644 --- a/ui/app/(wrapped)/admin/users/EditUser.tsx +++ b/ui/app/(wrapped)/admin/users/EditUser.tsx @@ -58,6 +58,7 @@ export const EditUser = ({ useEffect(() => { reset(user, { keepDefaultValues: true }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [isOpen, reset]); const { data: regions } = client.ref("[GET]/regions").useQuery({}); diff --git a/ui/app/(wrapped)/admin/users/page.tsx b/ui/app/(wrapped)/admin/users/page.tsx index 56f5ca9ee..abb6ea8a4 100644 --- a/ui/app/(wrapped)/admin/users/page.tsx +++ b/ui/app/(wrapped)/admin/users/page.tsx @@ -18,6 +18,7 @@ import { Thead, Tr, useDisclosure, + VisuallyHidden, } from "@chakra-ui/react"; import { usePlausible } from "next-plausible"; import type { AwaitedReactNode, JSXElementConstructor, ReactElement, ReactNode, ReactPortal } from "react"; @@ -122,8 +123,10 @@ export default () => { <> setFilters({ ...filters, search })}> - setSearch(e.target.value)} value={search} placeholder="Rechercher..." /> -
Tableau des capacités Capacité actuelle - + + Capacité scolaire actuelle + + - + + Capacité scolaire + + - + + Capacité scolaire colorée actuelle + + - + + Capacité scolaire colorée + + - + + Nouvelles places scolaire + +
- + + Capacité en apprentissage actuelle + + - + + Capacité en apprentissage + + - + + Capacité en apprentissage colorée actuelle + + - + + Capacité en apprentissage colorée + + - + + Nouvelles places en apprentissage + +
-
+ Icône utilisateur handleOrder("email")}> {Columns.email} diff --git a/ui/app/(wrapped)/components/EnvBandeau.tsx b/ui/app/(wrapped)/components/EnvBandeau.tsx index 89af19e95..fd034d19b 100644 --- a/ui/app/(wrapped)/components/EnvBandeau.tsx +++ b/ui/app/(wrapped)/components/EnvBandeau.tsx @@ -1,6 +1,6 @@ "use client"; -import { Box, Button, chakra, CloseButton, Stack, Text } from "@chakra-ui/react"; +import { Box, Button, chakra, CloseButton, Stack, Text, VisuallyHidden } from "@chakra-ui/react"; import { Icon } from "@iconify/react"; import { useState } from "react"; @@ -53,6 +53,7 @@ export const EnvBandeau = chakra(() => { width="auto" height="auto" > + Fermer diff --git a/ui/app/(wrapped)/components/Header.tsx b/ui/app/(wrapped)/components/Header.tsx index af3dc775d..01d8731d3 100644 --- a/ui/app/(wrapped)/components/Header.tsx +++ b/ui/app/(wrapped)/components/Header.tsx @@ -94,7 +94,7 @@ export const Header = ({ isMaintenance }: { isMaintenance?: boolean }) => { - + Se déconnecter diff --git a/ui/app/(wrapped)/components/InformationHeader.tsx b/ui/app/(wrapped)/components/InformationHeader.tsx index 7653f9310..ab6978d9f 100644 --- a/ui/app/(wrapped)/components/InformationHeader.tsx +++ b/ui/app/(wrapped)/components/InformationHeader.tsx @@ -1,4 +1,4 @@ -import { Box, Button, CloseButton, Link, Stack, Text, VStack } from "@chakra-ui/react"; +import {Box, Button, CloseButton, Link, Stack, Text, VisuallyHidden,VStack} from '@chakra-ui/react'; import { Icon } from "@iconify/react"; import NextLink from "next/link"; import { useEffect, useState } from "react"; @@ -97,6 +97,7 @@ export const InformationHeader = () => { width="auto" height="auto" > + Fermer diff --git a/ui/app/(wrapped)/components/LandingFooter.tsx b/ui/app/(wrapped)/components/LandingFooter.tsx index 0799bef29..1e8dde3dc 100644 --- a/ui/app/(wrapped)/components/LandingFooter.tsx +++ b/ui/app/(wrapped)/components/LandingFooter.tsx @@ -41,7 +41,7 @@ export const LandingFooter = () => { }} > - + Logo République française + Fermer diff --git a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx index dcdcb6109..b3e9c6bb6 100644 --- a/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx +++ b/ui/app/(wrapped)/intentions/perdir/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx @@ -69,7 +69,7 @@ export const CapaciteSection = ({ disabled }: { disabled: boolean }) => { - + diff --git a/ui/app/(wrapped)/intentions/perdir/synthese/[numero]/components/InformationHeader.tsx b/ui/app/(wrapped)/intentions/perdir/synthese/[numero]/components/InformationHeader.tsx index e5fede95e..c13525ee1 100644 --- a/ui/app/(wrapped)/intentions/perdir/synthese/[numero]/components/InformationHeader.tsx +++ b/ui/app/(wrapped)/intentions/perdir/synthese/[numero]/components/InformationHeader.tsx @@ -1,4 +1,4 @@ -import { Box, CloseButton, Collapse, Stack, Text, VStack } from "@chakra-ui/react"; +import {Box, CloseButton, Collapse, Stack, Text, VisuallyHidden,VStack} from '@chakra-ui/react'; import { Icon } from "@iconify/react"; import { useState } from "react"; import { hasRole } from "shared"; @@ -102,7 +102,10 @@ export const InformationHeader = ({ statut }: { statut?: DemandeStatutType }) => setShouldDisplay(false); }} mb={"auto"} - /> + > + Fermer + + diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx index 48cf0c01b..5e4862e72 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/TypeDemandeSection.tsx @@ -1,4 +1,4 @@ -import { Box, Button, chakra, CloseButton, Divider, Flex, Heading, Highlight, Stack, Text, Tooltip } from "@chakra-ui/react"; +import {Box, Button, chakra, CloseButton, Divider, Flex, Heading, Highlight, Stack, Text, Tooltip, VisuallyHidden} from '@chakra-ui/react'; import { Icon } from "@iconify/react"; import { useRouter, useSearchParams } from "next/navigation"; import type { RefObject } from "react"; @@ -69,6 +69,7 @@ const InfoAjustementSection = chakra(({ anneeCampagne }: { anneeCampagne: string width="auto" height="auto" > + Fermer diff --git a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx index 2ae748224..71493ab60 100644 --- a/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx +++ b/ui/app/(wrapped)/intentions/saisie/intentionForm/typeDemandeSection/capaciteSection/CapaciteSection.tsx @@ -69,7 +69,7 @@ export const CapaciteSection = ({ disabled }: { disabled: boolean }) => {
Tableau des capacitésVoie Capacité actuelle
- + diff --git a/ui/app/(wrapped)/intentions/synthese/[numero]/components/InformationHeader.tsx b/ui/app/(wrapped)/intentions/synthese/[numero]/components/InformationHeader.tsx index e5fede95e..c13525ee1 100644 --- a/ui/app/(wrapped)/intentions/synthese/[numero]/components/InformationHeader.tsx +++ b/ui/app/(wrapped)/intentions/synthese/[numero]/components/InformationHeader.tsx @@ -1,4 +1,4 @@ -import { Box, CloseButton, Collapse, Stack, Text, VStack } from "@chakra-ui/react"; +import {Box, CloseButton, Collapse, Stack, Text, VisuallyHidden,VStack} from '@chakra-ui/react'; import { Icon } from "@iconify/react"; import { useState } from "react"; import { hasRole } from "shared"; @@ -102,7 +102,10 @@ export const InformationHeader = ({ statut }: { statut?: DemandeStatutType }) => setShouldDisplay(false); }} mb={"auto"} - /> + > + Fermer + + diff --git a/ui/components/AdvancedExportMenuButton.tsx b/ui/components/AdvancedExportMenuButton.tsx index dfd4cec26..3ad669bcf 100644 --- a/ui/components/AdvancedExportMenuButton.tsx +++ b/ui/components/AdvancedExportMenuButton.tsx @@ -1,6 +1,6 @@ import { DownloadIcon } from "@chakra-ui/icons"; import type { MenuButtonProps } from "@chakra-ui/react"; -import { Button, Divider, Flex, Menu, MenuButton, MenuList, Radio, RadioGroup, Spinner, Text } from "@chakra-ui/react"; +import { Button, Divider, Flex, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, Radio, RadioGroup, Spinner, Text } from "@chakra-ui/react"; import { useState } from "react"; type AdvancedExportMenuButtonProps = MenuButtonProps & { @@ -57,46 +57,61 @@ export const AdvancedExportMenuButton = ({ }; return ( - + } {...rest}> {isQueryLoading ? : "Exporter"} - - - Option d'export - - - - - Exporter la requête en cours - - - Exporter toutes les données - - - - - - Format - - - - - CSV (.csv) - - - Excel (.xlsx) - - - - - - - - + setExportType(value as string)} + value={exportType} + > + + Exporter la requête en cours + + + Exporter toutes les données + + + + setExportFormat(value as string)} + value={exportFormat} + > + + CSV (.csv) + + + Excel (.xlsx) + + + + handleExport()} + mx={"auto"} + w={"fit-content"} + bgColor={"bluefrance.113"} + color={"white"} + borderRadius={0} + fontWeight={400} + _hover={{ + bg: "bluefrance.113_hover", + _disabled: { bg: "bluefrance.113" }, + }} + > + Exporter + ); diff --git a/ui/components/Multiselect.tsx b/ui/components/Multiselect.tsx index 5061d381d..e889d43c5 100644 --- a/ui/components/Multiselect.tsx +++ b/ui/components/Multiselect.tsx @@ -1,9 +1,9 @@ "use client"; import { ChevronDownIcon, RepeatIcon } from "@chakra-ui/icons"; import type { PlacementWithLogical, PositionProps } from "@chakra-ui/react"; -import { Box, Button, chakra, Flex, Input, Menu, MenuButton, MenuList, Portal, Text } from "@chakra-ui/react"; +import { Box, Button, chakra, Flex, Input, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, Portal, Text, VisuallyHidden } from "@chakra-ui/react"; import type { ChangeEventHandler, ReactNode } from "react"; -import { memo, useMemo, useRef, useState } from "react"; +import { memo, useId, useMemo, useRef, useState } from "react"; import removeAccents from "remove-accents"; const ButtonContent = ({ selected, children }: { selected: string[]; children: ReactNode }) => { @@ -24,7 +24,7 @@ const Checkbox = ({ checked: boolean; }) => { return ( -
Tableau des capacitésVoie Capacité actuelle