Skip to content

Commit b544f6d

Browse files
committed
Bump hierarchies versions and update comments
1 parent 8629234 commit b544f6d

File tree

11 files changed

+61
-64
lines changed

11 files changed

+61
-64
lines changed

apps/learning-snippets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@itwin/presentation-components": "^5.12.4",
4141
"@itwin/presentation-frontend": "^5.0.0",
4242
"@itwin/presentation-testing": "^5.4.5",
43-
"@itwin/presentation-hierarchies": "^1.6.1",
43+
"@itwin/presentation-hierarchies": "^1.7.0",
4444
"@itwin/presentation-shared": "^1.2.2",
4545
"@itwin/unified-selection": "^1.4.2",
4646
"@testing-library/dom": "^10.4.0",

apps/learning-snippets/pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/performance-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@itwin/eslint-plugin": "^5.2.0",
3030
"@itwin/presentation-common": "^5.0.0",
3131
"@itwin/presentation-core-interop": "^1.3.3",
32-
"@itwin/presentation-hierarchies": "^1.6.1",
32+
"@itwin/presentation-hierarchies": "^1.7.0",
3333
"@itwin/presentation-testing": "^5.4.5",
3434
"@itwin/tree-widget-react": "workspace:*",
3535
"@itwin/presentation-shared": "^1.2.2",

apps/performance-tests/pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/test-viewer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"@itwin/presentation-components": "^5.12.4",
3939
"@itwin/presentation-frontend": "^5.0.2",
4040
"@itwin/presentation-testing": "^5.4.5",
41-
"@itwin/presentation-hierarchies": "^1.6.1",
42-
"@itwin/presentation-hierarchies-react": "^1.7.1",
41+
"@itwin/presentation-hierarchies": "^1.7.0",
42+
"@itwin/presentation-hierarchies-react": "^1.7.2",
4343
"@itwin/presentation-shared": "^1.2.2",
4444
"@itwin/property-grid-react": "workspace:*",
4545
"@itwin/reports-config-widget-react": "workspace:*",

apps/test-viewer/pnpm-lock.yaml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

change/@itwin-tree-widget-react-8f8e08b3-854d-476d-a87b-7e0e2e51f245.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "minor",
3-
"comment": "Added `getSubTreePaths` option to `UseModelsTreeProps` for restricting the visible hierarchy to a subTree of nodes based on instance keys. Unlike `getFilteredPaths`, which controls filtering logic, `getSubTreePaths` limits the scope of the hierarchy itself, allowing filtering within the specified subTree.",
3+
"comment": "Added `getSubTreePaths` option to `UseModelsTreeProps` for restricting the visible hierarchy to a sub-tree of nodes based on instance keys. Unlike `getFilteredPaths`, which controls filtering logic, `getSubTreePaths` limits the scope of the hierarchy, allowing filtering within the specified sub-tree.",
44
"packageName": "@itwin/tree-widget-react",
55
"email": "100586436+JonasDov@users.noreply.github.com",
66
"dependentChangeType": "patch"

packages/itwin/tree-widget/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
"@itwin/itwinui-icons-react": "^2.9.0",
7979
"@itwin/itwinui-illustrations-react": "^2.1.0",
8080
"@itwin/presentation-core-interop": "^1.3.2",
81-
"@itwin/presentation-hierarchies": "^1.6.1",
82-
"@itwin/presentation-hierarchies-react": "^1.7.1",
81+
"@itwin/presentation-hierarchies": "^1.7.0",
82+
"@itwin/presentation-hierarchies-react": "^1.7.2",
8383
"@itwin/presentation-shared": "^1.2.2",
8484
"@itwin/unified-selection": "^1.4.2",
8585
"classnames": "^2.5.1",

packages/itwin/tree-widget/pnpm-lock.yaml

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/itwin/tree-widget/src/tree-widget-react/components/trees/common/Utils.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useEffect, useRef } from "react";
77
import { HierarchyFilteringPath, HierarchyNodeIdentifier } from "@itwin/presentation-hierarchies";
88

99
import type { Id64Array, Id64String } from "@itwin/core-bentley";
10-
import type { HierarchyNodeIdentifiersPath } from "@itwin/presentation-hierarchies";
10+
import type { HierarchyFilteringPathOptions, HierarchyNodeIdentifiersPath } from "@itwin/presentation-hierarchies";
1111

1212
/** @beta */
1313
export type FunctionProps<THook extends (props: any) => any> = Parameters<THook>[0];
@@ -62,7 +62,7 @@ export function joinHierarchyFilteringPaths(subTreePaths: HierarchyNodeIdentifie
6262
const filteringPathsToIncludeIndexes = new Set<number>();
6363

6464
subTreePaths.forEach((subTreePath) => {
65-
let depth = 0;
65+
let options: HierarchyFilteringPathOptions | undefined;
6666
let addSubTreePathToResult = false;
6767

6868
for (let i = 0; i < normalizedFilteringPaths.length; ++i) {
@@ -80,14 +80,12 @@ export function joinHierarchyFilteringPaths(subTreePaths: HierarchyNodeIdentifie
8080
// filtering paths that are shorter or equal than subTree paths length don't need to be added to the result
8181
if (normalizedFilteringPath.path.length === j + 1) {
8282
addSubTreePathToResult = true;
83-
depth = Math.max(
84-
depth,
85-
!normalizedFilteringPath.options?.autoExpand
86-
? 0
87-
: normalizedFilteringPath.options.autoExpand === true
88-
? normalizedFilteringPath.path.length - 1
89-
: normalizedFilteringPath.options.autoExpand.depth,
90-
);
83+
// If filtering path has autoExpand set to true, it means that we should expand only to the targeted filtered node
84+
// This is done by setting depthInPath
85+
options =
86+
normalizedFilteringPath.options?.autoExpand !== true
87+
? HierarchyFilteringPath.mergeOptions(options, normalizedFilteringPath.options)
88+
: { autoExpand: { depthInPath: normalizedFilteringPath.path.length - 1 } };
9189
break;
9290
}
9391

@@ -102,7 +100,7 @@ export function joinHierarchyFilteringPaths(subTreePaths: HierarchyNodeIdentifie
102100
if (addSubTreePathToResult) {
103101
result.push({
104102
path: subTreePath,
105-
options: depth === 0 ? undefined : { autoExpand: depth >= subTreePath.length - 1 ? true : { depth } },
103+
options,
106104
});
107105
}
108106
});

0 commit comments

Comments
 (0)