diff --git a/common/changes/@itwin/appui-react/ui-models-tree-optimize-creating-subjects-hierarchy_2022-05-24-12-58.json b/common/changes/@itwin/appui-react/ui-models-tree-optimize-creating-subjects-hierarchy_2022-05-24-12-58.json new file mode 100644 index 000000000000..0c61a3730d6b --- /dev/null +++ b/common/changes/@itwin/appui-react/ui-models-tree-optimize-creating-subjects-hierarchy_2022-05-24-12-58.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/appui-react", + "comment": "Models Tree: Optimize creating subjects hierarchy", + "type": "none" + } + ], + "packageName": "@itwin/appui-react" +} \ No newline at end of file diff --git a/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree-GroupedByClass.PresentationRuleSet.json b/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree-GroupedByClass.PresentationRuleSet.json index 0c5d4e0c022d..978c40331523 100644 --- a/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree-GroupedByClass.PresentationRuleSet.json +++ b/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree-GroupedByClass.PresentationRuleSet.json @@ -121,6 +121,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideIfNoChildren": true, "groupByClass": false, "groupByLabel": false @@ -152,6 +153,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND (json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL) AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideNodesInHierarchy": true, "groupByClass": false, "groupByLabel": false diff --git a/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree.PresentationRuleSet.json b/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree.PresentationRuleSet.json index 8724aa0a10e2..675ea21d31fa 100644 --- a/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree.PresentationRuleSet.json +++ b/test-apps/presentation-test-app/assets/presentation_rules/VisibilityWidget.ModelsTree.PresentationRuleSet.json @@ -121,6 +121,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideIfNoChildren": true, "groupByClass": false, "groupByLabel": false @@ -152,6 +153,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND (json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL) AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideNodesInHierarchy": true, "groupByClass": false, "groupByLabel": false diff --git a/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.GroupedByClass.json b/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.GroupedByClass.json index 9b2631dc9149..8e58e748bc97 100644 --- a/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.GroupedByClass.json +++ b/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.GroupedByClass.json @@ -121,6 +121,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideIfNoChildren": true, "groupByClass": false, "groupByLabel": false @@ -152,6 +153,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND (json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL) AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideNodesInHierarchy": true, "groupByClass": false, "groupByLabel": false diff --git a/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.json b/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.json index a206562d44a1..5f1ea477b5a0 100644 --- a/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.json +++ b/ui/appui-react/src/appui-react/imodel-components/models-tree/Hierarchy.json @@ -121,6 +121,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") = NULL AND json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") = NULL AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideIfNoChildren": true, "groupByClass": false, "groupByLabel": false @@ -152,6 +153,7 @@ } ], "instanceFilter": "(parent.ECInstanceId = partition.Parent.Id OR json_extract(parent.JsonProperties, \"$.Subject.Model.TargetPartition\") = printf(\"0x%x\", partition.ECInstanceId)) AND NOT this.IsPrivate AND (json_extract(partition.JsonProperties, \"$.PhysicalPartition.Model.Content\") <> NULL OR json_extract(partition.JsonProperties, \"$.GraphicalPartition3d.Model.Content\") <> NULL) AND this.HasRelatedInstance(\"BisCore:ModelContainsElements\", \"Forward\", \"BisCore:GeometricElement3d\")", + "hasChildren": "Always", "hideNodesInHierarchy": true, "groupByClass": false, "groupByLabel": false