Skip to content

Commit 5c6e5dd

Browse files
Bugfix/default civilunits length koq (backport #9071) [release/5.7.x] (#9072)
Co-authored-by: Alexandre.Gagnon <3418768+a-gagnon@users.noreply.github.com>
1 parent 02b22be commit 5c6e5dd

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@itwin/core-frontend",
5+
"comment": "Fix default KOQ -> QuantityType map value for CivilUnits.LENGTH",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@itwin/core-frontend"
10+
}

core/frontend/src/quantity-formatting/QuantityFormatter.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class QuantityTypeFormatsProvider implements FormatsProvider {
342342
["DefaultToolsUnits.VOLUME", QuantityType.Volume],
343343
["DefaultToolsUnits.LENGTH_COORDINATE", QuantityType.Coordinate],
344344
["CivilUnits.STATION", QuantityType.Stationing],
345-
["CivilUnits.LENGTH", QuantityType.LengthSurvey],
345+
["CivilUnits.LENGTH", QuantityType.LengthEngineering],
346346
["AecUnits.LENGTH", QuantityType.LengthEngineering]
347347
]);
348348

@@ -692,7 +692,7 @@ export class QuantityFormatter implements UnitsProvider {
692692
try {
693693
// force all cached data to be reinitialized
694694
await IModelApp.quantityFormatter.onInitialized();
695-
} catch(err) {
695+
} catch (err) {
696696
Logger.logWarning(`${FrontendLoggerCategory.Package}.quantityFormatter`, BentleyError.getErrorMessage(err), BentleyError.getErrorMetadata(err));
697697
Logger.logWarning(`${FrontendLoggerCategory.Package}.quantityFormatter`, "An exception occurred initializing the iModelApp.quantityFormatter with the given UnitsProvider. Defaulting back to the internal units provider.");
698698
// If there is a problem initializing with the given provider, default back to the internal provider
@@ -1128,13 +1128,13 @@ export class QuantityFormatter implements UnitsProvider {
11281128
return this._formatSpecsRegistry.get(name);
11291129
}
11301130

1131-
/**
1132-
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
1133-
* @beta
1134-
* @param name The key used to identify the formatter and parser spec
1135-
* @param persistenceUnitName The name of the persistence unit
1136-
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
1137-
*/
1131+
/**
1132+
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
1133+
* @beta
1134+
* @param name The key used to identify the formatter and parser spec
1135+
* @param persistenceUnitName The name of the persistence unit
1136+
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
1137+
*/
11381138
public async addFormattingSpecsToRegistry(name: string, persistenceUnitName: string, formatProps?: FormatProps): Promise<void> {
11391139
if (!formatProps) {
11401140
formatProps = await IModelApp.formatsProvider.getFormat(name);

0 commit comments

Comments
 (0)