Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements basic factory pattern for matching editor components #26

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

jsheunis
Copy link
Collaborator

@jsheunis jsheunis commented Jun 19, 2024

This introduces the 'editors.js' module which dynamically imports all vue components available in '../components/' and matching the '*Editor.vue' pattern, and then puts all of their individual shape matching functions into a single object which is provided to the necessary app components via provide/inject. This allows the PropertyShapeEditor component to loop through all component matching code and run them against any property shape, and the let the application render the matched component (or a default component in case no matches are found).

This commit also sets up the design that allows any new arbitrary components to be added to '../components/' and to be immediately available as part of the factory, provided that they include their own matching code and use the same design as existing components.

Lastly, the docstring in editors.js is also the first JSdoc-based documentation in the code. Future commits should start adding more similar docstrings for modules and functions.

Closes #5

This introduces the 'editors.js' module which dynamically imports all
vue components available in '../components/' and matching the
'*Editor.vue' pattern, and then puts all of their individual
shape matching functions into a single object which is provided to the
necessary app components via provide/inject. This allows the
PropertyShapeEditor component to loop through all component matching code
and run them against any property shape, and the let the application render
the matched component (or a default component in case no matches are found).

This commit also sets up the design that allows any new arbitrary components
to be added to '../components/' and to be immediately available as part of
the factory, provided that they include their own matching code and use the
same design as existing components.
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.

Implement component factory for data viewing and entering
1 participant