Commit Graph

11 Commits

Author SHA1 Message Date
Bob Van Landuyt 082c28cce6 Use `expose` with blocks instead of defining methods 2017-10-05 13:12:59 +02:00
Bob Van Landuyt e013d39875 Optimize finding a membership for a user to avoid extra queries 2017-10-05 13:12:40 +02:00
Bob Van Landuyt 951abe2b2e Load counts everywhere we render a group tree 2017-10-05 11:11:21 +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 22aa034427 Rename `GroupHierarchy` to `GroupDescendant` 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 31f7756893 `current_user:` as a keyword argument 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 4c8942f9b8 Replace `full_path`, `path` & `web_url` with a single `relative_path` 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 5998157618 Include `can_leave` for a group 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 79cc3c8e3e Limit the amount of queries per row 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 648c082a23 Render group children using the same entity 2017-10-04 22:46:49 +02:00
Bob Van Landuyt d33e15574b Add serializer for group children 2017-10-04 22:46:49 +02:00