-
Notifications
You must be signed in to change notification settings - Fork 219
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
Add a FormatsProvider interface to ecschema-metadata #7811
Comments
Adding some details from our side regarding what we expect from the API. The primary thing we need for rendering formatted properties is
What we would like to have is some kind of unified API that returns us the two specs, taking into account everything:
Of course the above should be based on the active unit system. And we need some event that notifies us whenever the formats / parsers change, so we can request for updated specs. |
With both these classes in mind, I think the FormatsProvider should provide
Are you looking for something similar to
We'll definitely look into defining events that tools/ frontend applications can subscribe to. This does tie back to my point above with |
To update the quantity formatting of values displayed on a frontend app, currently you would have to override formats used within the QuantityFormatter in core-frontend. Then, tools and frontend components that use formats through the QuantityFormatter would be able to reflect the changed formats. However there are cases where some components might not use formats via QuantityFormatter.
From @grigasp:
@diegoalexdiaz on formats from schemas:
There may be a need for a FormatsProvider, just like a UnitsProvider, that let's users decide what type of formats to use, and allow a way to replace formats used during runtime, separate from what's currently done in QuantityFormatter with format overrides.
One goal this interface would achieve, is that formats loaded from a FormatsProvider would be independent from format overrides, hence should not be affected when clearing format overrides
TBD on methods to expose in this new interface
The text was updated successfully, but these errors were encountered: