From 2a7d27bf02826f45766179308c7ed0d64305c73c Mon Sep 17 00:00:00 2001 From: Knacky Date: Tue, 26 May 2026 16:08:46 +0200 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20post-QA=20sprint=202=20?= =?UTF-8?q?=E2=80=94=20i18n=20+=20alignment=20+=20textarea=20+=20action=20?= =?UTF-8?q?bar=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Translate all remaining French strings to English (toasts, buttons, banner) - Fix UsersAdminPage create-form grid alignment: items-start + self-end on button wrapper - Change execution_result from TextInput to TextArea (5 rows, multiline) - Replace split Save RT / Save SOC footers + workflow div with a single sticky action bar (Save Red Team | Save SOC | Mark for review | Close | Delete) - Update Vitest assertions to use English button labels Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/SimulationList.tsx | 4 +- frontend/src/pages/SimulationFormPage.tsx | 109 ++++++++++----------- frontend/src/pages/UsersAdminPage.tsx | 10 +- frontend/tests/SimulationFormPage.test.tsx | 26 ++--- 4 files changed, 72 insertions(+), 77 deletions(-) diff --git a/frontend/src/components/SimulationList.tsx b/frontend/src/components/SimulationList.tsx index cc705aa..210a1f6 100644 --- a/frontend/src/components/SimulationList.tsx +++ b/frontend/src/components/SimulationList.tsx @@ -44,7 +44,7 @@ export function SimulationList({ engagementId }: SimulationListProps): JSX.Eleme className="btn-primary" data-testid="new-simulation-btn" > - Nouvelle simulation + New simulation ) : undefined } @@ -62,7 +62,7 @@ export function SimulationList({ engagementId }: SimulationListProps): JSX.Eleme className="btn-primary" data-testid="new-simulation-btn" > - Nouvelle simulation + New simulation ) : null} diff --git a/frontend/src/pages/SimulationFormPage.tsx b/frontend/src/pages/SimulationFormPage.tsx index 45dbc88..2e274d9 100644 --- a/frontend/src/pages/SimulationFormPage.tsx +++ b/frontend/src/pages/SimulationFormPage.tsx @@ -137,7 +137,7 @@ export function SimulationFormPage(): JSX.Element { } try { const created = await createMutation.mutateAsync({ name: rt.name.trim() }); - push('Simulation créée', 'success'); + push('Simulation created', 'success'); navigate(`/engagements/${engagementId}/simulations/${created.id}/edit`); } catch (err) { setSubmitError(extractApiError(err, 'Could not create simulation')); @@ -164,7 +164,7 @@ export function SimulationFormPage(): JSX.Element { }; try { await updateMutation.mutateAsync(patch); - push('Simulation mise à jour', 'success'); + push('Simulation updated', 'success'); } catch (err) { setSubmitError(extractApiError(err, 'Could not update simulation')); } @@ -181,7 +181,7 @@ export function SimulationFormPage(): JSX.Element { }; try { await updateMutation.mutateAsync(patch); - push('Rapport SOC mis à jour', 'success'); + push('SOC report updated', 'success'); } catch (err) { setSubmitError(extractApiError(err, 'Could not update SOC fields')); } @@ -190,18 +190,18 @@ export function SimulationFormPage(): JSX.Element { const onMarkReview = async () => { try { await transitionMutation.mutateAsync('review_required'); - push('Simulation marquée en revue', 'success'); + push('Simulation marked for review', 'success'); } catch (err) { - push(extractApiError(err, 'Transition impossible'), 'error'); + push(extractApiError(err, 'Transition failed'), 'error'); } }; const onClose = async () => { try { await transitionMutation.mutateAsync('done'); - push('Simulation clôturée', 'success'); + push('Simulation closed', 'success'); } catch (err) { - push(extractApiError(err, 'Transition impossible'), 'error'); + push(extractApiError(err, 'Transition failed'), 'error'); } }; @@ -209,10 +209,10 @@ export function SimulationFormPage(): JSX.Element { setShowDeleteConfirm(false); try { await deleteMutation.mutateAsync(simulationId as number); - push('Simulation supprimée', 'success'); + push('Simulation deleted', 'success'); navigate(`/engagements/${engagementId}`); } catch (err) { - push(extractApiError(err, 'Suppression impossible'), 'error'); + push(extractApiError(err, 'Could not delete simulation'), 'error'); } }; @@ -225,7 +225,7 @@ export function SimulationFormPage(): JSX.Element { ← Back to engagement -

Nouvelle simulation

+

New simulation

@@ -290,8 +290,7 @@ export function SimulationFormPage(): JSX.Element { data-testid="soc-blocked-banner" className="rounded-xl px-xl py-md bg-fog border border-hairline text-[14px] text-charcoal" > - Simulation pas encore en revue — la redteam doit la marquer comme "Review required" avant - que vous puissiez intervenir. + Simulation not yet ready for review — the red team must mark it as "Review required" before you can fill in the SOC section. )} @@ -361,36 +360,27 @@ export function SimulationFormPage(): JSX.Element { /> -
- - setRt({ ...rt, executed_at: e.target.value })} - disabled={rtDisabled} - /> - + + setRt({ ...rt, executed_at: e.target.value })} + disabled={rtDisabled} + /> + - - setRt({ ...rt, execution_result: e.target.value })} - disabled={rtDisabled} - /> - -
- - {canEditRT && ( -
- -
- )} + +