Commit ea5bdd84 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'show_group_sharing_members' into 'master'

Show group sharing members

Fixes #140

/cc @jacobvosmaer @job @sytse

See merge request !158
parents b9dc8e59 77156c0f
...@@ -7,6 +7,7 @@ class Projects::TeamMembersController < Projects::ApplicationController ...@@ -7,6 +7,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
def index def index
@group = @project.group @group = @project.group
@users_projects = @project.users_projects.order('project_access DESC') @users_projects = @project.users_projects.order('project_access DESC')
@project_group_links = @project.project_group_links
end end
def new def new
......
- @project_group_links.each do |group_links|
- shared_group = group_links.group
- shared_group_users_count = group_links.group.users_groups.count
.panel.panel-default
.panel-heading
Shared with
%strong #{shared_group.name}
group, members with
%strong #{group_links.human_access}
role (#{shared_group_users_count})
.pull-right
= link_to members_group_path(shared_group), class: 'btn btn-small' do
%i.icon-edit
%ul.well-list
- shared_group.users_groups.order('group_access DESC').limit(20).each do |member|
= render 'users_groups/users_group', member: member, show_controls: false, show_roles: false
- if shared_group_users_count > 20
%li
and #{shared_group_users_count - 20} more. For full list visit #{link_to 'group members page', members_group_path(shared_group)}
...@@ -14,3 +14,5 @@ ...@@ -14,3 +14,5 @@
= render "team", members: @users_projects = render "team", members: @users_projects
- if @group - if @group
= render "group_members" = render "group_members"
- if @project_group_links.any?
= render "shared_group_members"
...@@ -35,3 +35,8 @@ Feature: Project Team management ...@@ -35,3 +35,8 @@ Feature: Project Team management
And I click link "Import team from another project" And I click link "Import team from another project"
And I submit "Website" project for import team And I submit "Website" project for import team
Then I should see "Mike" in team list as "Reporter" Then I should see "Mike" in team list as "Reporter"
Scenario: See all members of projects shared group
Given I share project with group "OpenSource"
And I visit project "Shop" team page
Then I should see "Opensource" group user listing
...@@ -104,4 +104,23 @@ class ProjectTeamManagement < Spinach::FeatureSteps ...@@ -104,4 +104,23 @@ class ProjectTeamManagement < Spinach::FeatureSteps
click_link('Remove user from team') click_link('Remove user from team')
end end
end end
step 'I share project with group "OpenSource"' do
project = Project.find_by(name: 'Shop')
os_group = create(:group, name: 'OpenSource')
os_project = create(:project, group: os_group)
@os_user1 = create(:user)
@os_user2 = create(:user)
os_group.add_owner(@os_user1)
os_group.add_user(@os_user2, Gitlab::Access::DEVELOPER)
share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER)
share_link.group_id = os_group.id
share_link.save!
end
step 'I should see "Opensource" group user listing' do
page.should have_content("Shared with OpenSource group, members with Master role (2)")
page.should have_content(@os_user1.name)
page.should have_content(@os_user2.name)
end
end end
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