##// END OF EJS Templates
Show warning when exported issues exceed the limit (#13770)....
Jean-Philippe Lang -
r12388:f890c775f1b1
parent child
Show More
@@ -66,12 +66,12
66 66
67 67 <% other_formats_links do |f| %>
68 68 <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
69 <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
69 <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '350px'); return false;" %>
70 70 <%= f.link_to 'PDF', :url => params %>
71 71 <% end %>
72 72
73 73 <div id="csv-export-options" style="display:none;">
74 <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
74 <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
75 75 <%= form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %>
76 76 <p>
77 77 <label><%= radio_button_tag 'columns', '', true %> <%= l(:description_selected_columns) %></label><br />
@@ -80,6 +80,11
80 80 <p>
81 81 <label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
82 82 </p>
83 <% if @issue_count > Setting.issues_export_limit.to_i %>
84 <p class="icon icon-warning">
85 <%= l(:setting_issues_export_limit) %>: <%= Setting.issues_export_limit.to_i %>
86 </p>
87 <% end %>
83 88 <p class="buttons">
84 89 <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
85 90 <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
@@ -373,6 +373,20 class IssuesControllerTest < ActionController::TestCase
373 373 assert_select 'form#csv-export-form[action=/issues.csv]'
374 374 end
375 375
376 def test_index_should_not_warn_when_not_exceeding_export_limit
377 with_settings :issues_export_limit => 200 do
378 get :index
379 assert_select '#csv-export-options p.icon-warning', 0
380 end
381 end
382
383 def test_index_should_warn_when_exceeding_export_limit
384 with_settings :issues_export_limit => 2 do
385 get :index
386 assert_select '#csv-export-options p.icon-warning', :text => %r{limit: 2}
387 end
388 end
389
376 390 def test_index_csv
377 391 get :index, :format => 'csv'
378 392 assert_response :success
General Comments 0
You need to be logged in to leave comments. Login now