Files
summercms/admin/tests/fixtures/widgets.form-schema.json
Jakub Zych 126ca5b8ed feat(10-03): open, edit and save a record with toast and 422 feedback
- The SPA loads the backend::lang bundle before /auth/me, sets the
  document language from meta.locale and renders plural messages with
  Intl.PluralRules; interpolate mirrors phrasebook for :name/:Name/:NAME
- Create and record routes; mapWinterUrl maps recordUrl and redirects
  onto the controller's list, create and record routes only
- List rows open their record; FormView loads the form schema and the
  record, shows context-allowed fields in the span grid, saves values
  keyed by field name and toasts the resolved saved message
- A 422 puts each message under its field (aria-invalid,
  aria-describedby), shows the plural banner, focuses the first invalid
  field in schema order and clears a field's error on change
- The D-05 registry maps text, textarea, number and dropdown; any other
  type renders the unsupported-field box with the type in DM Mono
- The admin OpenAPI document declares the write request bodies
  (AdminRecord, AdminIDsRequest) and the list filter query as a
  deepObject, so the typed client can send them
- New backend::lang form.load_failed key; boardwalk/dist rebuilt
2026-09-27 16:43:47 +02:00

39 lines
1.4 KiB
JSON

{
"data": {
"name": "Widget",
"fields": [
{ "name": "name", "label": "Name", "type": "text", "span": "left", "required": true },
{ "name": "code", "label": "Code", "type": "text", "span": "right", "comment": "Unique widget code" },
{
"name": "size",
"label": "Size",
"type": "dropdown",
"span": "left",
"emptyOption": "— none —",
"options": [
{ "value": "s", "label": "Small" },
{ "value": "m", "label": "Medium" },
{ "value": "l", "label": "Large" }
]
},
{ "name": "weight", "label": "Weight", "type": "number", "span": "right" },
{ "name": "notes", "label": "Notes", "type": "textarea", "span": "full", "size": "small" },
{ "name": "color", "label": "Colour", "type": "colorpicker", "span": "left" }
],
"messages": {
"create": { "other": "New widget" },
"update": { "other": "Editing widget" },
"saved": { "other": "Widget „:name” saved" },
"deleteConfirm": { "other": "Delete this widget?" },
"deleted": { "other": "Widget deleted" }
},
"meta": { "locale": "en" },
"redirects": {
"create": { "redirect": "acme/demo/widgets/update/:id", "redirectClose": "acme/demo/widgets" },
"update": { "redirect": "acme/demo/widgets", "redirectClose": "acme/demo/widgets" },
"default": "acme/demo/widgets"
}
},
"meta": { "locale": "en" }
}