Browse Source

Add page schemas and pages to model

Introduce page-type and page-descriptor JSON Schemas to describe UI pages (type enum: dataGrid, kanban, calendar). The PageDescriptor defines name, title, icon, type, entityName, order and a groupByProperty that is conditionally required when type is kanban. Update model.schema.json to add a pages array referencing the new page-descriptor schema so pages can be declared in the model.
pull/25039/head
Halil İbrahim Kalkan 3 weeks ago
parent
commit
ad4eecb5f8
  1. 49
      lowcode/schema/definitions/page-descriptor.schema.json
  2. 8
      lowcode/schema/definitions/page-type.schema.json
  3. 7
      lowcode/schema/model.schema.json

49
lowcode/schema/definitions/page-descriptor.schema.json

@ -0,0 +1,49 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "page-descriptor.schema.json",
"title": "PageDescriptor",
"description": "Describes a UI page bound to an entity",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Unique URL-safe identifier for the page",
"minLength": 1
},
"title": {
"type": "string",
"description": "Display title for the menu item and page header",
"minLength": 1
},
"icon": {
"type": "string",
"description": "FontAwesome icon class (e.g., 'fa-solid fa-users')"
},
"type": {
"$ref": "page-type.schema.json"
},
"entityName": {
"type": "string",
"description": "Full name of the root entity this page displays (e.g., 'Namespace.EntityName')",
"minLength": 1
},
"groupByProperty": {
"type": "string",
"description": "Property name to group entities by (required for kanban). Must reference an enum property.",
"minLength": 1
},
"order": {
"type": "integer",
"description": "Menu sort order (lower values appear first)",
"default": 0
}
},
"required": ["name", "title", "type", "entityName"],
"if": {
"properties": { "type": { "const": "kanban" } }
},
"then": {
"required": ["groupByProperty"]
},
"additionalProperties": false
}

8
lowcode/schema/definitions/page-type.schema.json

@ -0,0 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "page-type.schema.json",
"title": "PageType",
"description": "The type of page to render",
"type": "string",
"enum": ["dataGrid", "kanban", "calendar"]
}

7
lowcode/schema/model.schema.json

@ -29,6 +29,13 @@
"items": {
"$ref": "definitions/endpoint-descriptor.schema.json"
}
},
"pages": {
"type": "array",
"description": "List of UI pages that appear as menu items and define how entities are displayed",
"items": {
"$ref": "definitions/page-descriptor.schema.json"
}
}
},
"additionalProperties": false

Loading…
Cancel
Save