Commit Graph

11 Commits

Author SHA1 Message Date
Yorick Peterse 77d4546eda
Reduce queries in GroupProjectsFinder
GroupProjectsFinder#collection_with_user would run the following code:

    if group.users.include?(current_user)

When running this code for multiple groups this would result in one
query being executed for every group.

This commit simple removes the entire "if" statement with the code of
the "else" statement. This ensures both paths use the same code, and
removes the need for explicitly checking if a user is a member of the
group.
2018-05-28 13:52:37 +02:00
Jarka Kadlecová 7f0ebeff1a Include subgroup issuables on the group page 2018-02-01 07:04:37 +01:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Bob Van Landuyt 518216c062 Merge group hierarchies when parents are shared 2017-10-04 22:49:41 +02:00
Yorick Peterse c9e277ee01
Refactor GroupProjectsFinder#init_collection
This optimises how GroupProjectsFinder builds it collection, producing
simpler and faster queries in the process. It also cleans up the code a
bit to make it easier to understand.
2017-06-19 19:11:35 +02:00
Jacopo b996a82ff4 ProjectsFinder should handle more options
Extended ProjectFinder in order to handle the following options:
 - current_user - which user use
 - project_ids_relation: int[] - project ids to use
 - params:
   -  trending: boolean
   -  non_public: boolean
   -  starred: boolean
   -  sort: string
   -  visibility_level: int
   -  tags: string[]
   -  personal: boolean
   -  search: string
   -  non_archived: boolean

GroupProjectsFinder now inherits from ProjectsFinder.
Changed the code in order to use the new available options.
2017-04-06 07:11:37 +02:00
Douwe Maan ffcbc63693 List all groups/projects for admins on explore pages 2017-02-06 21:02:07 -06:00
Stan Hu b359d5d57f Fix groups API to list only user's accessible projects
Closes #17496
2016-05-24 18:14:12 -07:00
Felipe Artur 8d544645f0 Add specs and add visibility level to admin groups 2016-03-21 19:11:24 -03:00
Douwe Maan 3058a8fa4c Fix "Shared projects" tab 2016-03-20 21:30:08 +01:00
Douwe Maan 8db1292139 Tweaks, refactoring, and specs 2016-03-20 21:04:07 +01:00