Skip to content

Commit

Permalink
fix: Declaration recap indicators wording (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturlg authored Feb 20, 2024
1 parent 6bd460c commit 87c0cc5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<RecapCard
title={funnelStaticConfig[name].title}
Expand All @@ -56,17 +72,7 @@ export const RecapCardIndicator = ({ name, customContent, edit, déclaration }:
note={note}
max={indicatorNoteMax[name]}
text="Nombre de points obtenus à l'indicateur"
legend={
name === "conges-maternite"
? ""
: populationFavorable === FavorablePopulation.Enum.EQUALITY
? "Égalité de l'indicateur"
: name === "hautes-remunerations"
? `${capitalize(populationFavorable)} sur-représenté${
populationFavorable === FavorablePopulation.Enum.WOMEN ? "e" : ""
}s`
: `Écart en faveur des ${populationFavorable}`
}
legend={getLegend()}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const RemunerationResultatForm = () => {
mode: "onChange",
shouldUnregister: true,
resolver: zodResolver(formSchema),
defaultValues: formData[stepName],
defaultValues: formData[stepName] || { résultat: "" },
});

const {
Expand Down

0 comments on commit 87c0cc5

Please sign in to comment.