feat(12.1-02): writable foreign keys, locked relation options, invisible columns
- FieldRelationContract.WritableForeignKey makes a belongsTo field over a protected foreign key writable; the protected key list is unchanged - cabana.RelationLockProvider names related ids an administrator may not add or remove: options and labels carry locked, and a create or update that changes the locked subset is 403 before any row is written - columns.yaml invisible keeps a column searchable and out of the rows - a controller implementing pact.FilterOptions serves a scope filter's choices before the model - SPA: locked chips and options in RelationField, DataTable skips invisible columns - README, docs, OpenAPI document, TS types and dist updated
This commit is contained in:
@@ -123,6 +123,7 @@ func (p *Plugin) Schedule() []pact.ScheduledCommand {
|
||||
| `pact.FormVirtualFields` | Optional controller list of form fields that are not model columns for the form (a password and its confirmation, for example): never bound, filled or returned; their submitted values reach the Form hooks through the admin framework's context accessor. |
|
||||
| `pact.FormRules` | Optional controller hook returning the validation rules of an admin save for `create` or `update`; the set replaces the model's `Rules()` for those saves and may name virtual fields. |
|
||||
| `pact.FilterScope` | Model scopes a list filter may call, limited to an exact allow list. |
|
||||
| `pact.FilterOptions` | Serves the choices of a scope filter. The admin controller may implement it and is asked first, so choices can be read from the database; otherwise the model is asked. |
|
||||
| `pact.RelationBeforeLink` | Optional controller hook that checks or fills pivot columns before a relation link is written. |
|
||||
| `pact.RelationBeforeCreate` | Optional controller hook run in the write transaction before a relation manager creates a related record. |
|
||||
| `pact.RelationAfterCreate` | Optional controller hook run after a relation manager creates a related record, before the commit. |
|
||||
|
||||
@@ -583,8 +583,11 @@ type FilterScope interface {
|
||||
}
|
||||
|
||||
// FilterOptions serves the choices of a model-backed config_filter scope
|
||||
// (D-27). It is implemented by the same model as FilterScope and receives the
|
||||
// filter's scope method name; labels may be phrase keys.
|
||||
// (D-27). It receives the filter's scope method name; labels may be phrase
|
||||
// keys. The admin controller may implement it and is asked first, so choices
|
||||
// that are read from the database can use the handle the controller holds;
|
||||
// otherwise the model that implements FilterScope is asked. The scope itself
|
||||
// is always the model's FilterScope.
|
||||
type FilterOptions interface {
|
||||
FilterOptions(scope string) []Option
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user