Commit a0eaff14 authored by Phil Hughes's avatar Phil Hughes

Updated Ruby variable name

Fixed Ruby code based on review feedback
parent c2602aaf
...@@ -5,7 +5,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController ...@@ -5,7 +5,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access] before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access]
def index def index
@groups = @project.project_group_links @group_links = @project.project_group_links
@project_members = @project.project_members @project_members = @project.project_members
@project_members = @project_members.non_invite unless can?(current_user, :admin_project, @project) @project_members = @project_members.non_invite unless can?(current_user, :admin_project, @project)
...@@ -14,9 +14,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController ...@@ -14,9 +14,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
users = @project.users.search(params[:search]).to_a users = @project.users.search(params[:search]).to_a
@project_members = @project_members.where(user_id: users) @project_members = @project_members.where(user_id: users)
group_ids = @groups.pluck(:group_id) @group_links = @project.project_group_links.where(group_id: @project.invited_groups.search(params[:search]).select(:id))
group_ids = Group.where(id: group_ids).search(params[:search]).to_a
@groups = @project.project_group_links.where(group_id: group_ids)
end end
@project_members = @project_members.order(access_level: :desc).page(params[:page]) @project_members = @project_members.order(access_level: :desc).page(params[:page])
...@@ -40,7 +38,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController ...@@ -40,7 +38,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
groups.each do |group| groups.each do |group|
next unless can?(current_user, :read_group, group) next unless can?(current_user, :read_group, group)
project.project_group_links.create( project.project_group_links.create(
group: group, group: group,
group_access: params[:access_level], group_access: params[:access_level],
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
.panel-heading .panel-heading
Groups with access to Groups with access to
%strong #{@project.name} %strong #{@project.name}
%span.badge= groups.size %span.badge= group_links.size
%ul.content-list %ul.content-list
- @groups.each do |group_link| - group_links.each do |group_link|
- group = group_link.group - group = group_link.group
= render 'shared/members/group', group_link: group_link, group: group = render 'shared/members/group', group_link: group_link, group: group
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
= search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false } = search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false }
%button.member-search-btn{ type: "submit", "aria-label" => "Submit search" } %button.member-search-btn{ type: "submit", "aria-label" => "Submit search" }
= icon("search") = icon("search")
- if @groups.size > 0 - if @group_links.size > 0
= render 'groups', groups: @groups = render 'groups', group_links: @group_links
= render 'team', members: @project_members = render 'team', members: @project_members
= paginate @project_members, theme: "gitlab" = paginate @project_members, theme: "gitlab"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment