feat(cabana): settings entries that link to an admin controller
pact.SettingsItem gains an additive Controller field, the equivalent of a WinterCMS registerSettings 'url' => Backend::url(...) entry. A link entry declares no Model, Form or NewModel and needs no AdminFS; start-up fails when it combines Controller with a singleton form or a model, or names an unregistered controller. Settings codes stay one namespace. GET /settings lists a link entry with its controller only when the principal passes the item's permissions and may open the controller. Registry.Setting never returns a link entry, so the singleton settings endpoints answer 404 for its code. SettingsEntry carries controller, empty for singletons; the OpenAPI document, generated SPA types and settings fixture follow, and the pact and cabana READMEs and the settings docs describe the link.
This commit is contained in:
@@ -1875,6 +1875,10 @@
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"controller": {
|
||||
"description": "Controller is the admin controller a link entry opens; empty for a\nsingleton settings form.",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -1900,6 +1904,7 @@
|
||||
"required": [
|
||||
"category",
|
||||
"code",
|
||||
"controller",
|
||||
"description",
|
||||
"icon",
|
||||
"keywords",
|
||||
|
||||
5
admin/src/api/schema.d.ts
vendored
5
admin/src/api/schema.d.ts
vendored
@@ -4886,6 +4886,11 @@ export interface components {
|
||||
"cabana.SettingsEntry": {
|
||||
category: string;
|
||||
code: string;
|
||||
/**
|
||||
* @description Controller is the admin controller a link entry opens; empty for a
|
||||
* singleton settings form.
|
||||
*/
|
||||
controller: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
keywords: string[];
|
||||
|
||||
3
admin/tests/fixtures/settings.json
vendored
3
admin/tests/fixtures/settings.json
vendored
@@ -9,6 +9,7 @@
|
||||
"category": "System",
|
||||
"keywords": [],
|
||||
"model": "Acme\\Demo\\Models\\Settings",
|
||||
"controller": "",
|
||||
"order": 20
|
||||
},
|
||||
{
|
||||
@@ -19,6 +20,7 @@
|
||||
"category": "System",
|
||||
"keywords": [],
|
||||
"model": "Acme\\Demo\\Models\\MailSettings",
|
||||
"controller": "",
|
||||
"order": 10
|
||||
},
|
||||
{
|
||||
@@ -29,6 +31,7 @@
|
||||
"category": "Appearance",
|
||||
"keywords": [],
|
||||
"model": "Acme\\Demo\\Models\\Branding",
|
||||
"controller": "",
|
||||
"order": 5
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user