From 71f43a2723d4db25a52e891c69a415d19836ff4f Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Mon, 27 Jan 2020 23:48:25 +0200 Subject: [PATCH] Fix totals not displayed in projects list view --- app/views/projects/_list.html.erb | 1 + public/stylesheets/application.css | 3 ++- test/functional/projects_controller_test.rb | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/views/projects/_list.html.erb b/app/views/projects/_list.html.erb index 8d8c0d9c1..3c90921ec 100644 --- a/app/views/projects/_list.html.erb +++ b/app/views/projects/_list.html.erb @@ -1,3 +1,4 @@ +<%= render_query_totals(@query) %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index cac1d3fd4..dcada0e46 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -405,7 +405,8 @@ div.table-list.boards .table-list-cell.name {width: 30%;} .query-totals {text-align:right;} .query-totals>span:not(:first-child) {margin-left:0.6em;} .query-totals .value {font-weight:bold;} -body.controller-issues .query-totals {margin-top:-2.3em;} +.query-totals {margin-top:-2.3em;} +body.controller-timelog .query-totals {margin-top:initial;} td.center {text-align:center;} diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 786bcebba..6be670566 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -230,6 +230,24 @@ class ProjectsControllerTest < Redmine::ControllerTest ) end + def test_index_with_int_custom_field_total + @request.session[:user_id] = 1 + + field = ProjectCustomField.generate!(:field_format => 'int') + CustomValue.create!(:customized => Project.find(1), :custom_field => field, :value => '2') + CustomValue.create!(:customized => Project.find(2), :custom_field => field, :value => '7') + get( + :index, + :params => { + :display_type => 'list', + :t => ["cf_#{field.id}"] + } + ) + assert_response :success + assert_select '.query-totals' + assert_select ".total-for-cf-#{field.id} span.value", :text => '9' + end + def test_autocomplete_js get( :autocomplete, -- 2.22.0