- pact.FormVirtualFields lists form fields that are not model columns: never bound, filled or projected; their values reach the Form hooks through cabana.VirtualFieldsFromContext when the field's context allows the operation - type: password is a masked field that must be listed as virtual - pact.FormRules supplies the rule set per operation and replaces the model's Rules() for admin saves; a rule on a virtual field sees the submitted value - preset on a text field follows another text field on the create form - SPA: PasswordField, preset handling in FormView, empty password left out of an update - README, docs, OpenAPI document, TS types and dist updated
34 lines
1.6 KiB
JSON
34 lines
1.6 KiB
JSON
{
|
|
"data": {
|
|
"name": "Person",
|
|
"modelClass": "Person",
|
|
"fields": [
|
|
{ "name": "name", "type": "text", "label": "Name", "span": "left" },
|
|
{ "name": "email", "type": "text", "label": "Email", "span": "right" },
|
|
{ "name": "slug", "type": "text", "label": "Slug", "preset": { "field": "name", "type": "slug" } },
|
|
{ "name": "password", "type": "password", "label": "Password", "span": "left", "context": ["create", "update"] },
|
|
{ "name": "password_confirmation", "type": "password", "label": "Repeat the password", "span": "right", "context": ["create", "update"] },
|
|
{ "name": "notify", "type": "checkbox", "label": "Send a welcome message", "default": true, "context": "create" },
|
|
{ "name": "joined_ip", "type": "text", "label": "Joined from IP address", "context": "preview" }
|
|
],
|
|
"preview": { "headerPartial": "status" },
|
|
"messages": {
|
|
"create": { "other": "Person" },
|
|
"update": { "other": "Edit record" },
|
|
"saved": { "other": "Saved" },
|
|
"deleteConfirm": { "other": "Delete this record?" },
|
|
"deleted": { "other": "Record deleted" },
|
|
"preview": { "other": "Person details" },
|
|
"edit": { "other": "Edit person" }
|
|
},
|
|
"redirects": {
|
|
"default": "acme/roster/people",
|
|
"create": { "redirect": "acme/roster/people/preview/:id", "redirectClose": "acme/roster/people" },
|
|
"update": { "redirect": "acme/roster/people", "redirectClose": "acme/roster/people/preview/:id" }
|
|
},
|
|
"meta": { "locale": "en" },
|
|
"assets": { "scripts": [], "styles": [] }
|
|
},
|
|
"meta": { "locale": "en" }
|
|
}
|