Commit Graph

8 Commits

Author SHA1 Message Date
Bob Van Landuyt 67815272dc Return an empty array when no matches are found 2017-10-04 22:49:42 +02:00
Bob Van Landuyt 167fd71348 Always preload all elements in a hierarchy to avoid extra queries. 2017-10-04 22:49:42 +02:00
Bob Van Landuyt ef043063f9 Clean up public/private api of `GroupDescendant`
So only methods that are used elsewhere are public.
2017-10-04 22:49:42 +02:00
Bob Van Landuyt af0b8e0558 Only preload ancestors for search results in the specified parent
When filtering we want all to preload all the ancestors upto the specified
parent group.

- root
  - subgroup
    - nested-group
      - project

So when searching 'project', on the 'subgroup' page we want to preload
'nested-group' but not 'subgroup' or 'root'
2017-10-04 22:49:42 +02:00
Bob Van Landuyt ac0b104ae4 Minimize the number of queries by preloading counts and ancestors
By preloading the count of members, projects and subgroups of a group,
we don't need to query them later.

We also preload the entire hierarchy for a search result and include
the counts so we don't need to query for them again
2017-10-04 22:49:42 +02:00
Bob Van Landuyt cd85c22faa Rename hierarchies to descendants where applicable 2017-10-04 22:49:42 +02:00
Bob Van Landuyt cd8e1b85b6 Keep the `parent` method in `Project` 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 22aa034427 Rename `GroupHierarchy` to `GroupDescendant` 2017-10-04 22:49:41 +02:00