Skip to content

Unified metadata management entry & dynamic routing#1186

Merged
xuyushun441-sys merged 3 commits intomainfrom
copilot/unified-metadata-management
Apr 7, 2026
Merged

Unified metadata management entry & dynamic routing#1186
xuyushun441-sys merged 3 commits intomainfrom
copilot/unified-metadata-management

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Metadata admin UIs were hardcoded per-type — only object and app had management pages. Adding new types (dashboard, page, report, workflow, etc.) required duplicating routes, hub cards, and page components.

Registry-driven architecture

  • config/metadataTypeRegistry.ts — Single config array defining all metadata types. New type = one entry:
export const METADATA_TYPES: MetadataTypeConfig[] = [
  // Custom pages — link to existing routes
  { type: 'object', label: 'Object', pluralLabel: 'Object Manager',
    icon: 'database', hasCustomPage: true, customRoute: '/system/objects' },
  // Generic — auto-managed by MetadataManagerPage
  { type: 'dashboard', label: 'Dashboard', pluralLabel: 'Dashboards',
    icon: 'layout-dashboard', description: 'Manage dashboard layouts and widgets',
    columns: [{ key: 'name', label: 'Name' }, { key: 'label', label: 'Label' }] },
  // ...
];
  • MetadataManagerPage — Generic page at /system/metadata/:metadataType that resolves config from registry, fetches via MetadataService.getItems(type), renders searchable card grid with soft-delete

  • SystemHubPage — Now auto-generates metadata type cards from registry instead of a hardcoded array. Dashboards, Pages, Reports cards appear without any additional code

  • MetadataService — Added generic getItems(category), saveMetadataItem(category, name, data), deleteMetadataItem(category, name) alongside existing object/field-specific methods

Routing

Dynamic /system/metadata/:metadataType route added to all three route contexts (top-level SystemRoutes, app-scoped minimal, app-scoped full). All legacy routes (/system/objects, /system/apps, etc.) unchanged.

Tests

37 new tests across 4 files: registry validation, MetadataManagerPage (render, search, delete, unknown type), MetadataService generic methods, SystemHubPage registry integration. Full suite: 822 pass.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui-demo Ready Ready Preview, Comment Apr 7, 2026 1:54am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Apr 7, 2026 1:54am

Request Review

…, and dynamic routing

Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/8ec8d511-2e2b-4185-b2a5-feb9ceff4489

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
…nt type annotations

Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/8ec8d511-2e2b-4185-b2a5-feb9ceff4489

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unified metadata management entry and dynamic routing Unified metadata management entry & dynamic routing Apr 7, 2026
Copilot AI requested a review from xuyushun441-sys April 7, 2026 01:54
@xuyushun441-sys
Copy link
Copy Markdown
Contributor

@copilot 评估相关开发是否已经集成到 console ,用于管理平台的元数据

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 7, 2026

@copilot 评估相关开发是否已经集成到 console ,用于管理平台的元数据

是的,统一元数据管理已完整集成到 Console 中。以下是各集成点的状态:

✅ 已集成的组件:

  1. 元数据类型注册表 (config/metadataTypeRegistry.ts) — 定义了 5 种元数据类型(appobjectdashboardpagereport),新增类型只需添加一行配置。

  2. 通用元数据管理页面 (MetadataManagerPage) — 已在 App.tsx 中通过 3 个路由上下文注册了 /system/metadata/:metadataType 路由(第 304、399、494 行),覆盖了顶层 /system/*、应用内最小布局和应用内完整布局。

  3. SystemHubPage 注册表集成 — 已从注册表自动生成元数据类型卡片(Dashboards、Pages、Reports),类型计数通过 MetadataProvider 获取。

  4. MetadataService 通用方法getItems(category)saveMetadataItem(category, name, data)deleteMetadataItem(category, name) 已添加,底层使用 client.meta.getItems(type) / client.meta.saveItem(type, name, data) API。

  5. 旧路由保持不变/system/objects/system/apps 等原有路由完全兼容,无破坏性变更。

✅ 测试覆盖: 72 项相关测试全部通过(注册表 10 项、MetadataManagerPage 14 项、MetadataService 7 项、SystemHubPage 6 项)。完整套件 822 项测试无回归。

@xuyushun441-sys xuyushun441-sys marked this pull request as ready for review April 7, 2026 03:07
@xuyushun441-sys xuyushun441-sys merged commit 3fec1a7 into main Apr 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Architecture] Unified Metadata Management Entry & Dynamic Routing

2 participants