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
f5645355
Commit
f5645355
authored
Aug 05, 2016
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to edit access expiration date.
parent
245f237d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
11 deletions
+26
-11
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+1
-1
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+3
-1
features/steps/group/members.rb
features/steps/group/members.rb
+1
-1
features/steps/project/team_management.rb
features/steps/project/team_management.rb
+1
-1
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
...s/members/master_adds_member_with_expiration_date_spec.rb
+20
-7
No files found.
app/controllers/projects/project_members_controller.rb
View file @
f5645355
...
...
@@ -99,7 +99,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
protected
def
member_params
params
.
require
(
:project_member
).
permit
(
:user_id
,
:access_level
)
params
.
require
(
:project_member
).
permit
(
:user_id
,
:access_level
,
:expires_at
)
end
# MembershipActions concern
...
...
app/views/shared/members/_member.html.haml
View file @
f5645355
...
...
@@ -16,7 +16,7 @@
=
button_tag
icon
(
'pencil'
),
type:
'button'
,
class:
'btn inline js-toggle-button'
,
title:
'Edit
access level
'
title:
'Edit'
-
if
member
.
request?
=
link_to
icon
(
'check inverse'
),
polymorphic_path
([
:approve_access_request
,
member
]),
...
...
@@ -80,5 +80,7 @@
=
form_for
member
,
remote:
true
do
|
f
|
.prepend-top-10
=
f
.
select
:access_level
,
options_for_select
(
member
.
class
.
access_level_roles
,
member
.
access_level
),
{},
class:
'form-control'
.prepend-top-10
=
f
.
text_field
:expires_at
,
class:
'form-control'
,
placeholder:
'Access expiration date'
.prepend-top-10
=
f
.
submit
'Save'
,
class:
'btn btn-save btn-sm'
features/steps/group/members.rb
View file @
f5645355
...
...
@@ -116,7 +116,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
member
=
mary_jane_member
page
.
within
"#group_member_
#{
member
.
id
}
"
do
click_button
"Edit access level"
click_button
'Edit'
select
'Developer'
,
from:
'group_member_access_level'
click_on
'Save'
end
...
...
features/steps/project/team_management.rb
View file @
f5645355
...
...
@@ -65,7 +65,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
user
=
User
.
find_by
(
name:
'Dmitriy'
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
page
.
within
"#project_member_
#{
project_member
.
id
}
"
do
click_button
"Edit access level"
click_button
'Edit'
select
"Reporter"
,
from:
"project_member_access_level"
click_button
"Save"
end
...
...
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
View file @
f5645355
...
...
@@ -10,18 +10,31 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
background
do
project
.
team
<<
[
master
,
:master
]
login_as
(
master
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
end
scenario
'expiration date is displayed in the members list'
do
page
.
within
".users-project-form"
do
select2
(
new_member
.
id
,
from:
"#user_ids"
,
multiple:
true
)
fill_in
"Access expiration date"
,
with:
4
.
days
.
from_now
click_on
"Add users to project"
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
page
.
within
'.users-project-form'
do
select2
(
new_member
.
id
,
from:
'#user_ids'
,
multiple:
true
)
fill_in
'Access expiration date'
,
with:
4
.
days
.
from_now
click_on
'Add users to project'
end
page
.
within
'.project_member:first-child'
do
expect
(
page
).
to
have_content
(
'Expires in 4 days'
)
end
end
page
.
within
".project_member:first-child"
do
expect
(
page
).
to
have_content
(
"Expires in 4 days"
)
scenario
'change expiration date'
do
project
.
team
.
add_users
([
new_member
.
id
],
:developer
,
expires_at:
1
.
month
.
from_now
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
page
.
within
'.project_member:first-child'
do
click_on
'Edit'
fill_in
'Access expiration date'
,
with:
2
.
days
.
from_now
click_on
'Save'
expect
(
page
).
to
have_content
(
'Expires in 2 days'
)
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