Skip to content

[Tree widget]: Visibility of hierarchies containing sub-models behaves incorrectly with search paths #1553

@JonasDov

Description

@JonasDov

Noticed a bug in categories tree while adding searched hierarchy tests.
With the following hierarchy:

  • category1
    • element1
      • category2
        • element1_1 (model is modeled element)
        • element1_2 (model is modeled element)

and search paths: [[category1, element1, element1SubModel, category2, element1_1]],
switching category1 visibility, results in it having partial visibility, even though it should be visible.
This happens because when checking category1 elements (in this case element1) visibility, visibility of models that are elements is also checked (and while checking these sub-models visibility handler does not take into account search paths).
It should be enough to fix this by:

  1. Modify BaseIdsCache.getCategories to accept search paths, and then filter out categories based on search paths
  2. Modify BaseIdsCache.getElementsCount to accept search paths, and then return correct count for categories based on it's search paths.

It should be noted that additional tests for searched hierarchy should be added that check searched and non searched categories that are under sub-models.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtree widgetTree widget or its components related issues

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions