Commit Graph

20 Commits

Author SHA1 Message Date
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Bob Van Landuyt 18907efbc9 Pass `archived:` as a keyword argument 2017-10-12 11:36:54 +02:00
Bob Van Landuyt 5a903149e7 Handle archived projects in the `GroupDescendantsFinder` 2017-10-11 10:17:24 +02:00
Bob Van Landuyt e678f31292 Use the `GroupProjectsFinder` to find direct children 2017-10-10 17:05:02 +02:00
Bob Van Landuyt 7611e6a0f7 Some cleanup in the GroupDescendantFinder 2017-10-10 16:54:59 +02:00
Bob Van Landuyt aee5691db3 Don't load unneeded elements in GroupsController#show 2017-10-10 16:54:28 +02:00
Bob Van Landuyt deb45634ae Use `EXISTS` instead of `WHERE id IN (...)` for authorized groups 2017-10-10 14:09:56 +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 dda023d66d Optimize queries and pagination in `GroupDescendantsFinder` 2017-10-05 11:10:57 +02:00
Bob Van Landuyt 6c2de364dd Split up adding ancestors for projects 2017-10-04 22:49:42 +02:00
Bob Van Landuyt 8a685ca856 Fix bug with project pagination
When projects were listed after groups, the projects that would also
have been listed on the last page containing groups would be repeated.
2017-10-04 22:49:42 +02:00
Bob Van Landuyt cb8e67c292 Improve count queries and move them to contants 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 ab5d5b7ece Make sure all queries are limited to the page size
And fix some pagination bugs
2017-10-04 22:49:42 +02:00
Bob Van Landuyt 7a3ba8e984 Make sure the user only sees groups he's allowed to see 2017-10-04 22:49:42 +02:00
Bob Van Landuyt b92e7103fc Fix nesting bug when rendering children of a shared subgroup 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 e13753fcaa Only take unarchived projects into account
When finding children for a group
2017-10-04 22:49:41 +02:00
Bob Van Landuyt 29df1ce841 Improve number of queries
And document what extra queries are still being performed.
2017-10-04 22:49:41 +02:00
Bob Van Landuyt 22aa034427 Rename `GroupHierarchy` to `GroupDescendant` 2017-10-04 22:49:41 +02:00