Skip to content

Commit 5c41446

Browse files
committed
fix(my-space): update side panel step colors and second-round choice state (#3207)
- Current step circle now uses `--background-action-high-info` (#0063CB) instead of `--blue-france-main-525` - Upcoming step title renders in `--text-mention-grey` (#666666) via a shared `StepTitle` helper - `evaluation` variant now distinguishes the second-round choice state (corrective_action + 2nd declaration submitted, no committed next path) from the active joint_evaluation flow: the first shows the transmitted row + `decl2JustificationDeadline` with no bullet, matching the new Figma "Choix d'un parcours de mise en conformité 2" panel - Second declaration transmitted row is now only rendered when a 2nd declaration was actually submitted, fixing a latent mismatch when joint_evaluation is picked directly
1 parent fbf9084 commit 5c41446

4 files changed

Lines changed: 127 additions & 26 deletions

File tree

packages/app/src/e2e/declaration-process-panel.e2e.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,35 @@ test.describe("Declaration process panel", () => {
9595
});
9696
});
9797

98+
test.describe("Variant: evaluation (corrective_action, 2nd decl submitted, second-round choice pending)", () => {
99+
test.beforeAll(async () => {
100+
await setDeclarationComplianceState({
101+
compliancePath: "corrective_action",
102+
secondDeclarationStatus: "submitted",
103+
});
104+
});
105+
106+
test("shows second declaration transmitted without evaluation conjointe bullet", async ({
107+
page,
108+
}) => {
109+
await page.context().clearCookies();
110+
await loginWithProConnect(page);
111+
await waitForDsfrModal(page, PANEL_ID);
112+
113+
const panel = page.locator(`#${PANEL_ID}`);
114+
const remuButton = page.getByRole("button", { name: "Rémunération" });
115+
await expect(remuButton.first()).toBeVisible();
116+
await clickAndExpectDialogOpen(page, remuButton.first(), PANEL_ID);
117+
118+
await expect(
119+
panel.getByText("Votre seconde déclaration a été transmise"),
120+
).toBeVisible();
121+
await expect(
122+
panel.getByText("Évaluation conjointe des rémunérations"),
123+
).toHaveCount(0);
124+
});
125+
});
126+
98127
test.describe("Variant: evaluation (joint_evaluation path, file not uploaded)", () => {
99128
test.beforeAll(async () => {
100129
await setDeclarationComplianceState({

packages/app/src/modules/my-space/DeclarationProcessPanel.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565

6666
.stepCircleCurrent {
67-
background-color: var(--blue-france-main-525);
67+
background-color: var(--background-action-high-info);
6868
}
6969

7070
.stepCirclePending {

packages/app/src/modules/my-space/VerticalStepper.tsx

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { ReactNode } from "react";
2+
13
import type { CampaignDeadlines } from "~/modules/domain";
24
import { formatLongDate, isDeadlinePassed } from "~/modules/domain";
35
import type { PanelVariant } from "./DeclarationProcessPanel";
@@ -63,18 +65,39 @@ export function VerticalStepper({
6365
compliancePath={compliancePath}
6466
secondDeclarationSubmitted={secondDeclarationSubmitted}
6567
siren={siren}
68+
status={step2}
6669
variant={variant}
6770
/>
6871
</div>
6972
<div className={styles.stepLine} />
7073
<div className={styles.stepRow}>
7174
<StepCircle number={3} status={step3} />
72-
<Step3Content campaignDeadlines={campaignDeadlines} variant={variant} />
75+
<Step3Content
76+
campaignDeadlines={campaignDeadlines}
77+
status={step3}
78+
variant={variant}
79+
/>
7380
</div>
7481
</div>
7582
);
7683
}
7784

85+
function StepTitle({
86+
children,
87+
status,
88+
}: {
89+
children: ReactNode;
90+
status: StepStatus;
91+
}) {
92+
return (
93+
<p
94+
className={`fr-text--bold fr-mb-0 ${status === "pending" ? "fr-text-mention--grey" : ""}`.trim()}
95+
>
96+
{children}
97+
</p>
98+
);
99+
}
100+
78101
function StepCircle({
79102
status,
80103
number,
@@ -122,14 +145,17 @@ function Step1Content({
122145
year: number;
123146
}) {
124147
const refYear = year - 1;
148+
const title = (
149+
<StepTitle status={status}>
150+
Déclaration des indicateurs de rémunération
151+
</StepTitle>
152+
);
125153

126154
if (variant === "start") {
127155
return (
128156
<div className={styles.stepContent}>
129157
<div>
130-
<p className="fr-text--bold fr-mb-0">
131-
Déclaration des indicateurs de rémunération
132-
</p>
158+
{title}
133159
<p className="fr-text--sm fr-text-mention--grey fr-mb-0">
134160
Période de référence : 01/01/{refYear} - 31/12/{refYear}.
135161
</p>
@@ -155,9 +181,7 @@ function Step1Content({
155181
if (status === "complete") {
156182
return (
157183
<div className={styles.stepContent}>
158-
<p className="fr-text--bold fr-mb-0">
159-
Déclaration des indicateurs de rémunération
160-
</p>
184+
{title}
161185
{variant !== "closed" && (
162186
<TransmittedRow
163187
downloadHref="/api/declaration-pdf"
@@ -170,31 +194,29 @@ function Step1Content({
170194
);
171195
}
172196

173-
return (
174-
<p className="fr-text--bold fr-mb-0">
175-
Déclaration des indicateurs de rémunération
176-
</p>
177-
);
197+
return title;
178198
}
179199

180200
function Step2Content({
181201
campaignDeadlines,
182202
compliancePath,
183203
secondDeclarationSubmitted,
184204
siren,
205+
status,
185206
variant,
186207
}: {
187208
campaignDeadlines: CampaignDeadlines;
188209
compliancePath: string | null;
189210
secondDeclarationSubmitted: boolean;
190211
siren: string;
212+
status: StepStatus;
191213
variant: PanelVariant;
192214
}) {
193215
const title = (
194-
<p className="fr-text--bold fr-mb-0">
216+
<StepTitle status={status}>
195217
Parcours de mise en conformité pour l'indicateur par catégorie de salariés
196218
si écarts &ge; 5&nbsp;%
197-
</p>
219+
</StepTitle>
198220
);
199221

200222
if (variant === "closed" || variant === "start") {
@@ -219,15 +241,32 @@ function Step2Content({
219241
}
220242

221243
if (variant === "evaluation") {
244+
const secondDeclTransmittedRow = secondDeclarationSubmitted ? (
245+
<TransmittedRow
246+
downloadHref="/api/declaration-pdf?type=correction"
247+
label="Votre seconde déclaration a été transmise"
248+
modifiableUntil={campaignDeadlines.decl2ModificationDeadline}
249+
modifyHref={`/declaration-remuneration/parcours-conformite/etape/1?siren=${siren}`}
250+
/>
251+
) : null;
252+
253+
// Second-round choice pending: user did corrective_action + 2nd declaration
254+
// but has not committed to joint evaluation yet. Show transmitted row +
255+
// choice deadline, no "Évaluation conjointe" bullet.
256+
if (compliancePath === "corrective_action") {
257+
return (
258+
<div className={styles.stepContent}>
259+
{title}
260+
{secondDeclTransmittedRow}
261+
<DeadlineRow date={campaignDeadlines.decl2JustificationDeadline} />
262+
</div>
263+
);
264+
}
265+
222266
return (
223267
<div className={styles.stepContent}>
224268
{title}
225-
<TransmittedRow
226-
downloadHref="/api/declaration-pdf?type=correction"
227-
label="Votre seconde déclaration a été transmise"
228-
modifiableUntil={campaignDeadlines.decl2ModificationDeadline}
229-
modifyHref={`/declaration-remuneration/parcours-conformite/etape/1?siren=${siren}`}
230-
/>
269+
{secondDeclTransmittedRow}
231270
<div className={styles.bulletItem}>
232271
<span aria-hidden="true" className={styles.bullet} />
233272
<p className="fr-mb-0">Évaluation conjointe des rémunérations</p>
@@ -268,13 +307,15 @@ function Step2Content({
268307

269308
function Step3Content({
270309
campaignDeadlines,
310+
status,
271311
variant,
272312
}: {
273313
campaignDeadlines: CampaignDeadlines;
314+
status: StepStatus;
274315
variant: PanelVariant;
275316
}) {
276317
const title = (
277-
<p className="fr-text--bold fr-mb-0">Déposer le ou les avis du CSE</p>
318+
<StepTitle status={status}>Déposer le ou les avis du CSE</StepTitle>
278319
);
279320

280321
if (

packages/app/src/modules/my-space/__tests__/DeclarationProcessPanel.test.tsx

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,50 @@ describe("DeclarationProcessPanel", () => {
121121
});
122122

123123
describe("variant: evaluation", () => {
124-
it("renders second declaration transmitted message", () => {
125-
const { panel } = renderPanel("evaluation");
124+
it("renders second declaration transmitted message when submitted", () => {
125+
const { panel } = renderPanel("evaluation", {
126+
compliancePath: "joint_evaluation",
127+
secondDeclarationStatus: "submitted",
128+
});
126129
expect(
127130
panel.getByText("Votre seconde déclaration a été transmise"),
128131
).toBeInTheDocument();
129132
});
130133

131-
it("renders evaluation conjointe bullet", () => {
132-
const { panel } = renderPanel("evaluation");
134+
it("does not render second declaration row when joint_evaluation chosen directly", () => {
135+
const { panel } = renderPanel("evaluation", {
136+
compliancePath: "joint_evaluation",
137+
secondDeclarationStatus: null,
138+
});
139+
expect(
140+
panel.queryByText("Votre seconde déclaration a été transmise"),
141+
).not.toBeInTheDocument();
142+
expect(
143+
panel.getByText("Évaluation conjointe des rémunérations"),
144+
).toBeInTheDocument();
145+
});
146+
147+
it("renders evaluation conjointe bullet on joint_evaluation path", () => {
148+
const { panel } = renderPanel("evaluation", {
149+
compliancePath: "joint_evaluation",
150+
});
133151
expect(
134152
panel.getByText("Évaluation conjointe des rémunérations"),
135153
).toBeInTheDocument();
136154
});
155+
156+
it("hides evaluation conjointe bullet in second-round choice (corrective_action + 2nd decl submitted)", () => {
157+
const { panel } = renderPanel("evaluation", {
158+
compliancePath: "corrective_action",
159+
secondDeclarationStatus: "submitted",
160+
});
161+
expect(
162+
panel.getByText("Votre seconde déclaration a été transmise"),
163+
).toBeInTheDocument();
164+
expect(
165+
panel.queryByText("Évaluation conjointe des rémunérations"),
166+
).not.toBeInTheDocument();
167+
});
137168
});
138169

139170
describe("variant: cse", () => {

0 commit comments

Comments
 (0)