project-bifrost-platform/src/admin
Jonathan Hvid 3aaa21e6af feat(admin): /admin/[resource] dynamic route + POST dispatch
The production route every Backstage resource lives under. Resolves
the resource from the URL segment against the registry, gates on
user.role === 'fenja', and renders the AdminLayout shell with the
ResourceListView + (optionally) ResourceEditPanel.

POST dispatch keyed by _action:
- save: parses formdata per field.kind (multi-text/multi-select-async
  use getAll(), number coerces, others coerce to string), validates
  via validateForResource, then routes to ops.update(id) when
  ?edit=<id> is set or ops.create() when ?new=1. Redirects with
  ?msg=saved | ?msg=created. On failure, re-renders the panel with
  errors + the submitted values.
- delete: calls ops.delete(id), redirects with ?msg=deleted.
- <action.key>: looks up the action in resource.actions and runs its
  handler, redirects with ?msg=action_<key>.

404s when the resource key isn't in the registry — most keys won't
resolve until steps 8-10 land. A small .bs-flash banner above the
list surfaces the ?msg= text (or the error message after a failed
save).

Old /admin (?tab=...) continues to work alongside.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 16:15:17 +02:00
..
components feat(admin): ResourceEditPanel + field renderers (no autosave) 2026-05-12 16:10:39 +02:00
resources feat(admin): AdminLayout shell + empty resource registry 2026-05-12 16:00:57 +02:00
admin.css feat(admin): /admin/[resource] dynamic route + POST dispatch 2026-05-12 16:15:17 +02:00
resource-types.ts feat(admin): add Resource type definitions + form validator 2026-05-12 15:56:42 +02:00
validate.ts feat(admin): add Resource type definitions + form validator 2026-05-12 15:56:42 +02:00