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
c3e93f86
Commit
c3e93f86
authored
Aug 02, 2018
by
Jan Provaznik
Committed by
Sean McGivern
Aug 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore sorting parameter when exporting issues to CSV
parent
7a610b64
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
2 deletions
+28
-2
doc/user/project/issues/csv_export.md
doc/user/project/issues/csv_export.md
+4
-0
ee/app/workers/export_csv_worker.rb
ee/app/workers/export_csv_worker.rb
+3
-1
ee/changelogs/unreleased/fix-csv-labels.yml
ee/changelogs/unreleased/fix-csv-labels.yml
+5
-0
ee/spec/features/issues/csv_spec.rb
ee/spec/features/issues/csv_spec.rb
+10
-1
ee/spec/workers/export_csv_worker_spec.rb
ee/spec/workers/export_csv_worker_spec.rb
+6
-0
No files found.
doc/user/project/issues/csv_export.md
View file @
c3e93f86
...
...
@@ -36,6 +36,10 @@ You will be asked to confirm the number of issues and email address for the expo
![
CSV export modal dialog
](
img/csv_export_modal.png
)
## Sorting
Exported issues are always sorted by
`Issue ID`
.
## Format
> **Time Estimate** and **Time Spent** columns were [introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2627) in GitLab Starter 10.0.
...
...
ee/app/workers/export_csv_worker.rb
View file @
c3e93f86
...
...
@@ -5,9 +5,11 @@ class ExportCsvWorker
@current_user
=
User
.
find
(
current_user_id
)
@project
=
Project
.
find
(
project_id
)
params
.
symbolize_keys!
params
[
:project_id
]
=
project_id
params
.
delete
(
:sort
)
issues
=
IssuesFinder
.
new
(
@current_user
,
params
.
symbolize_keys
).
execute
issues
=
IssuesFinder
.
new
(
@current_user
,
params
).
execute
Issues
::
ExportCsvService
.
new
(
issues
).
email
(
@current_user
,
@project
)
end
...
...
ee/changelogs/unreleased/fix-csv-labels.yml
0 → 100644
View file @
c3e93f86
---
title
:
Fix exporting issues to CSV when sorting by label priority is used.
merge_request
:
author
:
type
:
fixed
ee/spec/features/issues/csv_spec.rb
View file @
c3e93f86
...
...
@@ -5,7 +5,7 @@ describe 'Issues csv' do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:milestone
)
{
create
(
:milestone
,
title:
'v1.0'
,
project:
project
)
}
let
(
:idea_label
)
{
create
(
:label
,
project:
project
,
title:
'Idea'
)
}
let
(
:feature_label
)
{
create
(
:label
,
project:
project
,
title:
'Feature'
)
}
let
(
:feature_label
)
{
create
(
:label
,
project:
project
,
title:
'Feature'
,
priority:
10
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
before
do
...
...
@@ -67,6 +67,15 @@ describe 'Issues csv' do
expect
(
csv
.
count
).
to
eq
0
end
it
'ignores sorting from issue index'
do
issue2
=
create
(
:labeled_issue
,
project:
project
,
author:
user
,
labels:
[
feature_label
])
request_csv
(
sort: :label_priority
)
expected
=
[
issue
.
iid
.
to_s
,
issue2
.
iid
.
to_s
]
expect
(
csv
.
map
{
|
row
|
row
[
'Issue ID'
]
}).
to
eq
expected
end
it
'uses array filters, such as label_name'
do
issue
.
update!
(
labels:
[
idea_label
])
...
...
ee/spec/workers/export_csv_worker_spec.rb
View file @
c3e93f86
...
...
@@ -18,6 +18,12 @@ describe ExportCsvWorker do
perform
end
it
'removes sort parameter'
do
expect
(
IssuesFinder
).
to
receive
(
:new
).
with
(
anything
,
hash_not_including
(
:sort
)).
and_call_original
perform
end
it
'converts controller string keys to symbol keys for IssuesFinder'
do
expect
(
IssuesFinder
).
to
receive
(
:new
).
with
(
anything
,
hash_including
(
test_key:
true
)).
and_call_original
...
...
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