diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-24 07:52:21 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-24 07:52:21 +0000 |
commit | f7bdfe5098c9a5a3a426344ba1d7dd668212cf7e (patch) | |
tree | 5a1cb2a90b0a2b5114f6f23712b68724b3e8a7e0 /app/controllers/dashboard | |
parent | 9cd528aa7ac5066570cb50b909951a6c6b723935 (diff) | |
parent | e16add2267648d3d3ef1d98f9b53f67a29428791 (diff) | |
download | gitlab-ce-es-module-autosave.tar.gz |
Merge branch 'master' into 'es-module-autosave'es-module-autosave
# Conflicts:
# app/assets/javascripts/issuable_form.js
# app/assets/javascripts/notes.js
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r-- | app/controllers/dashboard/groups_controller.rb | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/app/controllers/dashboard/groups_controller.rb b/app/controllers/dashboard/groups_controller.rb index 7ed18fb481c..025769f512a 100644 --- a/app/controllers/dashboard/groups_controller.rb +++ b/app/controllers/dashboard/groups_controller.rb @@ -1,33 +1,8 @@ class Dashboard::GroupsController < Dashboard::ApplicationController - def index - @sort = params[:sort] || 'created_desc' - - @groups = - if params[:parent_id] && Group.supports_nested_groups? - parent = Group.find_by(id: params[:parent_id]) - - if can?(current_user, :read_group, parent) - GroupsFinder.new(current_user, parent: parent).execute - else - Group.none - end - else - current_user.groups - end + include GroupTree - @groups = @groups.search(params[:filter_groups]) if params[:filter_groups].present? - @groups = @groups.includes(:route) - @groups = @groups.sort(@sort) - @groups = @groups.page(params[:page]) - - respond_to do |format| - format.html - format.json do - render json: GroupSerializer - .new(current_user: @current_user) - .with_pagination(request, response) - .represent(@groups) - end - end + def index + groups = GroupsFinder.new(current_user, all_available: false).execute + render_group_tree(groups) end end |