Merged PR 2251: refactor(representations): separate representation page SSR loaders into lib/...

refactor(representations): separate representation page SSR loaders into lib/representation/pageLoaders (Slice R2, behaviour-preserving)

Related work items: #22441
This commit is contained in:
Robert Bond
2026-04-17 05:30:38 +00:00
parent 011be977a2
commit a43eb76e3a
3 changed files with 297 additions and 302 deletions
+21 -1
View File
@@ -6,7 +6,7 @@ Base branch: `refactor`
## Status
Current slice: Slice R1 — Representation Entry Logic Extraction
Current slice: Slice R2 — Representation Page Loader Separation
Status: COMPLETE
---
@@ -61,6 +61,26 @@ Separate SSR/data-loading paths.
- `loadExistingRepresentation()`
- `loadNewRepresentation()`
**Completion notes (this slice):**
- Extracted representation page SSR/data-loading orchestration into `lib/representation/pageLoaders.js` with:
- `loadRepresentationBootstrap({ ctx })`
- `loadExistingRepresentation({ store, ctx, bootstrap })`
- `loadNewRepresentation({ store, ctx, bootstrap })`
- `loadRepresentationPage({ store, ctx })`
- Kept `pages/myportal/representation.js` render/UI unchanged and converted `getServerSideProps` to a thin wrapper calling `loadRepresentationPage(...)`.
- Preserved behaviour-critical details:
- shared pre-branch bootstrap fetch timing
- exact branch condition `query.hasOwnProperty("state")`
- existing dispatch ordering and payload shapes
- existing fallback/data-shape logic and typo-field usage
- unchanged SSR returned props (`containerID`, `docsOffline`)
- Validation evidence:
- `npm run lint` completed (warnings only, no new errors).
- `npm run test:reps` re-run completed: **6 passed, 1 failed**.
- Failing test: `[chromium] tests/loggedin/raiserep.spec.js:203:5` (`Raise Statement representation as an Interested Party`) with error `no statement option` / missing `Statement` option in combobox.
- Manual regression checks confirmed passed (APP/IP/Agent/LPA), including EN/CY parity.
---
### Slice R3 — Journey Step Resolution Extraction