Commit Graph

47 Commits

Author SHA1 Message Date
Stan Hu 30e6cfa05a Fix not all events being shown in group dashboard
The group activity feed was limited to the first 20 projects found
in the group, which caused activity from some projects to be omitted.
A limit of 20 is applied to the query for events, so the
extra pagination does little in the way of performance.

Closes #42560
2018-01-30 17:04:22 -08:00
Rémy Coutable d5e2f873db Merge branch '35644-refactor-have-http-status-into-have-gitlab-http-status' into 'master'
Refactor `have_http_status` into `have_gitlab_http_status` in the specs

Closes #35644

See merge request gitlab-org/gitlab-ce!14958
2017-10-23 14:55:57 +00:00
Bob Van Landuyt 69eba88532 Make sure we render events for projects within a group 2017-10-20 17:02:02 +03:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00
Bob Van Landuyt 2c25a7ae34 Nest the group_children_path inside the canonical group path 2017-10-12 11:36:55 +02:00
Bob Van Landuyt bd8943f5ad Fix spinach features
And several other failures
2017-10-11 14:16:40 +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 67815272dc Return an empty array when no matches are found 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 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 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 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 9781ac552d Include pagination when rendering expanded hierarchies 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 20a08965bc [WIP] improve number of queries when rendering a hierarchy 2017-10-04 22:49:41 +02:00
Bob Van Landuyt 3a4dc55f29 Reuse the groups tree for explore and dashboard. 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 8f6dac4991 Allow filtering children for a group
When fetching children for a group with a filter, we will search all
nested groups for results and render them in an expanded tree
2017-10-04 22:49:41 +02:00
Bob Van Landuyt 28c440045e Add pagination for children 2017-10-04 22:46:49 +02:00
Bob Van Landuyt 80780018a9 Update `children` route to handle projects and groups 2017-10-04 22:46:49 +02:00
Bob Van Landuyt 376a8c66c1 Remove the subgroups path on a group 2017-10-04 22:46:49 +02:00
Ruben Davila 62bb6235c2 Make Members with Owner and Master roles always able to create subgroups 2017-09-07 13:47:58 -05:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Toon Claes ef1811f4bc Subgroups page should show groups authorized through inheritance
When a user is authorized to a group, they are also authorized to see all the
ancestor groups and descendant groups.

When a user is authorized to a project, they are authorized to see all the
ancestor groups too.

Closes #32135

See merge request !11764
2017-06-15 08:46:34 +02:00
Douwe Maan 26bcef97d6 Merge branch 'rework-authorizations-performance' into 'master'
Rework project authorizations and nested groups for better performance

See merge request !10885
2017-05-29 15:49:56 +00:00
Michael Kozono 49697bc8df Refactor to more robust implementation
In order to avoid string manipulation or modify route params (to make them unambiguous for `url_for`), we are accepting a behavior change:

When being redirected to the canonical path for a group, if you requested a group show path starting with `/groups/…` then you’ll now be redirected to the group at root `/…`.
2017-05-19 09:13:27 -07:00
Michael Kozono f9785dcec3 Fix ensure_canonical_path for top level routes
Don’t replace a substring of the path if it is part of the top level route.

E.g. When redirecting from `/groups/ups` to `/groups/foo`, be careful not to do `/grofoo/ups`.

Projects are unaffected by this issue, but I am grouping the `#ensure_canonical_path` tests similar to the group and user tests.
2017-05-18 16:24:10 -07:00
Michael Kozono 11f82de1ef Add test that fails without the fix 2017-05-18 10:30:17 -07:00
Yorick Peterse 34974258bc
Hide nested group UI/API support for MySQL
This hides/disables some UI elements and API parameters related to
nested groups when MySQL is used, since nested groups are not supported
for MySQL.
2017-05-17 20:53:16 +02:00
Michael Kozono ab98f8b5b1 Fix redirect message for groups and users 2017-05-11 15:28:13 -07:00
Robert Speicher cb2f739d48 Merge branch '27144-enforce-rubocop-trailing_commas-no_comma-style' into 'master'
Resolve "Use consistent style for trailing commas"

Closes #27144

See merge request !11063
2017-05-10 21:43:34 +00:00
Rémy Coutable 3db37e0562 Enable the Style/TrailingCommaInArguments cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Douwe Maan ea4eb46047 Merge branch 'tc-fix-private-subgroups-shown' into 'security'
Use GroupsFinder to find subgroups the user has access to

See merge request !2096
2017-05-10 16:48:18 +02:00
Michael Kozono f05469f99b Resolve discussions 2017-05-05 12:12:50 -07:00
Michael Kozono e4bcc90d95 Add “project moved” flash message on redirect 2017-05-05 12:12:50 -07:00
Michael Kozono fc061c2ecd Fix Rubocop failures 2017-05-05 12:12:49 -07:00
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Robert Speicher 4642ca6686 Use `empty_project` where possible in controller specs 2017-01-25 17:14:38 -05:00
James Lopez 4c3ec579e5 added more specs 2016-12-21 13:29:27 +01:00
James Lopez b82fdf6257 Fix error 500 renaming group. Also added specs and changelog. 2016-12-20 17:52:27 +01:00
Kamil Trzcinski e8aab1cd15 This fixes a long running tests due to changed Sidekiq state 2016-08-15 23:26:40 +02:00
Stan Hu cb8a425ba4 Fix bug where destroying a namespace would not always destroy projects
There is a race condition in DestroyGroupService now that projects are deleted asynchronously:

1. User attempts to delete group
2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
4. Projects::DestroyService runs later but the can?(current_user,
   :remove_project) is `false` because the user no longer has permission to
   destroy projects with no namespace.
5. This leaves the project in pending_delete state with no namespace/group.

Projects without a namespace or group also adds another problem: it's not possible to destroy the container
registry tags, since container_registry_path_with_namespace is the wrong value.

The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService.

Closes #17893
2016-08-11 15:36:35 -07:00
Z.J. van de Weg 91a7b9333b Incorportate feedback 2016-06-01 12:10:08 +02:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Douglas Barbosa Alexandre 100e3e7601 Fix sorting issues/mrs by votes on the groups page
The `non_archived` scope applied here
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/conc
erns/issues_action.rb#L5 overrides the previous `ORDER BY` applied
inside the IssuesFinder, with the default scope of the Project model,
resulting in SQL errors.
2016-03-21 17:01:38 -03:00
Robert Speicher a7c4d0da8c Make the `/groups` route behave as expected
The route is supposed to redirect the Groups#index request based on
whether or not a user was logged in. If they are, we redirect them to
their groups dashboard; if they're not, we redirect them to the public
Explore page.

But due to overly aggressive `before_action`s that weren't excluding the
`index` action, the request always resulted in a 404, whether a user was
logged in or not.

Closes #12660
2016-01-23 16:10:13 -08:00