discourse/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-schema.js
Osama Sayegh 9329a5395a
FEATURE: Groundwork for schema theme settings UI (#25673)
This commit is the first of a series of commits that will allow themes to define complex settings types by declaring a schema of the setting structure that Discourse core will use to build a UI for the setting automatically. We implement the navigation logic and support for multiple levels of nesting in this commit and we'll continue building this new system gradually in future commits.

Internal topic: t/116870.
2024-02-16 09:31:49 +03:00

83 lines
1.6 KiB
JavaScript

import Controller from "@ember/controller";
export default class AdminCustomizeThemesSchemaController extends Controller {
data = [
{
name: "item 1",
children: [
{
name: "child 1-1",
grandchildren: [
{
name: "grandchild 1-1-1",
},
],
},
{
name: "child 1-2",
grandchildren: [
{
name: "grandchild 1-2-1",
},
],
},
],
},
{
name: "item 2",
children: [
{
name: "child 2-1",
grandchildren: [
{
name: "grandchild 2-1-1",
},
],
},
{
name: "child 2-2",
grandchildren: [
{
name: "grandchild 2-2-1",
},
],
},
],
},
];
schema = {
name: "item",
identifier: "name",
properties: {
name: {
type: "string",
},
children: {
type: "objects",
schema: {
name: "child",
identifier: "name",
properties: {
name: {
type: "string",
},
grandchildren: {
type: "objects",
schema: {
name: "grandchild",
identifier: "name",
properties: {
name: {
type: "string",
},
},
},
},
},
},
},
},
};
}