Add ObjectQL 1.9.1 integration with ObjectTable and ObjectForm components#87
Add ObjectQL 1.9.1 integration with ObjectTable and ObjectForm components#87huangyiirene merged 15 commits intomainfrom
Conversation
…ble and ObjectForm components Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
为相关组件添加showcase |
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Added comprehensive showcase pages for ObjectTable and ObjectForm components in commit 0f3fd52. What was added:
Each showcase page includes:
You can view the showcases by running: pnpm dev:showcaseThen navigate to the "ObjectQL" section in the sidebar menu. |
|
@copilot 两个软件包的区别是什么?data-object, data-objectql |
两个软件包的区别:
关系: 简单说:
|
|
我们其他的组件包名plugin开头,重新评估一下这个软件包的名称以后,所有对象相关的组件在这里开发合适吗?@copliot |
包名评估和建议: 查看了现有的 plugin 包(plugin-charts、plugin-kanban、plugin-editor、plugin-markdown),我认为应该重命名: 建议改名:
理由:
不需要改名:
架构清晰度: 是否需要我重命名
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new plugin package (@object-ui/plugin-object) that provides ObjectQL-specific UI components for automatic table and form generation based on ObjectQL object schemas. The plugin follows Object UI's schema-first architecture and integrates seamlessly with the ObjectQL backend through the MetadataApiClient.
Changes:
- Added
@object-ui/plugin-objectpackage withObjectTableandObjectFormcomponents that auto-generate UI from ObjectQL metadata - Enhanced
ObjectQLDataSourcewith schema fetching capability via MetadataApiClient - Updated ObjectQL dependencies to version 1.9.1 across affected packages
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/types/src/objectql.ts | New type definitions for ObjectQL components (ObjectTableSchema, ObjectFormSchema) |
| packages/types/src/index.ts | Exports new ObjectQL types and adds them to AnySchema union |
| packages/plugin-object/* | New plugin package with ObjectTable and ObjectForm components, configuration files, and documentation |
| packages/data-objectql/src/ObjectQLDataSource.ts | Added MetadataApiClient and getObjectSchema() method |
| packages/data-objectql/package.json | Updated ObjectQL SDK dependencies to 1.9.1 |
| examples/showcase/pages/objectql/* | Showcase pages demonstrating ObjectTable and ObjectForm usage |
| examples/showcase/app.json | Added ObjectQL section to showcase navigation menu |
| CHANGELOG.md | Documented changes in unreleased section |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
packages/plugin-object/README.md
Outdated
| ### ObjectTable | ||
|
|
||
| ```tsx | ||
| import { ObjectTable } from '@object-ui/data-object'; |
There was a problem hiding this comment.
Incorrect import path. The package name should be '@object-ui/plugin-object', not '@object-ui/data-object'.
packages/plugin-object/README.md
Outdated
| ### ObjectForm | ||
|
|
||
| ```tsx | ||
| import { ObjectForm } from '@object-ui/data-object'; |
There was a problem hiding this comment.
Incorrect import path. The package name should be '@object-ui/plugin-object', not '@object-ui/data-object'.
| }; | ||
|
|
||
| /** | ||
| * Map ObjectQL field type to form field type |
There was a problem hiding this comment.
This helper function lacks JSDoc documentation. Add documentation explaining the mapping logic and its parameters.
| * Map ObjectQL field type to form field type | |
| * Maps an ObjectQL field type to the corresponding form field component type. | |
| * | |
| * This helper provides the translation layer between backend/ObjectQL field | |
| * definitions (e.g. `text`, `date`, `lookup`) and the generic form field | |
| * types understood by the schema renderer (e.g. `input`, `date-picker`, | |
| * `select`). If a field type is not explicitly mapped, the function falls | |
| * back to the generic `"input"` type. | |
| * | |
| * @param fieldType - The ObjectQL field type identifier to convert | |
| * (for example: `"text"`, `"number"`, `"date"`, `"lookup"`). | |
| * @returns The normalized form field type string used in the form schema | |
| * (for example: `"input"`, `"textarea"`, `"date-picker"`, `"select"`). |
packages/types/src/objectql.ts
Outdated
| * Form layout | ||
| * @default 'vertical' | ||
| */ | ||
| layout?: 'vertical' | 'horizontal' | 'inline' | 'grid'; | ||
|
|
||
| /** | ||
| * Grid columns (for grid layout) |
There was a problem hiding this comment.
The documentation refers to 'grid layout', but in ObjectForm.tsx lines 217-219, 'grid' layout is mapped to 'vertical' because FormSchema doesn't support 'grid'. This inconsistency should be documented or the type definition should clarify supported layouts.
| * Form layout | |
| * @default 'vertical' | |
| */ | |
| layout?: 'vertical' | 'horizontal' | 'inline' | 'grid'; | |
| /** | |
| * Grid columns (for grid layout) | |
| * Form layout. | |
| * | |
| * Supported layouts: | |
| * - `vertical` – label above field (default) | |
| * - `horizontal` – label and field in a row | |
| * - `inline` – compact inline layout, typically used in toolbars | |
| * - `grid` – **experimental** grid layout | |
| * | |
| * Note: As of the current implementation, the underlying form renderer does not yet | |
| * support a native `grid` layout and will internally treat `layout: "grid"` as | |
| * `layout: "vertical"`. This value is exposed in the schema for forward compatibility, | |
| * and behavior may change once grid support is implemented. | |
| * | |
| * @default 'vertical' | |
| */ | |
| layout?: 'vertical' | 'horizontal' | 'inline' | 'grid'; | |
| /** | |
| * Grid columns (for grid layout). | |
| * | |
| * Intended number of columns when using a `grid` layout. Current renderers that do | |
| * not implement true grid support may ignore this value and fall back to a vertical | |
| * layout. When grid layout is supported, this value should control how many form | |
| * fields are placed per row. | |
| * |
📦 Bundle Size Report
Size Limits
|
|
@copilot fix all and test |
…t documentation Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Fixed all code review issues in commit ce1079b:
All changes have been built and tested successfully. The package builds without errors. |
📦 Bundle Size Report
Size Limits
|
Added missing color default value (#8884d8) to: - defaultProps object (required by test) - input definition defaultValue (for consistency) This fixes the failing test in packages/plugin-charts/src/index.test.ts that expected color to be '#8884d8' in defaultProps. Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
📦 Bundle Size Report
Size Limits
|
|
✅ All checks passed!
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ue-another-one
📦 Bundle Size Report
Size Limits
|
| // Resolve the actual project root and schema file | ||
| let projectRoot = cwd; | ||
| let targetSchemaPath = schemaPath; | ||
| let _projectRoot = cwd; |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
| if (existsSync(potentialPagesDir)) { | ||
| console.log(chalk.blue(`📂 Detected project structure at ${fileDir}`)); | ||
| projectRoot = fileDir; | ||
| _projectRoot = fileDir; |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
| let projectRoot = cwd; | ||
| let targetSchemaPath = schemaPath; | ||
| let _projectRoot = cwd; | ||
| const targetSchemaPath = schemaPath; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
|
✅ All checks passed!
|
Task: Update ObjectQL and Create Object Components Package
✅ All Tasks Completed Successfully!
Updates Made:
@object-ui/data-objectto@object-ui/plugin-objectmapFieldTypeToFormTypehelper functionCode Review Fixes:
gridlayout is experimental and currently falls back toverticallayoutPackage Naming:
Following the established pattern where UI component packages use the
plugin-prefix:@object-ui/plugin-object- ObjectQL UI components plugin (ObjectTable, ObjectForm)@object-ui/data-objectql- ObjectQL data adapter (unchanged)Architecture:
All issues identified in code review have been addressed and the package builds successfully.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.