Skip to content

Commit

Permalink
fix: correction recette nouvelle page effectifs (#3961)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrmr authored Jan 2, 2025
1 parent 51935ef commit 4e8aa2c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ const EffectifsDoublonsDetailTable = ({ data }: { data: any }) => {
borderColor="grey.800"
color="grey.800"
textTransform="none"
letterSpacing="0px"
width={FIXED_COLUMN_WIDTH}
minWidth={FIXED_COLUMN_WIDTH}
maxWidth={FIXED_COLUMN_WIDTH}
Expand All @@ -341,6 +342,7 @@ const EffectifsDoublonsDetailTable = ({ data }: { data: any }) => {
borderColor="grey.800"
color="grey.800"
textTransform="none"
letterSpacing="0px"
width={COLUMN_WIDTH}
minWidth={COLUMN_WIDTH}
p="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { BasicModal } from "@/components/Modals/BasicModal";
import Ribbons from "@/components/Ribbons/Ribbons";
import { effectifIdAtom, effectifFromDecaAtom } from "@/modules/mon-espace/effectifs/engine/atoms";
import { effectifStateSelector, valuesSelector } from "@/modules/mon-espace/effectifs/engine/formEngine/atoms";
import { Trash } from "@/theme/components/icons";
import { Alert, Trash } from "@/theme/components/icons";
import { ErrorPill } from "@/theme/components/icons/ErrorPill";
import { PlainArrowRight } from "@/theme/components/icons/PlainArrowRight";

Expand Down Expand Up @@ -291,6 +291,7 @@ export const EffectifForm = memo(
validationErrors={validationErrorsByBlock.apprenant}
requiredSifa={requiredSifaByBlock.apprenant}
>
<WarningMessage modeSifa />
<EffectifApprenant apprenant={values?.apprenant} modeSifa={modeSifa} />
</AccordionItemChild>
)}
Expand All @@ -303,6 +304,7 @@ export const EffectifForm = memo(
validationErrors={validationErrorsByBlock.formation}
requiredSifa={requiredSifaByBlock.formation}
>
<WarningMessage modeSifa />
<EffectifFormation />
</AccordionItemChild>
)}
Expand All @@ -315,6 +317,7 @@ export const EffectifForm = memo(
validationErrors={validationErrorsByBlock.contrats}
requiredSifa={requiredSifaByBlock.contrats}
>
<WarningMessage modeSifa />
<ApprenantContrats contrats={values?.contrats} />
</AccordionItemChild>
)}
Expand All @@ -326,6 +329,20 @@ export const EffectifForm = memo(
}
);

export const WarningMessage = ({ modeSifa }: { modeSifa: boolean }) => {
if (!modeSifa) return null;

return (
<HStack alignItems={"center"} mt={4}>
<Alert color="warning" bg="white" boxSize="5" />
<Text fontSize="zeta" color="warning">
Les champs verrouillés ci-dessous le sont en raison de l&#39;envoi automatique, chaque nuit, par votre ERP, des
données de votre établissement.
</Text>
</HStack>
);
};

// eslint-disable-next-line react/display-name
const AccordionItemChild = React.memo(
({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ const EffectifsFilterPanel: React.FC<EffectifsFilterPanelProps> = ({
/>
)}

{/* Source */}
{availableFilters?.source && (
{/* Formation */}
{availableFilters?.formation_libelle_long && (
<EffectifsFilterComponent
filterKey="source"
displayName="Source de la donnée"
options={availableFilters.source}
selectedValues={filters.source || []}
onChange={(values) => handleCheckboxChange("source", values)}
isOpen={openFilter === "source"}
setIsOpen={(isOpen) => setOpenFilter(isOpen ? "source" : null)}
filterKey="formation_libelle_long"
displayName="Formation"
options={availableFilters.formation_libelle_long}
selectedValues={filters.formation_libelle_long || []}
onChange={(values) => handleCheckboxChange("formation_libelle_long", values)}
isOpen={openFilter === "formation_libelle_long"}
setIsOpen={(isOpen) => setOpenFilter(isOpen ? "formation_libelle_long" : null)}
/>
)}

Expand All @@ -69,16 +69,16 @@ const EffectifsFilterPanel: React.FC<EffectifsFilterPanelProps> = ({
/>
)}

{/* Formation */}
{availableFilters?.formation_libelle_long && (
{/* Source */}
{availableFilters?.source && (
<EffectifsFilterComponent
filterKey="formation_libelle_long"
displayName="Formation"
options={availableFilters.formation_libelle_long}
selectedValues={filters.formation_libelle_long || []}
onChange={(values) => handleCheckboxChange("formation_libelle_long", values)}
isOpen={openFilter === "formation_libelle_long"}
setIsOpen={(isOpen) => setOpenFilter(isOpen ? "formation_libelle_long" : null)}
filterKey="source"
displayName="Source de la donnée"
options={availableFilters.source}
selectedValues={filters.source || []}
onChange={(values) => handleCheckboxChange("source", values)}
isOpen={openFilter === "source"}
setIsOpen={(isOpen) => setOpenFilter(isOpen ? "source" : null)}
/>
)}

Expand Down

0 comments on commit 4e8aa2c

Please sign in to comment.