From e2e4ddae7f7facf81e84df55d56b1a978bc16293 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Fri, 20 Mar 2020 00:31:26 +0200 Subject: [PATCH] Fix issues and spent time CSV export does not include custom fields with "Full width layout" enabled --- app/views/issues/index.html.erb | 5 +++-- app/views/timelog/index.html.erb | 5 +++++ test/functional/issues_controller_test.rb | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index fccf118c9..c4719569d 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -48,8 +48,9 @@

- - + <% @query.available_block_columns.each do |column| %> + + <% end %>

<%= export_csv_encoding_select_tag %> <% if @issue_count > Setting.issues_export_limit.to_i %> diff --git a/app/views/timelog/index.html.erb b/app/views/timelog/index.html.erb index b9afc7475..f60b51064 100644 --- a/app/views/timelog/index.html.erb +++ b/app/views/timelog/index.html.erb @@ -40,6 +40,11 @@

+

+ <% @query.available_block_columns.each do |column| %> + + <% end %> +

<%= export_csv_encoding_select_tag %>

<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);", :data => { :disable_with => false } %> diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index cb8a6703b..e27b3fdc9 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -777,6 +777,23 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select '#csv-export-form input[name=?][value=?]', 'f[]', '' end + def test_index_should_show_block_columns_in_csv_export_form + field = IssueCustomField. + create!( + :name => 'Long text', :field_format => 'text', + :full_width_layout => '1', + :tracker_ids => [1], :is_for_all => true + ) + get :index + + assert_response :success + assert_select '#csv-export-form' do + assert_select 'input[value=?]', 'description' + assert_select 'input[value=?]', 'last_notes' + assert_select 'input[value=?]', "cf_#{field.id}" + end + end + def test_index_csv get(:index, :params => {:format => 'csv'}) assert_response :success -- 2.22.0