mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 02:23:42 +08:00
9329a5395a
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.
83 lines
1.6 KiB
JavaScript
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",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|