Skip to content

feat(ui-core,vue): DynamiaViewer resolves any descriptor, takes a client and renders plain descriptor objects - #247

Merged
marioserrano09 merged 1 commit into
nextfrom
feature/246-viewer-descriptor-sources
Oct 13, 2026
Merged

marioserrano09 merged 1 commit into
nextfrom
feature/246-viewer-descriptor-sources

Conversation

@marioserrano09

Copy link
Copy Markdown
Contributor

Closes #246.

  • Viewer.descriptorId resolves through client.metadata.getView(id) (/apps/api/metadata/views/{id}): any descriptor, entity-bound or not. Falls back to the entity descriptors, still fails with "not found".
  • normalizeViewDescriptor / defineViewDescriptor (ui-core): a hand-written object with the shape of a descriptor is completed with defaults (only view required; fields as names, partial fields or a record keyed by name, as in YAML). Viewer runs any descriptor through it.
  • DynamiaViewer: new client prop (falls back to the injected one), source and value are passed and their changes applied, the viewer is rebuilt when descriptor (by content), descriptorId, viewType, beanClass or client change, stale loads are discarded.
  • Viewer.setSource.
  • dashboard-vue ViewerWidget: list values go to the viewer as source (setValue is a no-op on table views, so these widgets never showed rows).
  • README of @dynamia-tools/vue.

Tests: ui-core 166 (descriptor normalizer + Viewer resolution), vue 23 (7 component tests, new devDependencies @vue/test-utils and happy-dom), dashboard-vue 16. Mutation-checked (descriptor-by-id, normalization, injected client, source watch, widget source). Builds of the three packages OK.

Based on next; independent of #245 (both touch different files).

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDh8QvbJA9soPiZXVjuYph

…r, takes a client and renders plain descriptor objects

- Viewer.descriptorId resolves through GET /apps/api/metadata/views/{id} (any descriptor, entity-bound or not) and falls back to the entity descriptors.
- Viewer accepts a hand-written descriptor object (normalizeViewDescriptor / defineViewDescriptor): only `view` is required, fields as names, partial fields or a record keyed by name.
- DynamiaViewer: new `client` prop (falls back to the one provided to DynamiaVue); `source` and `value` are passed to the view and their changes applied; the viewer is rebuilt when descriptor (by content), descriptorId, viewType, beanClass or client change; stale loads are discarded.
- Viewer.setSource added.
- dashboard-vue ViewerWidget gives list values to the viewer as `source` (setValue is a no-op on table views).

Refs #246

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GDh8QvbJA9soPiZXVjuYph
@marioserrano09
marioserrano09 merged commit 66dd684 into next Oct 13, 2026
1 check 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.

1 participant