Skip to content

✨ Add ErrorPage layout component#20

Merged
damienlagae merged 2 commits into
mainfrom
feat/error-page-component
May 28, 2026
Merged

✨ Add ErrorPage layout component#20
damienlagae merged 2 commits into
mainfrom
feat/error-page-component

Conversation

@damienlagae
Copy link
Copy Markdown
Member

@damienlagae damienlagae commented May 28, 2026

Summary

API

Required: `statusCode`, `title`, `message`. Optional: `details`, `backUrl`, `backLabel`, `symbol`, `logo`, `locale`, `appName`, `stylesheet`.

Test plan

  • PHPUnit: 205/205 (10 new tests covering defaults, custom params, missing required options, invalid types, additional attributes preserved)
  • php-cs-fixer: clean
  • phpstan: no errors
  • Manual smoke test in a consumer app (Impala) before tagging a release

Closes #18.

Closes #18.

Replaces the abandoned @EnabelLayout/error/base.html.twig from
enabel/layout-bundle. Renders a self-contained <!DOCTYPE html> page
(no base.html.twig extension) and emits the markup expected by
@enabel/enabel-bootstrap-theme/dist/css/error.min.css.

Introduces the Layout/ component namespace.
@damienlagae
Copy link
Copy Markdown
Member Author

Smoke-tested in Impala (consumer app) — symlinked the branch via composer path repo, no patches needed.

What I verified

  • Component renders standalone (no base.html.twig extension), <title> and <html lang> interpolate cleanly
  • Default symbol / logo paths (/images/enabel-symbol.png, /images/enabel-logo-email.png) line up with what Impala ships, no override required
  • stylesheet default resolves through Asset Mapper to the hashed error.min-*.css
  • Prop binding with :statusCode (int) and :details (nullable) works through the PreMount resolver
  • Rendered 404, 403 and 500 variants

One suggestion for the docs
On 5xx pages the convention is no back-home button (the server is broken, the link is misleading) — the consumer just passes backUrl: null. Works perfectly with the current template, but a one-liner in docs/Layout/errorPage.md would save the next consumer a round-trip:

On 5xx pages, leave backUrl unset — the trace ID then sits on its own line under the message instead of inline next to the button.

LGTM otherwise, ready to tag.

@damienlagae
Copy link
Copy Markdown
Member Author

Doc updated in 68a038e — 5xx convention added as a tip block right after the generic error template example.

@damienlagae damienlagae merged commit 621308f into main May 28, 2026
7 checks passed
@damienlagae damienlagae deleted the feat/error-page-component branch May 28, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an ErrorPage component (replace abandoned enabel/layout-bundle error base)

1 participant