diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-12 12:09:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-12 12:09:36 +0000 |
commit | 57a3a42c88f6e7dbcfd388a5c83302f0bb666023 (patch) | |
tree | f9b3368c0f0bb66deeabccc40dedc4066ff0ee22 /app/controllers/groups/group_members_controller.rb | |
parent | 91e8c3a6efea1d805cfa86e7ade9a9628344cf89 (diff) | |
download | gitlab-ce-57a3a42c88f6e7dbcfd388a5c83302f0bb666023.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/groups/group_members_controller.rb')
-rw-r--r-- | app/controllers/groups/group_members_controller.rb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb index 9b8d5cfe476..558a4bbfd45 100644 --- a/app/controllers/groups/group_members_controller.rb +++ b/app/controllers/groups/group_members_controller.rb @@ -25,19 +25,15 @@ class Groups::GroupMembersController < Groups::ApplicationController def index @sort = params[:sort].presence || sort_value_name - @members = GroupMembersFinder - .new(@group, current_user, params: filter_params) - .execute(include_relations: requested_relations) - if can?(current_user, :admin_group_member, @group) @skip_groups = @group.related_group_ids - @invited_members = @members.invite + @invited_members = invited_members @invited_members = @invited_members.search_invite_email(params[:search_invited]) if params[:search_invited].present? @invited_members = present_invited_members(@invited_members) end - @members = present_group_members(@members.non_invite) + @members = present_group_members(non_invited_members) @requesters = present_members( AccessRequestsFinder.new(@group).execute(current_user) @@ -51,6 +47,20 @@ class Groups::GroupMembersController < Groups::ApplicationController private + def group_members + @group_members ||= GroupMembersFinder + .new(@group, current_user, params: filter_params) + .execute(include_relations: requested_relations) + end + + def invited_members + group_members.invite + end + + def non_invited_members + group_members.non_invite + end + def present_invited_members(invited_members) present_members(invited_members .page(params[:invited_members_page]) |