0048: Configure product-specific error content - #7288
Conversation
Protect existing fallback titles and graphics before product-specific configuration is introduced.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: illume The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Adds build-time product customization for generic error and not-found pages while preserving existing fallbacks and explicit prop priority.
Changes:
- Adds product error-content configuration helper.
- Integrates configured titles and graphics into error pages.
- Adds comprehensive fallback and precedence tests.
Public ErrorComponentProps documentation requires correction. CI checks pass, and commit history is linear and coherent.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
frontend/src/helpers/getProductErrorContent.ts |
Reads and normalizes product content. |
frontend/src/helpers/getProductErrorContent.test.ts |
Tests configuration normalization. |
frontend/src/components/common/ErrorPage/ErrorPage.tsx |
Applies generic error defaults. |
frontend/src/components/common/ErrorPage/ErrorPage.test.tsx |
Tests defaults and precedence. |
frontend/src/components/404/index.tsx |
Applies not-found defaults. |
frontend/src/components/404/index.test.tsx |
Tests not-found rendering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
646d186 to
534904d
Compare
Allow downstream products to customize error titles and graphics at build time. Preserve Headlamp defaults and explicit caller overrides. Co-authored-by: René Dudfield <renedudfield@microsoft.com>
534904d to
d9e6af3
Compare
Summary
not-found pages at build time.
ErrorPageprops higher priority than product defaults.Source
This upstreams retained patch 0048 from:
The retained patch records original source commit
54f6941bcd764cbe8230d802f2f0946e83222b4e, authored by Joaquim Rocha on2026-08-01. That source object is no longer available from Azure/aks-desktop,
so PR 823 is the only related Azure pull request that could be verified.
Improvements over the existing changes
before the product customization, making fallback regressions explicit.
so build-time env defaults are covered at their actual render call sites.
extra helper abstraction and helper-only test file.
ErrorComponentPropsTSDoc to describe product defaultsand Headlamp fallbacks accurately.
80% branch coverage.
These changes make the upstream version safer to review and maintain while
preserving the behavior of the retained downstream patch.
Testing
npm test -- --run src/components/404/index.test.tsx src/components/common/ErrorPage/ErrorPage.test.tsx --coverage --coverage.include=src/components/404/index.tsx --coverage.include=src/components/common/ErrorPage/ErrorPage.tsx --coverage.reporter=text --coverage.thresholds.branches=80ErrorPage.tsxnpm run tscnpm run buildThe existing Playwright test
404 page is presentine2e-tests/tests/headlamp.spec.tscovers this UI area. It was not run locallybecause it requires the deployed Kubernetes e2e environment and token.
Screenshots
Before: default Headlamp content
After: configured product content
The after capture uses representative product values for both the title and
graphic to show the two build-time configuration options together.
Assisted by copilot