22541 extract grouped breadcrumb pair helpers for myportal and dns routes

This commit is contained in:
2026-04-09 09:52:42 +01:00
parent e24ab89e83
commit a8ef55c65a
2 changed files with 63 additions and 46 deletions
+28
View File
@@ -305,6 +305,34 @@ Follow-ups:
- Next slice recommendation: extract a small grouped helper for recurring two-crumb route pairs (e.g., my-portal + section label, dns list + case reference) to reduce the remaining conditional chain while preserving explicit route behavior.
### CL-22541-K: breadcrumbs grouped two-crumb helper extraction
date: 2026-04-09
author: Cline
scope: `components/breadcrumbs.js`
type: change
rationale: Continue the same bounded refactor cadence by extracting recurring two-crumb patterns into small grouped helpers while preserving explicit route branches.
impact: Refactor-only readability/deduplication improvement; no intended route/auth/session/API/EN-CY/a11y behavior change.
status: completed
Summary:
- Added grouped helper `renderMyPortalSectionCrumbs(sectionLabel)` for recurring my-portal + section text pairs.
- Added grouped helper `renderDnsCaseReferenceCrumbs(referenceValue)` for recurring DNS applications link + case-reference pairs.
- Replaced duplicated route branches with grouped helper usage for:
- `/myportal/addresssearch`, `/myportal/advancedsearch`, `/myportal/contactus`
- `/dnsdetails`, `/dns/[developmentName]`
- Preserved existing href behavior (including EN/CY DNS applications link), labels, and case-reference rendering.
Validation:
- `npx eslint components/breadcrumbs.js` -> pass.
- `node tests/phase22/index.test.cjs` -> pass (combined suite).
Follow-ups:
- Next slice recommendation: extract a small route-to-renderer map for static single-branch crumbs (where branch has no bespoke side-effects) so the main JSX conditional chain shrinks further without altering explicit behavior in dynamic/sensitive branches.
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
date: 2026-04-07