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
Jérome Perrin
gitlab-ce
Commits
2c3fa33c
Commit
2c3fa33c
authored
Sep 02, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated some specs
Fixed issue with group name not showing
parent
ccf76831
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
24 deletions
+24
-24
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+9
-10
app/views/projects/project_members/_team.html.haml
app/views/projects/project_members/_team.html.haml
+1
-1
app/views/projects/project_members/index.html.haml
app/views/projects/project_members/index.html.haml
+2
-2
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+4
-3
features/steps/group/members.rb
features/steps/group/members.rb
+4
-4
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
...s/members/master_adds_member_with_expiration_date_spec.rb
+4
-4
No files found.
app/controllers/projects/project_members_controller.rb
View file @
2c3fa33c
...
@@ -7,7 +7,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
...
@@ -7,7 +7,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
def
index
def
index
@groups
=
@project
.
project_group_links
@groups
=
@project
.
project_group_links
members
=
[]
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
)
...
@@ -16,25 +15,25 @@ class Projects::ProjectMembersController < Projects::ApplicationController
...
@@ -16,25 +15,25 @@ class Projects::ProjectMembersController < Projects::ApplicationController
project_members
=
project_members
.
where
(
user_id:
users
)
project_members
=
project_members
.
where
(
user_id:
users
)
end
end
members
<<
project_members
.
pluck
(
:id
)
members
_ids
=
project_members
.
pluck
(
:id
)
@
group
=
@project
.
group
group
=
@project
.
group
if
@
group
if
group
group_members
=
@
group
.
group_members
group_members
=
group
.
group_members
group_members
=
group_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
group_members
=
group_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
if
params
[
:search
].
present?
if
params
[
:search
].
present?
users
=
@
group
.
users
.
search
(
params
[
:search
]).
to_a
users
=
group
.
users
.
search
(
params
[
:search
]).
to_a
group_members
=
group_members
.
where
(
user_id:
users
)
group_members
=
group_members
.
where
(
user_id:
users
)
end
end
members
<<
group_members
.
pluck
(
:id
)
members
_ids
<<
group_members
.
pluck
(
:id
)
end
end
@
project_members
=
Member
.
where
(
id:
members
)
@
members
=
Member
.
where
(
id:
members_ids
.
flatten
)
@
project_members_size
=
@project_
members
.
size
@
members_size
=
@
members
.
size
@
project_members
=
@project_
members
.
page
(
params
[
:page
])
@
members
=
@
members
.
page
(
params
[
:page
])
@requesters
=
@project
.
requesters
if
can?
(
current_user
,
:admin_project
,
@project
)
@requesters
=
@project
.
requesters
if
can?
(
current_user
,
:admin_project
,
@project
)
...
...
app/views/projects/project_members/_team.html.haml
View file @
2c3fa33c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.panel-heading
.panel-heading
Users with access to
Users with access to
%strong
#{
@project
.
name
}
%strong
#{
@project
.
name
}
%span
.badge
=
@
project_
members_size
%span
.badge
=
@members_size
%ul
.content-list
%ul
.content-list
-
members
.
each
do
|
member
|
-
members
.
each
do
|
member
|
=
render
'shared/members/member'
,
member:
member
=
render
'shared/members/member'
,
member:
member
app/views/projects/project_members/index.html.haml
View file @
2c3fa33c
...
@@ -25,5 +25,5 @@
...
@@ -25,5 +25,5 @@
-
if
@groups
.
size
>
0
-
if
@groups
.
size
>
0
=
render
'groups'
,
groups:
@groups
=
render
'groups'
,
groups:
@groups
=
render
'team'
,
members:
@
project_
members
=
render
'team'
,
members:
@members
=
paginate
@
project_
members
,
theme:
"gitlab"
=
paginate
@members
,
theme:
"gitlab"
app/views/shared/members/_member.html.haml
View file @
2c3fa33c
-
show_roles
=
local_assigns
.
fetch
(
:show_roles
,
true
)
-
show_roles
=
local_assigns
.
fetch
(
:show_roles
,
true
)
-
show_controls
=
local_assigns
.
fetch
(
:show_controls
,
true
)
-
show_controls
=
local_assigns
.
fetch
(
:show_controls
,
true
)
-
user
=
local_assigns
.
fetch
(
:user
,
member
.
user
)
-
user
=
local_assigns
.
fetch
(
:user
,
member
.
user
)
-
source
=
member
.
source
%li
.member
{
class:
dom_class
(
member
),
id:
dom_id
(
member
)
}
%li
.member
{
class:
dom_class
(
member
),
id:
dom_id
(
member
)
}
%span
{
class:
(
"list-item-name"
if
show_controls
)
}
%span
{
class:
(
"list-item-name"
if
show_controls
)
}
...
@@ -17,9 +18,9 @@
...
@@ -17,9 +18,9 @@
%label
.label.label-danger
%label
.label.label-danger
%strong
Blocked
%strong
Blocked
-
if
member
.
respond_to?
(
:g
roup
)
&&
!
@group
-
if
source
.
instance_of?
(
G
roup
)
&&
!
@group
=
link_to
member
.
group
,
class:
"member-group-link prepend-left-5"
do
=
link_to
source
,
class:
"member-group-link prepend-left-5"
do
=
"·
#{
member
.
group
.
name
}
"
=
"·
#{
source
.
name
}
"
.hidden-xs.cgray
.hidden-xs.cgray
-
if
member
.
request?
-
if
member
.
request?
...
...
features/steps/group/members.rb
View file @
2c3fa33c
...
@@ -14,7 +14,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
...
@@ -14,7 +14,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
click_button
"Add
users
to group"
click_button
"Add to group"
end
end
step
'I select "Mike" as "Master"'
do
step
'I select "Mike" as "Master"'
do
...
@@ -25,7 +25,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
...
@@ -25,7 +25,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
select
"Master"
,
from:
"access_level"
select
"Master"
,
from:
"access_level"
end
end
click_button
"Add
users
to group"
click_button
"Add to group"
end
end
step
'I should see "Mike" in team list as "Reporter"'
do
step
'I should see "Mike" in team list as "Reporter"'
do
...
@@ -48,7 +48,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
...
@@ -48,7 +48,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
click_button
"Add
users
to group"
click_button
"Add to group"
end
end
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
step
'I should see "sjobs@apple.com" in team list as invited "Reporter"'
do
...
@@ -67,7 +67,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
...
@@ -67,7 +67,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
select
"Reporter"
,
from:
"access_level"
select
"Reporter"
,
from:
"access_level"
end
end
click_button
"Add
users
to group"
click_button
"Add to group"
end
end
step
'I should see user "John Doe" in team list'
do
step
'I should see user "John Doe" in team list'
do
...
...
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
View file @
2c3fa33c
require
'spec_helper'
require
'spec_helper'
feature
'Projects > Members > Master adds member with expiration date'
,
feature:
true
,
js:
true
do
feature
'Projects > Members > Master adds member with expiration date'
,
feature:
true
,
js:
true
do
include
WaitForAjax
include
Select2Helper
include
Select2Helper
include
ActiveSupport
::
Testing
::
TimeHelpers
include
ActiveSupport
::
Testing
::
TimeHelpers
...
@@ -20,7 +21,7 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -20,7 +21,7 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
page
.
within
'.users-project-form'
do
page
.
within
'.users-project-form'
do
select2
(
new_member
.
id
,
from:
'#user_ids'
,
multiple:
true
)
select2
(
new_member
.
id
,
from:
'#user_ids'
,
multiple:
true
)
fill_in
'expires_at'
,
with:
'2016-08-10'
fill_in
'expires_at'
,
with:
'2016-08-10'
click_on
'Add
users
to project'
click_on
'Add to project'
end
end
page
.
within
'.project_member:first-child'
do
page
.
within
'.project_member:first-child'
do
...
@@ -35,9 +36,8 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -35,9 +36,8 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
page
.
within
'.project_member:first-child'
do
page
.
within
'.project_member:first-child'
do
click_on
'Edit'
find
(
'.js-access-expiration-date'
).
set
'2016-08-09'
fill_in
'Access expiration date'
,
with:
'2016-08-09'
wait_for_ajax
click_on
'Save'
expect
(
page
).
to
have_content
(
'Expires in 3 days'
)
expect
(
page
).
to
have_content
(
'Expires in 3 days'
)
end
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