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 @@ ...@@ -20,7 +20,7 @@
# #
class IssuableFinder class IssuableFinder
NONE = '0'.freeze 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 attr_accessor :current_user, :params
...@@ -78,7 +78,7 @@ class IssuableFinder ...@@ -78,7 +78,7 @@ class IssuableFinder
counts[:all] = counts.values.sum counts[:all] = counts.values.sum
counts[:opened] += counts[:reopened] counts[:opened] += counts[:reopened]
counts counts.with_indifferent_access
end end
def find_by!(*params) 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 %> <% 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. 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 @@ ...@@ -10,11 +10,11 @@
.modal-header .modal-header
= icon('check', { class: 'export-checkmark' }) = icon('check', { class: 'export-checkmark' })
%strong %strong
#{cached_issuables_count_for_state(:issues, params['state'])} issues selected #{cached_issuables_count_for_state(:issues, params[:state])} issues selected
.modal-body .modal-body
%div %div
The CSV export will be created in the background. Once it is finished, it will be attached to an email sent to The CSV export will be created in the background. Once finished, it will be sent to
= succeed '.' do %strong= @current_user.notification_email
%strong= @current_user.notification_email in an attachment.
.modal-footer .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' = 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 ...@@ -94,7 +94,7 @@ class CsvBuilder
@rows_written += 1 @rows_written += 1
if until_block.call if yield
@truncated = true @truncated = true
break break
end 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