Repository navigation
feat(ui-core,vue): DynamiaViewer resolves any descriptor, takes a client and renders plain descriptor objects - #247
Merged
Conversation
…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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #246.
Viewer.descriptorIdresolves throughclient.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 (onlyviewrequired;fieldsas names, partial fields or a record keyed by name, as in YAML).Viewerruns anydescriptorthrough it.DynamiaViewer: newclientprop (falls back to the injected one),sourceandvalueare passed and their changes applied, the viewer is rebuilt whendescriptor(by content),descriptorId,viewType,beanClassorclientchange, stale loads are discarded.Viewer.setSource.dashboard-vueViewerWidget: list values go to the viewer assource(setValueis a no-op on table views, so these widgets never showed rows).@dynamia-tools/vue.Tests: ui-core 166 (descriptor normalizer + Viewer resolution), vue 23 (7 component tests, new devDependencies
@vue/test-utilsandhappy-dom), dashboard-vue 16. Mutation-checked (descriptor-by-id, normalization, injected client,sourcewatch, widgetsource). 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