Skip to content

Commit 8ea920d

Browse files
adjustments
1 parent 0b8ab0a commit 8ea920d

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

packages/itwin/tree-widget/src/test/trees/models-tree/ModelsTreeFiltering.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
} from "../../IModelUtils.js";
3131
import { createIModelAccess } from "../Common.js";
3232
import { NodeValidators, validateHierarchy } from "../HierarchyValidation.js";
33-
import { createClassGroupingHierarchyNode, createModelsTreeProvider, getGroupingNodeParentKeys } from "./Utils.js";
33+
import { createClassGroupingHierarchyNode, createModelsTreeProvider, getNodeParentKeys } from "./Utils.js";
3434

3535
import type { Id64String } from "@itwin/core-bentley";
3636
import type { IModelConnection } from "@itwin/core-frontend";
@@ -1115,7 +1115,7 @@ describe("Models tree", () => {
11151115
modelId: model.id,
11161116
categoryId: category.id,
11171117
elements: [testElement1.id, testElement2.id],
1118-
parentKeys: getGroupingNodeParentKeys([adjustedModelKey(model), category, groupingNode.key, adjustedElementKey(rootElement)]),
1118+
parentKeys: getNodeParentKeys([adjustedModelKey(model), category, groupingNode.key, adjustedElementKey(rootElement)]),
11191119
});
11201120
return { rootSubject, model, category, rootElement, testElement1, testElement2, pathUntilTargetElement, targetGroupingNode };
11211121
},
@@ -1219,22 +1219,22 @@ describe("Models tree", () => {
12191219
modelId: model.id,
12201220
categoryId: category.id,
12211221
elements: [rootElement.id],
1222-
parentKeys: getGroupingNodeParentKeys([adjustedModelKey(model), category]),
1222+
parentKeys: getNodeParentKeys([adjustedModelKey(model), category]),
12231223
});
12241224

12251225
const physicalElementGroupingNode = createClassGroupingHierarchyNode({
12261226
className: physicalElement1.className,
12271227
modelId: model.id,
12281228
categoryId: category.id,
12291229
elements: [physicalElement1.id, physicalElement2.id],
1230-
parentKeys: getGroupingNodeParentKeys([adjustedModelKey(model), category, groupingNode.key, adjustedElementKey(rootElement)]),
1230+
parentKeys: getNodeParentKeys([adjustedModelKey(model), category, groupingNode.key, adjustedElementKey(rootElement)]),
12311231
});
12321232
const testElementGroupingNode = createClassGroupingHierarchyNode({
12331233
className: testElement1.className,
12341234
modelId: model.id,
12351235
categoryId: category.id,
12361236
elements: [testElement1.id, testElement2.id],
1237-
parentKeys: getGroupingNodeParentKeys([adjustedModelKey(model), category, groupingNode.key, adjustedElementKey(rootElement)]),
1237+
parentKeys: getNodeParentKeys([adjustedModelKey(model), category, groupingNode.key, adjustedElementKey(rootElement)]),
12381238
});
12391239
return {
12401240
rootSubject,
@@ -1343,21 +1343,21 @@ describe("Models tree", () => {
13431343
modelId: model.id,
13441344
categoryId: category.id,
13451345
elements: [parentElement.id],
1346-
parentKeys: getGroupingNodeParentKeys(pathUntilParentElement),
1346+
parentKeys: getNodeParentKeys(pathUntilParentElement),
13471347
});
13481348
const middleElementGroupingNode = createClassGroupingHierarchyNode({
13491349
className: middleElement.className,
13501350
modelId: model.id,
13511351
categoryId: category.id,
13521352
elements: [middleElement.id],
1353-
parentKeys: getGroupingNodeParentKeys([...pathUntilParentElement, parentElementGroupingNode.key, parentElement]),
1353+
parentKeys: getNodeParentKeys([...pathUntilParentElement, parentElementGroupingNode.key, parentElement]),
13541354
});
13551355
const childElementGroupingNode = createClassGroupingHierarchyNode({
13561356
className: childElement.className,
13571357
modelId: model.id,
13581358
categoryId: category.id,
13591359
elements: [childElement.id],
1360-
parentKeys: getGroupingNodeParentKeys([
1360+
parentKeys: getNodeParentKeys([
13611361
...pathUntilParentElement,
13621362
parentElementGroupingNode.key,
13631363
parentElement,

packages/itwin/tree-widget/src/test/trees/models-tree/Utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type { IModelConnection } from "@itwin/core-frontend";
2121
import type {
2222
ClassGroupingNodeKey,
2323
GroupingHierarchyNode,
24+
GroupingNodeKey,
2425
HierarchyFilteringPath,
2526
HierarchyNodeKey,
2627
HierarchyProvider,
@@ -207,9 +208,9 @@ export function createClassGroupingHierarchyNode({
207208
};
208209
}
209210

210-
export function getGroupingNodeParentKeys(
211+
export function getNodeParentKeys(
211212
keys: (
212-
| ClassGroupingNodeKey
213+
| GroupingNodeKey
213214
| {
214215
className: string;
215216
id: string;

packages/itwin/tree-widget/src/tree-widget-react/components/trees/common/components/TreeNodeVisibilityButton.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ export interface TreeItemVisibilityButtonProps {
3636
reserveSpace?: true;
3737
}
3838

39-
/** @beta */
39+
/**
40+
* React component that renders a visibility action for a tree item.
41+
* Should be used with `VisibilityTreeRenderer`.
42+
* @beta
43+
*/
4044
export const VisibilityAction = memo(function VisibilityAction({ node, reserveSpace }: TreeItemVisibilityButtonProps & { node: PresentationHierarchyNode }) {
4145
const context = useVisibilityContext();
4246
const state = context?.getVisibilityButtonState(node);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export { FocusedInstancesContextProvider, useFocusedInstancesContext } from "./c
2626

2727
export { Tree } from "./common/components/Tree.js";
2828
export { VisibilityTree } from "./common/components/VisibilityTree.js";
29+
export { VisibilityAction } from "./common/components/TreeNodeVisibilityButton.js";
2930
export { TreeRenderer } from "./common/components/TreeRenderer.js";
3031
export { VisibilityTreeRenderer } from "./common/components/VisibilityTreeRenderer.js";
3132
export { HierarchyVisibilityHandler, VisibilityStatus } from "./common/UseHierarchyVisibility.js";

0 commit comments

Comments
 (0)