Skip to content

Commit

Permalink
fix: last update wordings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 committed Jun 18, 2024
1 parent 6a5eb64 commit 131ad72
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 54 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/app/(consultation)/SearchSirenForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const SearchSirenForm = ({ searchParams }: SearchSirenFormProps) => {
<Grid haveGutters>
<GridCol>
<Input
label="Saisir un numéro de Siren ou un nom d'entreprise de l'entreprise déclarante"
label="Saisir le numéro Siren ou le nom de l'entreprise déclarante (privilégier le numéro Siren)"
nativeInputProps={{
id: "query",
title: "Saisissez le nom ou le Siren d'une entreprise déclarante",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ const Recherche = withSearchParamsValidation(getDeclarationStatsInputSchema)(asy
/>
</>
)}
<Heading as="h1" variant="h5" text="Rechercher l'index de l'égalité professionnelle d'une entreprise" />
<Heading
as="h1"
variant="h5"
text="Rechercher l'index de l'égalité professionnelle d'une entreprise ou unité économique et sociale (UES)"
/>

<SearchSirenForm searchParams={searchParams} />
<DetailedDownload
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/app/(default)/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const Navigation = () => {
text: "Consulter l'index",
linkProps: {
href: "/index-egapro/recherche",
target: "_blank",
},
isActive: segments.includes("recherche") && segments.includes("index-egapro"),
},
Expand Down Expand Up @@ -87,6 +88,7 @@ export const Navigation = () => {
text: "Consulter les écarts",
linkProps: {
href: "/representation-equilibree/recherche",
target: "_blank",
},
isActive: segments.includes("recherche") && segments.includes("representation-equilibree"),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ export const RemunerationGenericForm = ({ mode }: { mode: Remunerations["mode"]
return (
<FormProvider {...methods}>
<form onSubmit={handleSubmit(onSubmit)} noValidate>
<p className="fr-text--xs">Les champs suivis d'une * sont obligatoires</p>
<AlertMessage title="Erreur" message={errors.catégories?.root?.message} />

<ClientAnimate>
<ClientOnly fallback={<SkeletonForm fields={2} />}>
<div className={fr.cx("fr-mb-8w")}></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const RemunerationCoefficientAutrePage = () => {
return (
<>
<DeclarationStepper stepName={stepName} />

<h4>Ecarts de rémunération par niveau ou coefficient et tranche d'âge en % *</h4>
<p>
Il faut saisir les écarts de rémunération en % avant application du seuil de pertinence uniquement pour les
niveaux ou coefficients et tranches d'âge pris en compte pour le calcul (zéro signifiant qu'il n'y a pas d'écart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const RemunerationCoefficientBranchePage = () => {
<AlertExistingDeclaration />
<DeclarationStepper stepName={stepName} />

<h4>Ecarts de rémunération par niveau ou coefficient et tranche d'âge en % *</h4>
<p>
Il faut saisir les écarts de rémunération en % avant application du seuil de pertinence uniquement pour les
niveaux ou coefficients et tranches d'âge pris en compte pour le calcul (zéro signifiant qu'il n'y a pas d'écart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const RemunerationCSPPage = () => {
<>
<DeclarationStepper stepName={stepName} />

<h4>Ecarts de rémunération par CSP et tranche d'âge en % *</h4>
<p>
Il faut saisir les écarts de rémunération en % avant application du seuil de pertinence uniquement pour les CSP
et tranches d'âge pris en compte pour le calcul (zéro signifiant qu'il n'y a pas d'écart entre les femmes et les
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ export const CommencerForm = ({ monCompteProHost }: { monCompteProHost: string }
<>
<FormProvider {...methods}>
<form onSubmit={handleSubmit(onSubmit)} noValidate>
<p className="fr-text--xs">Les champs suivis d'une * sont obligatoires</p>
<Select
label="Année au titre de laquelle les indicateurs sont calculés"
label="Année au titre de laquelle les indicateurs sont calculés *"
state={errors.annéeIndicateurs && "error"}
stateRelatedMessage={errors.annéeIndicateurs?.message}
nativeSelectProps={{
Expand All @@ -247,7 +248,7 @@ export const CommencerForm = ({ monCompteProHost }: { monCompteProHost: string }

{user.staff ? (
<Input
label="Siren entreprise (staff)"
label="Siren entreprise (staff) *"
state={errors.siren && "error"}
stateRelatedMessage={errors.siren?.message}
nativeInputProps={{
Expand All @@ -258,7 +259,7 @@ export const CommencerForm = ({ monCompteProHost }: { monCompteProHost: string }
/>
) : (
<Select
label="Numéro Siren de l’entreprise ou de l’entreprise déclarant pour le compte de l’UES (Unité Économique et Sociale)"
label="Numéro Siren de l’entreprise ou de l’entreprise déclarant pour le compte de l’UES (Unité Économique et Sociale) *"
state={errors.siren && "error"}
stateRelatedMessage={errors.siren?.message}
nativeSelectProps={register("siren")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const DeclarantForm = ({ session }: PropsWithChildren<Props>) => {
<>
<FormProvider {...methods}>
<form onSubmit={handleSubmit(onsubmit)}>
<p className="fr-text--xs">Les champs suivis d'une * sont obligatoires</p>
<FormLayout>
<ClientOnly fallback={<SkeletonForm fields={3} />}>
<DeclarantFields<FormType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Input from "@codegouvfr/react-dsfr/Input";
import { indicatorNoteMax } from "@common/core-domain/computers/DeclarationComputer";
import { IndicateurCinqComputer } from "@common/core-domain/computers/IndicateurCinqComputer";
import { type DeclarationDTO } from "@common/core-domain/dtos/DeclarationDTO";
import { setValueAsFloatOrEmptyString, zodNumberOrEmptyString } from "@common/utils/form";
import { IndicatorNoteInput } from "@components/RHF/IndicatorNoteInput";
import { PopulationFavorable } from "@components/RHF/PopulationFavorable";
import { ClientOnly } from "@components/utils/ClientOnly";
Expand All @@ -20,42 +19,22 @@ import { useEffect } from "react";
import { FormProvider, useForm } from "react-hook-form";
import { z } from "zod";

import {
MANDATORY_FAVORABLE_POPULATION,
MANDATORY_RESULT,
NOT_BELOW_0,
NOT_HIGHER_THAN_N_RESULT,
} from "../../../messages";
import { MANDATORY_FAVORABLE_POPULATION, NOT_BELOW_0, NOT_HIGHER_THAN_N_RESULT } from "../../../messages";
import { BackNextButtons } from "../BackNextButtons";
import { assertOrRedirectCommencerStep, funnelConfig, type FunnelKey } from "../declarationFunnelConfiguration";

const formSchema = z
.object({
populationFavorable: z.string().optional(),
résultat: zodNumberOrEmptyString, // Infered as number | string for usage in this React Component (see below).
résultat: z
.number({ invalid_type_error: "La valeur est obligatoire" })
.int("La valeur doit être un nombre entier")
.lte(5, NOT_HIGHER_THAN_N_RESULT(5))
.gte(0, NOT_BELOW_0),
note: z.number(),
})
.superRefine(({ résultat, populationFavorable }, ctx) => {
if (résultat === "") {
// But it won't accept an empty string thanks to superRefine rule.
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: MANDATORY_RESULT,
path: ["résultat"],
});
} else if (résultat < 0) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: NOT_BELOW_0,
path: ["résultat"],
});
} else if (résultat > 5) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: NOT_HIGHER_THAN_N_RESULT(5),
path: ["résultat"],
});
} else if (résultat !== 5 && !populationFavorable) {
if (résultat !== 5 && !populationFavorable) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: MANDATORY_FAVORABLE_POPULATION,
Expand Down Expand Up @@ -95,7 +74,7 @@ export const HautesRémunérationsForm = () => {
const populationFavorable = watch("populationFavorable");

useEffect(() => {
if (résultat !== "" && résultat !== undefined) {
if (résultat !== undefined) {
const note = new IndicateurCinqComputer().computeNote(résultat);
setValue("note", note, { shouldValidate: true });
}
Expand All @@ -121,20 +100,21 @@ export const HautesRémunérationsForm = () => {
<Input
label="Résultat obtenu à l'indicateur en nombre de salariés du sexe sous-représenté *"
nativeInputProps={{
type: "number",
min: 0,
max: 5,
step: 1,
// type: "number",
// min: 0,
// max: 5,
// step: 1,
...register("résultat", {
setValueAs: setValueAsFloatOrEmptyString,
valueAsNumber: true,
// setValueAs: setValueAsFloatOrEmptyString,
}),
onBlur: e => {
// Round number to 1 decimal.
const value = parseFloat(e.target.value);
if (!isNaN(value)) {
setValue("résultat", Math.round(value), { shouldValidate: true });
}
},
// onBlur: e => {
// const value = parseInt(e.target.value);
// console.log("value", value);
// if (!isNaN(value)) {
// setValue("résultat", Math.round(value), { shouldValidate: true });
// }
// },
}}
state={get(errors, "résultat") && "error"}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ export const CommencerForm = ({ session, monCompteProHost }: { monCompteProHost:
return (
<>
<form onSubmit={handleSubmit(onSubmit)} noValidate>
<p className="fr-text--xs">Les champs suivis d'une * sont obligatoires</p>
<FormLayout>
<Select
label="Année au titre de laquelle les écarts de représentation sont calculés"
label="Année au titre de laquelle les écarts de représentation sont calculés *"
state={errors.year && "error"}
stateRelatedMessage={errors.year?.message}
nativeSelectProps={register("year", {
Expand All @@ -141,7 +142,7 @@ export const CommencerForm = ({ session, monCompteProHost }: { monCompteProHost:
</Select>
{session.user.staff ? (
<Input
label="Siren entreprise (staff)"
label="Siren entreprise (staff) *"
state={errors.siren && "error"}
stateRelatedMessage={errors.siren?.message}
nativeInputProps={{
Expand All @@ -152,7 +153,7 @@ export const CommencerForm = ({ session, monCompteProHost }: { monCompteProHost:
/>
) : (
<Select
label="Entreprise"
label="Entreprise *"
state={errors.siren && "error"}
stateRelatedMessage={errors.siren?.message}
nativeSelectProps={register("siren")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const DeclarantForm = ({ session }: { session: Session }) => {
return (
<FormProvider {...methods}>
<form onSubmit={handleSubmit(onSubmit)} noValidate>
<p className="fr-text--xs">Les champs suivis d'une * sont obligatoires</p>
<FormLayout>
<DeclarantFields<DeclarantFormType>
isStaff={session.user.staff}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/RHF/DeclarantFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const DeclarantFields = <FormType extends SimpleObject>({
<Input
label={
<>
Téléphone du déclarant
Téléphone du déclarant *
{isStaff && (
<Button
size="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const TileCompanyIndex = (dto: SearchDeclarationResultDTO) => {
)}
</li>
<li>
Écart taux d'augmentation :{" "}
Écart taux d'augmentations :{" "}
{company[row.year].workforce?.range !== CompanyWorkforceRange.Enum.FROM_251_TO_999 ? (
<>
<Text inline variant="bold" text={`${row.salaryRaisesAndPromotionsScore ?? "NC"}`} />
Expand Down Expand Up @@ -205,7 +205,7 @@ export const TileCompanyIndex = (dto: SearchDeclarationResultDTO) => {
</li>
{company[row.year].workforce?.range !== CompanyWorkforceRange.Enum.FROM_50_TO_250 && (
<li>
Écart taux promotion : <Text inline variant="bold" text={`${row.promotionsScore ?? "NC"}`} />
Écart taux promotions : <Text inline variant="bold" text={`${row.promotionsScore ?? "NC"}`} />
{row.notComputableReasonPromotions && (
<Icon
size="xs"
Expand Down

0 comments on commit 131ad72

Please sign in to comment.