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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
3e19f197
Commit
3e19f197
authored
Sep 02, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with invited users not showing up
parent
cdc55db3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+13
-1
app/models/project_team.rb
app/models/project_team.rb
+4
-4
app/views/projects/project_members/_team.html.haml
app/views/projects/project_members/_team.html.haml
+2
-3
No files found.
app/controllers/projects/project_members_controller.rb
View file @
3e19f197
...
...
@@ -6,7 +6,19 @@ class Projects::ProjectMembersController < Projects::ApplicationController
def
index
@groups
=
@project
.
project_group_links
@project_members
=
@project
.
team
.
members
(
!
can?
(
current_user
,
:admin_project
,
@project
))
members
=
[]
project_members
=
@project
.
project_members
project_members
=
project_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
members
<<
project_members
.
pluck
(
:id
)
if
@project
.
group
group_members
=
@project
.
group
.
group_members
group_members
=
group_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
members
<<
group_members
.
pluck
(
:id
)
end
@project_members
=
Member
.
where
(
id:
members
)
@project_members_size
=
@project_members
.
size
if
params
[
:search
].
present?
...
...
app/models/project_team.rb
View file @
3e19f197
...
...
@@ -52,8 +52,8 @@ class ProjectTeam
ProjectMember
.
truncate_team
(
project
)
end
def
members
(
non_invite
=
false
)
@members
||=
fetch_members
(
nil
,
non_invite
)
def
members
@members
||=
fetch_members
end
alias_method
:users
,
:members
...
...
@@ -197,7 +197,7 @@ class ProjectTeam
access
.
each
{
|
key
,
value
|
access
[
key
]
=
[
value
,
capped_access_level
].
min
}
end
def
fetch_members
(
level
=
nil
,
non_invite
=
false
)
def
fetch_members
(
level
=
nil
)
project_members
=
project
.
members
group_members
=
group
?
group
.
members
:
[]
invited_members
=
[]
...
...
@@ -236,7 +236,7 @@ class ProjectTeam
end
user_ids
=
project_members
.
pluck
(
:user_id
)
user_ids
.
push
(
*
invited_members
.
map
(
&
:user_id
))
if
invited_members
.
any?
&&
non_invite
user_ids
.
push
(
*
invited_members
.
map
(
&
:user_id
))
if
invited_members
.
any?
user_ids
.
push
(
*
group_members
.
pluck
(
:user_id
))
if
group
User
.
where
(
id:
user_ids
)
...
...
app/views/projects/project_members/_team.html.haml
View file @
3e19f197
...
...
@@ -4,6 +4,5 @@
%strong
#{
@project
.
name
}
%span
.badge
=
@project_members_size
%ul
.content-list
-
members
.
each
do
|
user
|
-
member
=
@project
.
team
.
find_member
(
user
.
id
)
=
render
'shared/members/member'
,
member:
member
,
user:
user
-
members
.
each
do
|
member
|
=
render
'shared/members/member'
,
member:
member
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