Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
82723eed
Commit
82723eed
authored
Dec 02, 2016
by
Phil Hughes
Committed by
Rémy Coutable
Dec 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shows group members in the project members list
Closes #24122
parent
4854eea8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
6 deletions
+49
-6
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+21
-3
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+3
-3
changelogs/unreleased/group-members-in-project-members-view.yml
...logs/unreleased/group-members-in-project-members-view.yml
+4
-0
spec/features/projects/members/group_members_spec.rb
spec/features/projects/members/group_members_spec.rb
+21
-0
No files found.
app/controllers/projects/project_members_controller.rb
View file @
82723eed
...
...
@@ -10,14 +10,32 @@ class Projects::ProjectMembersController < Projects::ApplicationController
@project_members
=
@project
.
project_members
@project_members
=
@project_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
group
=
@project
.
group
if
group
group_members
=
group
.
group_members
.
where
.
not
(
user_id:
@project_members
.
select
(
:user_id
))
group_members
=
group_members
.
non_invite
unless
can?
(
current_user
,
:admin_group
,
@group
)
end
if
params
[
:search
].
present?
users
=
@project
.
users
.
search
(
params
[
:search
]).
to_a
@project_members
=
@project_members
.
where
(
user_id:
users
)
user_ids
=
@project
.
users
.
search
(
params
[
:search
]).
select
(
:id
)
@project_members
=
@project_members
.
where
(
user_id:
user_ids
)
if
group_members
user_ids
=
group
.
users
.
search
(
params
[
:search
]).
select
(
:id
)
group_members
=
group_members
.
where
(
user_id:
user_ids
)
end
@group_links
=
@project
.
project_group_links
.
where
(
group_id:
@project
.
invited_groups
.
search
(
params
[
:search
]).
select
(
:id
))
end
@project_members
=
@project_members
.
order
(
access_level: :desc
).
page
(
params
[
:page
])
members_id
=
@project_members
.
pluck
(
:id
)
if
group_members
members_id
<<
group_members
.
pluck
(
:id
)
end
@project_members
=
Member
.
where
(
id:
members_id
.
flatten
).
order
(
access_level: :desc
).
page
(
params
[
:page
])
@requesters
=
AccessRequestsFinder
.
new
(
@project
).
execute
(
current_user
)
...
...
app/views/shared/members/_member.html.haml
View file @
82723eed
...
...
@@ -20,8 +20,8 @@
%strong
Blocked
-
if
source
.
instance_of?
(
Group
)
&&
!
@group
=
link_to
source
,
class:
"member-group-link prepend-left-5"
do
=
"·
#{
source
.
name
}
"
·
=
link_to
source
.
name
,
source
,
class:
"member-group-link
"
.hidden-xs.cgray
-
if
member
.
request?
...
...
@@ -45,7 +45,7 @@
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
show_roles
.controls.member-controls
-
if
show_controls
-
if
show_controls
&&
(
member
.
respond_to?
(
:group
)
&&
@group
)
||
(
member
.
respond_to?
(
:project
)
&&
@project
)
-
if
user
!=
current_user
=
form_for
member
,
remote:
true
,
html:
{
class:
'form-horizontal js-edit-member-form'
}
do
|
f
|
=
f
.
select
:access_level
,
options_for_select
(
member
.
class
.
access_level_roles
,
member
.
access_level
),
{},
class:
'form-control member-form-control append-right-5 js-member-update-control'
,
id:
"member_access_level_
#{
member
.
id
}
"
,
disabled:
!
can_admin_member
...
...
changelogs/unreleased/group-members-in-project-members-view.yml
0 → 100644
View file @
82723eed
---
title
:
Shows group members in project members list
merge_request
:
author
:
spec/features/projects/members/group_members_spec.rb
0 → 100644
View file @
82723eed
require
'spec_helper'
feature
'Projects members'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
background
do
group
.
add_owner
(
user
)
login_as
(
user
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
end
it
'shows group members in list'
do
expect
(
page
).
to
have_selector
(
'.group_member'
)
page
.
within
first
(
'.content-list .member'
)
do
expect
(
page
).
to
have_content
(
group
.
name
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment