Generalize WizardEditor interface to its input components #322
Labels
No labels
bug
config
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
orinoco/shacl-vue#322
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
WizardEditorwas introduced indatalink/shacl-vue@3c091c324f. Based on config, it will render any number of inputs of various kinds, while it registers a single model value (in the VueJS sense) for each of them. In other words: there will be anx_valuefor inputx, ay_valueforinput_y, and so forth, irrespective of the complexity hidden behind the input itself. This is a useful feature because we want to be able to refer to these values directly inside the wizard's TTL template.However, not all inputs will necessarily have this simplistic value mapping. For example, a file uploader is seen as a single input in the context of a wizard, yet the current file uploader (
GitAnnexUploader) will generate multiple output values on successful file upload (e.g. file size, annex key, content hash, download url, and more). This should receive a generalizable pattern for mapping outputs to a single value. The easy approach is just to wrap everything in an object. Then we would refer to sub-values inside the TTL template using dot notation and/or square brackets, e.g.{file_upload.annex_key}.Another important point is that there should be a common API with which these inputs emit their model values upwards, such that the
WizardEditorcan instantiate and use them uniformly, withv-model. There is already a standard VueJS way of achieving this: by addingmodelValueas a component prop and letting the component emit updates to it viaemit('update:modelValue', <some-value>).Finally, it could be useful to have a utility functionality that maps input
types to associated components and renders them automatically, instead of the currentif-else-if-else-if-else...statement. This functionality would be pretty much identical to the current matching approach used by standard shacl-vue property shape editor.GitAnnexUploader#323