Commit ea7e8eaf authored by James Edwards-Jones's avatar James Edwards-Jones

CSV export fixes from review.

IssuableFinder#count_by_state called from cached_assigned_issuables_count with a string state was causing incorrect values to be cached.
Improvements to wording and rubocop fixes.
parent efd8b516
......@@ -20,7 +20,7 @@
#
class IssuableFinder
NONE = '0'.freeze
VALID_PARAMS = %i(scope state group_id project_id milestone_title assignee_id search label_name sort).freeze
VALID_PARAMS = %i(scope state group_id project_id milestone_title assignee_id search label_name sort assignee_username author_id author_username authorized_only due_date iids non_archived weight).freeze
attr_accessor :current_user, :params
......@@ -78,7 +78,7 @@ class IssuableFinder
counts[:all] = counts.values.sum
counts[:opened] += counts[:reopened]
counts
counts.with_indifferent_access
end
def find_by!(*params)
......
Your CSV export of <%= @written_count %> issues from project <%= @project.full_name %> ( <%= project_url(@project) %> ) has been added to this email as an attachment.
Your CSV export of <%= @written_count %> issues from project <%= @project.full_name %> (<%= project_url(@project) %>) has been added to this email as an attachment.
<% if @truncated %>
This attachment has been truncated to avoid exceeding a maximum allowed attachment size of 20MB. <%= @written_count %> of <%= @issues_count %> issues have been included. Consider re-exporting with a narrower selection of issues.
......
......@@ -10,11 +10,11 @@
.modal-header
= icon('check', { class: 'export-checkmark' })
%strong
#{cached_issuables_count_for_state(:issues, params['state'])} issues selected
#{cached_issuables_count_for_state(:issues, params[:state])} issues selected
.modal-body
%div
The CSV export will be created in the background. Once it is finished, it will be attached to an email sent to
= succeed '.' do
The CSV export will be created in the background. Once finished, it will be sent to
%strong= @current_user.notification_email
in an attachment.
.modal-footer
= link_to 'Export issues', export_csv_namespace_project_issues_path(@project.namespace, @project, params.permit(IssuableFinder::VALID_PARAMS)), method: :post, class: 'btn btn-success pull-left', title: 'Export issues'
......@@ -94,7 +94,7 @@ class CsvBuilder
@rows_written += 1
if until_block.call
if yield
@truncated = true
break
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment