-
Notifications
You must be signed in to change notification settings - Fork 1
feat: enhance List and Form View protocols with detailed configuration schemas #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b982da1
Initial plan
Copilot a6f7654
feat: enhance List View and Form View protocols with detailed configu…
Copilot c9bd09e
refactor: add validation constraints to numeric fields
Copilot f0272e6
Merge branch 'main' into copilot/enhance-list-form-protocols
hotlong 84a6427
fix: add missing ViewDataSchema and validation tests
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| title: HttpMethod | ||
| description: HttpMethod Schema Reference | ||
| --- | ||
|
|
||
| ## Allowed Values | ||
|
|
||
| * `GET` | ||
| * `POST` | ||
| * `PUT` | ||
| * `PATCH` | ||
| * `DELETE` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| title: FormField | ||
| description: FormField Schema Reference | ||
| --- | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **field** | `string` | ✅ | Field name (snake_case) | | ||
| | **label** | `string` | optional | Display label override | | ||
| | **placeholder** | `string` | optional | Placeholder text | | ||
| | **helpText** | `string` | optional | Help/hint text | | ||
| | **readonly** | `boolean` | optional | Read-only override | | ||
| | **required** | `boolean` | optional | Required override | | ||
| | **hidden** | `boolean` | optional | Hidden override | | ||
| | **colSpan** | `integer` | optional | Column span in grid layout (1-4) | | ||
| | **widget** | `string` | optional | Custom widget/component name | | ||
| | **dependsOn** | `string` | optional | Parent field name for cascading | | ||
| | **visibleOn** | `string` | optional | Visibility condition expression | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| title: HttpRequest | ||
| description: HttpRequest Schema Reference | ||
| --- | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **url** | `string` | ✅ | API endpoint URL | | ||
| | **method** | `Enum<'GET' \| 'POST' \| 'PUT' \| 'PATCH' \| 'DELETE'>` | optional | HTTP method | | ||
| | **headers** | `Record<string, string>` | optional | Custom HTTP headers | | ||
| | **params** | `Record<string, any>` | optional | Query parameters | | ||
| | **body** | `any` | optional | Request body for POST/PUT/PATCH | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| title: ListColumn | ||
| description: ListColumn Schema Reference | ||
| --- | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **field** | `string` | ✅ | Field name (snake_case) | | ||
| | **label** | `string` | optional | Display label override | | ||
| | **width** | `number` | optional | Column width in pixels | | ||
| | **align** | `Enum<'left' \| 'center' \| 'right'>` | optional | Text alignment | | ||
| | **hidden** | `boolean` | optional | Hide column by default | | ||
| | **sortable** | `boolean` | optional | Allow sorting by this column | | ||
| | **resizable** | `boolean` | optional | Allow resizing this column | | ||
| | **wrap** | `boolean` | optional | Allow text wrapping | | ||
| | **type** | `string` | optional | Renderer type override (e.g., "currency", "date") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| title: PaginationConfig | ||
| description: PaginationConfig Schema Reference | ||
| --- | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **pageSize** | `integer` | optional | Number of records per page | | ||
| | **pageSizeOptions** | `integer[]` | optional | Available page size options | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| title: SelectionConfig | ||
| description: SelectionConfig Schema Reference | ||
| --- | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **type** | `Enum<'none' \| 'single' \| 'multiple'>` | optional | Selection mode | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| title: ViewData | ||
| description: ViewData Schema Reference | ||
| --- | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| { | ||
| "$ref": "#/definitions/FormField", | ||
| "definitions": { | ||
| "FormField": { | ||
| "type": "object", | ||
| "properties": { | ||
| "field": { | ||
| "type": "string", | ||
| "description": "Field name (snake_case)" | ||
| }, | ||
| "label": { | ||
| "type": "string", | ||
| "description": "Display label override" | ||
| }, | ||
| "placeholder": { | ||
| "type": "string", | ||
| "description": "Placeholder text" | ||
| }, | ||
| "helpText": { | ||
| "type": "string", | ||
| "description": "Help/hint text" | ||
| }, | ||
| "readonly": { | ||
| "type": "boolean", | ||
| "description": "Read-only override" | ||
| }, | ||
| "required": { | ||
| "type": "boolean", | ||
| "description": "Required override" | ||
| }, | ||
| "hidden": { | ||
| "type": "boolean", | ||
| "description": "Hidden override" | ||
| }, | ||
| "colSpan": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 4, | ||
| "description": "Column span in grid layout (1-4)" | ||
| }, | ||
| "widget": { | ||
| "type": "string", | ||
| "description": "Custom widget/component name" | ||
| }, | ||
| "dependsOn": { | ||
| "type": "string", | ||
| "description": "Parent field name for cascading" | ||
| }, | ||
| "visibleOn": { | ||
| "type": "string", | ||
| "description": "Visibility condition expression" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "field" | ||
| ], | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "$schema": "http://json-schema.org/draft-07/schema#" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation error: The type for the 'fields' property is listed as "string | object[]" but should be "(string | object)[]" to correctly represent an array that can contain either strings or objects. The schema definition in view.zod.ts line 132-135 uses z.array(z.union([z.string(), FormFieldSchema])), which means an array of mixed string/object items, not a union of a string or an array of objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 84a6427. Changed from
string | object[]to(string | object)[]to correctly represent an array of mixed string/object items.