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
Léo-Paul Géneau
gitlab-ce
Commits
12cc9a53
Commit
12cc9a53
authored
Jan 30, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed date check test
parent
5942247d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
31 deletions
+29
-31
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+1
-1
app/assets/javascripts/due_date_select.js.es6
app/assets/javascripts/due_date_select.js.es6
+2
-5
app/assets/javascripts/issuable_form.js
app/assets/javascripts/issuable_form.js
+1
-2
app/assets/javascripts/member_expiration_date.js.es6
app/assets/javascripts/member_expiration_date.js.es6
+1
-3
app/views/profiles/personal_access_tokens/index.html.haml
app/views/profiles/personal_access_tokens/index.html.haml
+1
-1
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
...s/members/master_adds_member_with_expiration_date_spec.rb
+23
-19
No files found.
app/assets/javascripts/application.js
View file @
12cc9a53
...
@@ -34,7 +34,7 @@ require('bootstrap/js/transition');
...
@@ -34,7 +34,7 @@ require('bootstrap/js/transition');
require
(
'
bootstrap/js/tooltip
'
);
require
(
'
bootstrap/js/tooltip
'
);
require
(
'
bootstrap/js/popover
'
);
require
(
'
bootstrap/js/popover
'
);
require
(
'
select2/select2.js
'
);
require
(
'
select2/select2.js
'
);
require
(
'
pikaday
'
);
window
.
Pikaday
=
require
(
'
pikaday
'
);
window
.
_
=
require
(
'
underscore
'
);
window
.
_
=
require
(
'
underscore
'
);
window
.
Dropzone
=
require
(
'
dropzone
'
);
window
.
Dropzone
=
require
(
'
dropzone
'
);
require
(
'
mousetrap
'
);
require
(
'
mousetrap
'
);
...
...
app/assets/javascripts/due_date_select.js.es6
View file @
12cc9a53
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
const calendar = new Pikaday({
const calendar = new Pikaday({
field: $dueDateInput.get(0),
field: $dueDateInput.get(0),
theme: 'gitlab-theme',
theme: 'gitlab-theme',
format: '
yyyy-mm-dd
',
format: '
YYYY-MM-DD
',
onSelect: (dateText) => {
onSelect: (dateText) => {
const formattedDate = dateFormat(new Date(dateText), 'yyyy-mm-dd');
const formattedDate = dateFormat(new Date(dateText), 'yyyy-mm-dd');
...
@@ -63,8 +63,6 @@
...
@@ -63,8 +63,6 @@
}
}
});
});
calendar.setDate(new Date($dueDateInput.val()));
this.$datePicker.append(calendar.el);
this.$datePicker.append(calendar.el);
this.$datePicker.data('pikaday', calendar);
this.$datePicker.data('pikaday', calendar);
}
}
...
@@ -171,12 +169,11 @@
...
@@ -171,12 +169,11 @@
const calendar = new Pikaday({
const calendar = new Pikaday({
field: $datePicker.get(0),
field: $datePicker.get(0),
theme: 'gitlab-theme',
theme: 'gitlab-theme',
format: '
yyyy-mm-dd
',
format: '
YYYY-MM-DD
',
onSelect(dateText) {
onSelect(dateText) {
$datePicker.val(dateFormat(new Date(dateText), 'yyyy-mm-dd'));
$datePicker.val(dateFormat(new Date(dateText), 'yyyy-mm-dd'));
}
}
});
});
calendar.setDate(new Date($datePicker.val()));
$datePicker.data('pikaday', calendar);
$datePicker.data('pikaday', calendar);
});
});
...
...
app/assets/javascripts/issuable_form.js
View file @
12cc9a53
...
@@ -40,12 +40,11 @@
...
@@ -40,12 +40,11 @@
calendar
=
new
Pikaday
({
calendar
=
new
Pikaday
({
field
:
$issuableDueDate
.
get
(
0
),
field
:
$issuableDueDate
.
get
(
0
),
theme
:
'
gitlab-theme
'
,
theme
:
'
gitlab-theme
'
,
format
:
'
yyyy-mm-dd
'
,
format
:
'
YYYY-MM-DD
'
,
onSelect
:
function
(
dateText
)
{
onSelect
:
function
(
dateText
)
{
$issuableDueDate
.
val
(
dateFormat
(
new
Date
(
dateText
),
'
yyyy-mm-dd
'
));
$issuableDueDate
.
val
(
dateFormat
(
new
Date
(
dateText
),
'
yyyy-mm-dd
'
));
}
}
});
});
calendar
.
setDate
(
new
Date
(
$issuableDueDate
.
val
()));
}
}
}
}
...
...
app/assets/javascripts/member_expiration_date.js.es6
View file @
12cc9a53
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
const calendar = new Pikaday({
const calendar = new Pikaday({
field: $input.get(0),
field: $input.get(0),
theme: 'gitlab-theme',
theme: 'gitlab-theme',
format: '
yyyy-mm-dd
',
format: '
YYYY-MM-DD
',
minDate: new Date(),
minDate: new Date(),
onSelect(dateText) {
onSelect(dateText) {
$input.val(dateFormat(new Date(dateText), 'yyyy-mm-dd'));
$input.val(dateFormat(new Date(dateText), 'yyyy-mm-dd'));
...
@@ -30,8 +30,6 @@
...
@@ -30,8 +30,6 @@
},
},
});
});
calendar.setDate(new Date($input.val()));
$input.data('pikaday', calendar);
$input.data('pikaday', calendar);
});
});
...
...
app/views/profiles/personal_access_tokens/index.html.haml
View file @
12cc9a53
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
new
Pikaday
({
new
Pikaday
({
field
:
$dateField
.
get
(
0
),
field
:
$dateField
.
get
(
0
),
theme
:
'
gitlab-theme
'
,
theme
:
'
gitlab-theme
'
,
format
:
'
yyyy-mm-dd
'
,
format
:
'
YYYY-MM-DD
'
,
minDate
:
new
Date
(),
minDate
:
new
Date
(),
onSelect
:
function
(
dateText
)
{
onSelect
:
function
(
dateText
)
{
$dateField
.
val
(
dateFormat
(
new
Date
(
dateText
),
'
yyyy-mm-dd
'
));
$dateField
.
val
(
dateFormat
(
new
Date
(
dateText
),
'
yyyy-mm-dd
'
));
...
...
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
View file @
12cc9a53
...
@@ -15,7 +15,8 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -15,7 +15,8 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
end
end
scenario
'expiration date is displayed in the members list'
do
scenario
'expiration date is displayed in the members list'
do
date
=
5
.
days
.
from_now
travel_to
Time
.
zone
.
parse
(
'2016-08-06 08:00'
)
do
date
=
4
.
days
.
from_now
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
page
.
within
'.users-project-form'
do
page
.
within
'.users-project-form'
do
...
@@ -28,9 +29,11 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -28,9 +29,11 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
expect
(
page
).
to
have_content
(
'Expires in 4 days'
)
expect
(
page
).
to
have_content
(
'Expires in 4 days'
)
end
end
end
end
end
scenario
'change expiration date'
do
scenario
'change expiration date'
do
date
=
4
.
days
.
from_now
travel_to
Time
.
zone
.
parse
(
'2016-08-06 08:00'
)
do
date
=
3
.
days
.
from_now
project
.
team
.
add_users
([
new_member
.
id
],
:developer
,
expires_at:
Date
.
today
.
to_s
(
:medium
))
project
.
team
.
add_users
([
new_member
.
id
],
:developer
,
expires_at:
Date
.
today
.
to_s
(
:medium
))
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
...
@@ -40,4 +43,5 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -40,4 +43,5 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
expect
(
page
).
to
have_content
(
'Expires in 3 days'
)
expect
(
page
).
to
have_content
(
'Expires in 3 days'
)
end
end
end
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