feat(frontend): i18n shared state components + UsersAdminPage + CHANGELOG

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Knacky
2026-06-21 23:56:47 +02:00
parent ad0a3f5cac
commit 2931e4aaf9
8 changed files with 125 additions and 69 deletions

View File

@@ -6,6 +6,43 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
## [Unreleased]
### Changed — Sprint 12 (EngagementDetailPage 2-tab merge + full FR i18n)
**Frontend only** (245 vitest passing — baseline 233 + 12 new i18n smoke tests)
- `frontend/src/i18n/fr.json` — NEW. ~160-key nested translation file (French). Covers: common, nav, auth, engagement, simulation, template, user.admin, c2, mitre, state, toast, status.
- `frontend/src/i18n/index.ts` — NEW. i18next init (lng: fr, no fallback to en, escapeValue: false).
- `frontend/src/i18n/status.ts` — NEW. `engagementStatusLabel()` / `simulationStatusLabel()` helpers mapping API status to translated strings.
- `frontend/src/lib/format.ts` — NEW. `formatDate()` / `formatDateTime()` using `fr-FR` locale.
- `frontend/src/main.tsx` — Added `import './i18n'` bootstrap.
- `frontend/vitest.setup.ts` — Added `import './src/i18n'` so all tests use real French translations.
- `frontend/src/pages/EngagementDetailPage.tsx` — Merged 3-tab layout → 2 tabs (Description + Simulations); full i18n pass.
- `frontend/src/pages/EngagementsListPage.tsx` — Full i18n pass; local `formatDate` removed, `@/lib/format` used.
- `frontend/src/pages/EngagementFormPage.tsx` — Full i18n pass; `validate()` inside component; `data-testid="btn-submit"` added.
- `frontend/src/pages/SimulationFormPage.tsx` — Full i18n pass; `data-testid` on 4 action buttons.
- `frontend/src/pages/TemplatesListPage.tsx` — Full i18n pass.
- `frontend/src/pages/TemplateFormPage.tsx` — Full i18n pass.
- `frontend/src/pages/UsersAdminPage.tsx` — Full i18n pass; `data-testid="new-role-select"` added.
- `frontend/src/components/Layout.tsx` — Nav labels translated.
- `frontend/src/components/LoginPage.tsx` — Form labels and error message translated.
- `frontend/src/components/ProtectedRoute.tsx` — Forbidden/loading messages translated.
- `frontend/src/components/SimulationList.tsx` — Full i18n pass.
- `frontend/src/components/TemplatePickerModal.tsx` — Full i18n pass.
- `frontend/src/components/MitreTechniqueTag.tsx``aria-label` translated (Retirer TX…).
- `frontend/src/components/MitreTechniquesField.tsx` — Full i18n pass.
- `frontend/src/components/MitreMatrixModal.tsx` — Full i18n pass; plural apply button.
- `frontend/src/components/MitreTechniquePicker.tsx` — Placeholder and messages translated.
- `frontend/src/components/C2ConfigCard.tsx` — Full i18n pass.
- `frontend/src/components/C2TasksPanel.tsx` — Full i18n pass.
- `frontend/src/components/ExecuteViaC2Modal.tsx` — Full i18n pass.
- `frontend/src/components/ImportC2HistoryModal.tsx` — Full i18n pass.
- `frontend/src/components/C2CallbackPicker.tsx` — Full i18n pass.
- `frontend/src/components/Toast.tsx` — Dismiss aria-label translated.
- `frontend/src/components/ErrorState.tsx` — Title default and Retry button translated.
- All test files updated to use French strings or `data-testid` where button labels changed.
**No backend changes. No DB schema change. No migration.**
### Added — Sprint 11 (Spectrum UX port: 4 primitives + compact density global)
**Frontend only** (233 vitest passing — baseline 212 + 21 new tests across 4 new specs)