From 87c0cc5c9081d24c3d00b63727a95801528bb5cc Mon Sep 17 00:00:00 2001 From: Artur Rucinski <90777022+arturlg@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:09:50 +0100 Subject: [PATCH] fix: Declaration recap indicators wording (#2141) --- .../[siren]/[year]/RecapCardIndicator.tsx | 28 +++++++++++-------- .../RemunerationResultatForm.tsx | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/app/src/app/(default)/index-egapro/declaration/[siren]/[year]/RecapCardIndicator.tsx b/packages/app/src/app/(default)/index-egapro/declaration/[siren]/[year]/RecapCardIndicator.tsx index c4d45e0f9..d476c9ae0 100644 --- a/packages/app/src/app/(default)/index-egapro/declaration/[siren]/[year]/RecapCardIndicator.tsx +++ b/packages/app/src/app/(default)/index-egapro/declaration/[siren]/[year]/RecapCardIndicator.tsx @@ -36,6 +36,22 @@ export const RecapCardIndicator = ({ name, customContent, edit, déclaration }: : indicateur?.populationFavorable; const motifNc = indicateur?.estCalculable === "non" ? indicateur.motifNonCalculabilité : undefined; + const getLegend = () => { + if (name === "conges-maternite") { + return ""; + } else if (populationFavorable === FavorablePopulation.Enum.EQUALITY) { + return "Égalité de l'indicateur"; + } else if (populationFavorable === undefined) { + return "Les femmes et les hommes sont à parité"; + } else if (name === "hautes-remunerations") { + return `${capitalize(populationFavorable)} sur-représenté${ + populationFavorable === FavorablePopulation.Enum.WOMEN ? "e" : "" + }s`; + } else { + return `Écart en faveur des ${populationFavorable}`; + } + }; + return ( )} diff --git a/packages/app/src/app/(default)/index-egapro/declaration/remunerations-resultat/RemunerationResultatForm.tsx b/packages/app/src/app/(default)/index-egapro/declaration/remunerations-resultat/RemunerationResultatForm.tsx index e26d93efa..b7fc24768 100644 --- a/packages/app/src/app/(default)/index-egapro/declaration/remunerations-resultat/RemunerationResultatForm.tsx +++ b/packages/app/src/app/(default)/index-egapro/declaration/remunerations-resultat/RemunerationResultatForm.tsx @@ -66,7 +66,7 @@ export const RemunerationResultatForm = () => { mode: "onChange", shouldUnregister: true, resolver: zodResolver(formSchema), - defaultValues: formData[stepName], + defaultValues: formData[stepName] || { résultat: "" }, }); const {