##// END OF EJS Templates
Show warning when exported issues exceed the limit (#13770)....
Jean-Philippe Lang -
r12388:f890c775f1b1
parent child
Show More
@@ -66,7 +66,7
66
66
67 <% other_formats_links do |f| %>
67 <% other_formats_links do |f| %>
68 <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
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 <%= f.link_to 'PDF', :url => params %>
70 <%= f.link_to 'PDF', :url => params %>
71 <% end %>
71 <% end %>
72
72
@@ -80,6 +80,11
80 <p>
80 <p>
81 <label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
81 <label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
82 </p>
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 <p class="buttons">
88 <p class="buttons">
84 <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
89 <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
85 <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
90 <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
@@ -373,6 +373,20 class IssuesControllerTest < ActionController::TestCase
373 assert_select 'form#csv-export-form[action=/issues.csv]'
373 assert_select 'form#csv-export-form[action=/issues.csv]'
374 end
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 def test_index_csv
390 def test_index_csv
377 get :index, :format => 'csv'
391 get :index, :format => 'csv'
378 assert_response :success
392 assert_response :success
General Comments 0
You need to be logged in to leave comments. Login now