Proposal: UI configuration #359
Draft
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.
This is just a starting point of a discussion and not necessarily fully thought-out yet.
The basic idea is that a schema (LinkML or otherwise) generally can't capture everything about how a tool to collect data adhering to that schema should look or behave. Obviously the schema can inform some sensible defaults (i.e. provide a dropdown menu when a value must be chosen from an enumeration) but it can't capture things like "suggest terms retrieved from this arbitrary endpoint". Or "this field should be omitted from the entry UI because it will be populated by a separate process" (see #337). For use cases like these that are common enough, it would be nice for data-harmonizer clients to not have to write a lot of custom code and instead simply provide some configuration.
The changes here represent a very basic sketch of what a UI configuration approach might look like. A data-harmonizer application (i.e.
web/index.js
) provides a UI configuration object to theDataHarmonizer
constructor (an application could even store this configuration in a standalone JSON file). TheDataHarmonizer
class is responsible for interpreting this configuration and applying the correct settings internally. The specific example implemented here is directing theDataHarmonizer
instance to use an OLS-based autocomplete for a particular field.It's not implemented in this proof-of-concept, but you could also imagine a UI config like:
I could also imagine non-field-specific configuration going outside of the "fields" key (e.g. #334):
Again, this is just a conversation starter. I'd be interested to know if this might address (or not) other cases.
cc: @ddooley