Skip to content

Commit 96e8260

Browse files
committed
Merge branch 'WilM/fix-measure-context-toolbar' of https://github.com/iTwin/viewer-components-react into WilM/fix-measure-context-toolbar
2 parents 108e6eb + 8429bd0 commit 96e8260

23 files changed

+387
-209
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484

8585
- run: pnpm install
8686

87+
- name: Run prettier
88+
run: pnpm prettier
89+
8790
- run: pnpm exec lage lint extract-api cover --grouped
8891
name: Build Lint Test and check API changes
8992
env:

.prettierignore

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,38 @@ change
33
lib
44
dist
55

6-
# Ignore auto-generated files
7-
CHANGELOG.md
8-
CHANGELOG.json
9-
106
# Ignore vscode settings
117
.vscode
128

13-
# Ignore pnpm files
14-
pnpm-lock.yaml
15-
pnpm-workspace.yaml
16-
179
# Ignore configs and pipelines
1810
.pipelines
1911
.github
2012

13+
# Ignore archived packages
14+
packages/archive
15+
16+
# Ignore everything under packages/itwin/
17+
packages/itwin/**
18+
19+
# Except for the following directories
20+
!packages/itwin/tree-widget/
21+
!packages/itwin/tree-widget/**
22+
!packages/itwin/test-utilities/
23+
!packages/itwin/test-utilities/**
24+
!packages/itwin/property-grid/
25+
!packages/itwin/property-grid/**
26+
27+
# Ignore README files due to extractions
28+
packages/itwin/tree-widget/README.md
29+
packages/itwin/property-grid/README.md
30+
2131
# Ignore extracted api definitions
22-
./packages/itwin/**/api
32+
packages/itwin/**/api
33+
34+
# Ignore auto-generated files
35+
CHANGELOG.md
36+
CHANGELOG.json
37+
38+
# Ignore pnpm files
39+
pnpm-lock.yaml
40+
pnpm-workspace.yaml

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Each one has it's own folder and README describing the package.
1010

1111
### iTwin.js@^5 Compatible
1212

13-
| Name | Folder | Changelog | Version |
14-
| ------------------------- | --------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
15-
| @itwin/map-layers | [map-layers](./packages/itwin/map-layers/) | [changelog](./packages/itwin/map-layers/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40itwin%2Fmap-layers.svg)](https://badge.fury.io/js/%40itwin%2Fmap-layers) |
13+
| Name | Folder | Changelog | Version |
14+
| ----------------- | ------------------------------------------ | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
15+
| @itwin/map-layers | [map-layers](./packages/itwin/map-layers/) | [changelog](./packages/itwin/map-layers/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40itwin%2Fmap-layers.svg)](https://badge.fury.io/js/%40itwin%2Fmap-layers) |
1616

1717
### iTwin.js@^4 Compatible
1818

@@ -38,11 +38,11 @@ Each one has it's own folder and README describing the package.
3838

3939
The following packages have been deprecated and will no longer be maintained:
4040

41-
| Name | Folder | Changelog | Version | Replacement |
42-
| ---------------------------------- | -------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
43-
| @bentley/imodel-select-react | [imodel-select](./packages/archive/imodel-select/) | [changelog](./packages/archive/imodel-select/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40bentley%2Fimodel-select-react.svg)](https://badge.fury.io/js/%40bentley%2Fimodel-select-react) | [@itwin/imodel-browser-react](https://www.npmjs.com/package/@itwin/imodel-browser-react) |
44-
| @bentley/markup-frontstage-react | [markup-frontstage](./packages/archive/markup-frontstage/) | [changelog](./packages/archive/markup-frontstage/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40bentley%2Fmarkup-frontstage-react.svg)](https://badge.fury.io/js/%40bentley%2Fmarkup-frontstage-react) | N/A |
45-
| @itwin/infrastructure-iot-react | [infrastructure-iot](./packages/archive/infrastructure-iot) | [changelog](./packages/archive/infrastructure-iot/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40itwin%2Finfrastructure-iot-react.svg)](https://badge.fury.io/js/%40itwin%2Finfrastructure-iot-react) | N/A |
41+
| Name | Folder | Changelog | Version | Replacement |
42+
| -------------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
43+
| @bentley/imodel-select-react | [imodel-select](./packages/archive/imodel-select/) | [changelog](./packages/archive/imodel-select/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40bentley%2Fimodel-select-react.svg)](https://badge.fury.io/js/%40bentley%2Fimodel-select-react) | [@itwin/imodel-browser-react](https://www.npmjs.com/package/@itwin/imodel-browser-react) |
44+
| @bentley/markup-frontstage-react | [markup-frontstage](./packages/archive/markup-frontstage/) | [changelog](./packages/archive/markup-frontstage/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40bentley%2Fmarkup-frontstage-react.svg)](https://badge.fury.io/js/%40bentley%2Fmarkup-frontstage-react) | N/A |
45+
| @itwin/infrastructure-iot-react | [infrastructure-iot](./packages/archive/infrastructure-iot) | [changelog](./packages/archive/infrastructure-iot/CHANGELOG.md) | [![npm version](https://badge.fury.io/js/%40itwin%2Finfrastructure-iot-react.svg)](https://badge.fury.io/js/%40itwin%2Finfrastructure-iot-react) | N/A |
4646

4747
## Adding a new "project"
4848

apps/learning-snippets/.mocharc.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
{
2-
"require": [
3-
"raf/polyfill",
4-
"ignore-styles",
5-
"./lib/setup.js"
6-
],
2+
"require": ["raf/polyfill", "ignore-styles", "./lib/setup.js"],
73
"check-leaks": true,
84
"timeout": "60000",
9-
"globals": [
10-
"IS_REACT_ACT_ENVIRONMENT"
11-
],
12-
"spec": [
13-
"./lib/test/**/*.test.js"
14-
]
5+
"globals": ["IS_REACT_ACT_ENVIRONMENT"],
6+
"spec": ["./lib/test/**/*.test.js"]
157
}

apps/learning-snippets/src/test/tree-widget/FilteredPaths.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ function CustomModelsTreeComponentWithFilterAndTargetItems({
118118
const getFilteredPaths = useCallback<GetFilteredPathsType>(
119119
async ({ createInstanceKeyPaths, filter }) => {
120120
const targetItems = new Array<InstanceKey>();
121-
for await (const row of imodel.createQueryReader(`
121+
for await (const row of imodel.createQueryReader(
122+
`
122123
SELECT ec_classname(e.ECClassId, 's.c') className, e.ECInstanceId id
123124
FROM BisCore.Element e
124125
WHERE UserLabel LIKE '%${filter ?? ""}%'

apps/learning-snippets/src/utils/TreeWidgetTestUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function mockGetBoundingClientRect() {
8383
);
8484
});
8585

86-
afterEach(() => {
87-
stubs.forEach((stub) => stub.restore());
88-
stubs = [];
89-
});
86+
afterEach(() => {
87+
stubs.forEach((stub) => stub.restore());
88+
stubs = [];
89+
});
9090
}

apps/test-viewer/src/UiProvidersConfig.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,18 @@ const configuredUiItems = new Map<string, UiItem>([
245245
await MeasureTools.startup();
246246
MeasurementActionToolbar.setDefaultActionProvider();
247247
},
248-
createUiItemsProviders: () => [new MeasureToolsUiItemsProvider({
249-
measurementFormattingProps: {
250-
distance: {
251-
bearing: {
252-
koqName: "RoadRailUnits.Bearing",
253-
persistenceUnitName: "Units.RAD"
254-
}
255-
}
256-
}
257-
})],
248+
createUiItemsProviders: () => [
249+
new MeasureToolsUiItemsProvider({
250+
measurementFormattingProps: {
251+
distance: {
252+
bearing: {
253+
koqName: "RoadRailUnits.Bearing",
254+
persistenceUnitName: "Units.RAD",
255+
},
256+
},
257+
},
258+
}),
259+
],
258260
},
259261
],
260262
[
@@ -265,11 +267,8 @@ const configuredUiItems = new Map<string, UiItem>([
265267
await MapLayersUI.initialize({ iTwinConfig: new MapLayersPrefBrowserStorage() });
266268
},
267269
createUiItemsProviders: () => {
268-
return [
269-
new MapLayersUiItemsProvider({baseMapLayers: createDefaultGoogleMapsBaseMaps()}),
270-
new FeatureInfoUiItemsProvider({})];
271-
}
272-
270+
return [new MapLayersUiItemsProvider({ baseMapLayers: createDefaultGoogleMapsBaseMaps() }), new FeatureInfoUiItemsProvider({})];
271+
},
273272
},
274273
],
275274
[

apps/test-viewer/src/components/ApiKeys.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export class ApiKeys {
1212
return import.meta.env.IMJS_GOOGLE_MAPS_KEY ?? "";
1313
}
1414

15-
1615
public static get CesiumKey() {
1716
return import.meta.env.IMJS_CESIUM_ION_KEY ?? "";
1817
}

apps/test-viewer/src/components/Viewer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ function onIModelConnected(imodel: IModelConnection) {
115115
void IModelApp.quantityFormatter.resetToUseInternalUnitsProvider();
116116
console.log("Unregistered SchemaFormatsProvider, SchemaUnitProvider");
117117
});
118-
119118
} catch (err) {
120119
console.error("Error while setting up formats provider:", err);
121120
}
122-
}
121+
};
123122

124123
// Only load a schema formats provider if the iModel has the AecUnits schema
125124
void setupFormatsProvider();

apps/test-viewer/src/index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
*--------------------------------------------------------------------------------------------*/
55
body {
66
margin: 0;
7-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
7+
font-family:
8+
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
89
-webkit-font-smoothing: antialiased;
910
-moz-osx-font-smoothing: grayscale;
1011
}

0 commit comments

Comments
 (0)