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
17600f5f
Commit
17600f5f
authored
Oct 07, 2016
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issues CSV uses Excel compatible dates
parent
91296aff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
app/views/projects/issues/index.csv.ruby
app/views/projects/issues/index.csv.ruby
+3
-3
spec/features/issues/csv_spec.rb
spec/features/issues/csv_spec.rb
+21
-1
No files found.
app/views/projects/issues/index.csv.ruby
View file @
17600f5f
...
@@ -6,9 +6,9 @@ columns = {
...
@@ -6,9 +6,9 @@ columns = {
'Author'
=>
'author_name'
,
'Author'
=>
'author_name'
,
'Assignee'
=>
'assignee_name'
,
'Assignee'
=>
'assignee_name'
,
'Confidential'
=>
'confidential'
,
'Confidential'
=>
'confidential'
,
'Due Date'
=>
'due_date'
,
'Due Date'
=>
->
(
issue
)
{
issue
.
due_date
&
.
strftime
(
'%Y-%m-%d'
)
}
,
'Created At
'
=>
'created_at'
,
'Created At
(UTC)'
=>
->
(
issue
)
{
issue
.
created_at
&
.
strftime
(
'%Y-%m-%d %H:%M:%S'
)
}
,
'Updated At
'
=>
'updated_at'
,
'Updated At
(UTC)'
=>
->
(
issue
)
{
issue
.
updated_at
&
.
strftime
(
'%Y-%m-%d %H:%M:%S'
)
}
,
'Milestone'
=>
->
(
issue
)
{
issue
.
milestone
&
.
title
},
'Milestone'
=>
->
(
issue
)
{
issue
.
milestone
&
.
title
},
'Labels'
=>
->
(
issue
)
{
issue
.
label_names
.
join
(
','
).
presence
},
'Labels'
=>
->
(
issue
)
{
issue
.
label_names
.
join
(
','
).
presence
},
}
}
...
...
spec/features/issues/csv_spec.rb
View file @
17600f5f
...
@@ -29,7 +29,14 @@ describe 'Issues csv', feature: true do
...
@@ -29,7 +29,14 @@ describe 'Issues csv', feature: true do
let
(
:milestone
)
{
create
(
:milestone
,
title:
"v1.0"
,
project:
project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
title:
"v1.0"
,
project:
project
)
}
before
do
before
do
issue
.
update!
(
milestone:
milestone
,
assignee:
user
,
description:
'Issue with details'
,
labels:
[
label1
,
label2
])
issue
.
update!
(
milestone:
milestone
,
assignee:
user
,
description:
'Issue with details'
,
due_date:
DateTime
.
new
(
2014
,
3
,
2
),
created_at:
DateTime
.
new
(
2015
,
4
,
3
,
2
,
1
,
0
),
updated_at:
DateTime
.
new
(
2016
,
5
,
4
,
3
,
2
,
1
),
labels:
[
label1
,
label2
])
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
format: :csv
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
format: :csv
)
end
end
...
@@ -60,6 +67,19 @@ describe 'Issues csv', feature: true do
...
@@ -60,6 +67,19 @@ describe 'Issues csv', feature: true do
specify
'labels'
do
specify
'labels'
do
expect
(
csv
[
0
][
'Labels'
]).
to
eq
'Feature,labels'
expect
(
csv
[
0
][
'Labels'
]).
to
eq
'Feature,labels'
end
end
specify
'due_date'
do
expect
(
csv
[
0
][
'Due Date'
]).
to
eq
'2014-03-02'
end
specify
'created_at'
do
expect
(
csv
[
0
][
'Created At (UTC)'
]).
to
eq
'2015-04-03 02:01:00'
end
specify
'updated_at'
do
expect
(
csv
[
0
][
'Updated At (UTC)'
]).
to
eq
'2016-05-04 03:02:01'
end
end
end
context
'with minimal details'
do
context
'with minimal details'
do
...
...
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