From ad4eecb5f89a1bd75cd112715d525ea4f6ad7b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Sat, 7 Mar 2026 22:37:37 +0300 Subject: [PATCH] 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. --- .../definitions/page-descriptor.schema.json | 49 +++++++++++++++++++ .../schema/definitions/page-type.schema.json | 8 +++ lowcode/schema/model.schema.json | 7 +++ 3 files changed, 64 insertions(+) create mode 100644 lowcode/schema/definitions/page-descriptor.schema.json create mode 100644 lowcode/schema/definitions/page-type.schema.json diff --git a/lowcode/schema/definitions/page-descriptor.schema.json b/lowcode/schema/definitions/page-descriptor.schema.json new file mode 100644 index 0000000000..952fafdb47 --- /dev/null +++ b/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 +} diff --git a/lowcode/schema/definitions/page-type.schema.json b/lowcode/schema/definitions/page-type.schema.json new file mode 100644 index 0000000000..f26132b189 --- /dev/null +++ b/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"] +} diff --git a/lowcode/schema/model.schema.json b/lowcode/schema/model.schema.json index c958f126fe..c328002d37 100644 --- a/lowcode/schema/model.schema.json +++ b/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