Files
summercms/admin/tests/fixtures/widgets.form-schema.json
Jakub Zych f4e97cccad feat(10-04): search, link and unlink related records through the relation manager
- relation-manager registered in the field registry; renders only on an
  existing record, never on create, and is never part of the save body
- RelationManager: relation schema label and comment, debounced search,
  selectable linked list (DataTable relation variant), toolbar buttons in
  declared order, confirmed unlink with plural messages and toasts
- RelationPickerModal: Reka Dialog (aria-modal, focus trap, Esc) over the
  candidates endpoint five per page, selection kept across pages, Dodaj (N)
  POSTs link, focus returns to the opener
- admin OpenAPI documents search, sort, dir, page and per_page on the linked
  and candidate relation routes so the SPA sends them typed
- neutral acme.demo.widgets members fixtures and relation smoke tests
2026-09-27 17:18:14 +02:00

162 lines
3.3 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"
},
{
"name": "active",
"label": "Active",
"type": "switch",
"span": "left",
"comment": "Shown in the catalogue"
},
{
"name": "featured",
"label": "Featured",
"type": "checkbox",
"span": "right",
"comment": "Pinned to the top"
},
{
"name": "maker",
"label": "Maker",
"type": "relation",
"span": "left",
"nameFrom": "name",
"emptyOption": "— none —"
},
{
"name": "tags",
"label": "Tags",
"type": "relation",
"span": "right",
"nameFrom": "name",
"multiple": true,
"required": true
},
{
"name": "owner",
"label": "Owner",
"type": "relation",
"span": "left",
"nameFrom": "email",
"emptyOption": "Current user",
"readOnly": true
},
{
"name": "serial",
"label": "Serial",
"type": "text",
"span": "left",
"tab": "Details",
"context": "update"
},
{
"name": "batch",
"label": "Batch",
"type": "text",
"span": "right",
"tab": "Details",
"context": [
"create"
]
},
{
"name": "members",
"type": "relation-manager",
"relation": "members",
"span": "full",
"tab": "Members",
"comment": "People who may edit this widget"
}
],
"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"
}
}