-
Notifications
You must be signed in to change notification settings - Fork 37
Add FormatManager API to @itwin/quantity-formatting-react #1416
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
base: master
Are you sure you want to change the base?
Conversation
…atManager from qty-fmt package
| } catch (error) { | ||
| // Query failed, return empty array | ||
| console.warn("Failed to query used KindOfQuantities from iModel:", error); | ||
| return []; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to hide the error? Generally, we shouldn't do that and instead let components decide what to do with the error - maybe ignore it, maybe show some warning to the user...
| /** | ||
| * Called when an iModel is opened. Sets up schema-based formats if enabled. | ||
| * @param iModel - The opened iModel connection. | ||
| * @param options - Optional configuration for schema format setup. | ||
| */ | ||
| public async onIModelOpen(iModel: IModelConnection, options?: OnIModelOpenOptions): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who's supposed to call it? The docs give an impression that it should happen automatically, but that doesn't seem to be the case.
| public async onIModelOpen(iModel: IModelConnection, options?: OnIModelOpenOptions): Promise<void> { | ||
| // Set up schema-based units and formats providers | ||
| const schemaFormatsProvider = new SchemaFormatsProvider(iModel.schemaContext, IModelApp.quantityFormatter.activeUnitSystem); | ||
| this.fallbackFormatsProvider = schemaFormatsProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it by design that FormarManager is compatible with only one iModel at a time?
Prerequisite for #1412