mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +00:00
Totals cannot be removed completely if some columns are set in the global settings (#22123).
git-svn-id: http://svn.redmine.org/redmine/trunk@15510 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c713aba762
commit
246368a090
@ -89,6 +89,7 @@ module QueriesHelper
|
|||||||
query.available_totalable_columns.each do |column|
|
query.available_totalable_columns.each do |column|
|
||||||
tags << content_tag('label', check_box_tag('t[]', column.name.to_s, query.totalable_columns.include?(column), :id => nil) + " #{column.caption}", :class => 'inline')
|
tags << content_tag('label', check_box_tag('t[]', column.name.to_s, query.totalable_columns.include?(column), :id => nil) + " #{column.caption}", :class => 'inline')
|
||||||
end
|
end
|
||||||
|
tags << hidden_field_tag('t[]', '')
|
||||||
tags
|
tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -290,4 +290,24 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
|
|||||||
assert Issue.find(1).watched_by?(User.find_by_login('jsmith'))
|
assert Issue.find(1).watched_by?(User.find_by_login('jsmith'))
|
||||||
assert Issue.find(4).watched_by?(User.find_by_login('jsmith'))
|
assert Issue.find(4).watched_by?(User.find_by_login('jsmith'))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_issue_list_with_default_totalable_columns
|
||||||
|
log_user('admin', 'admin')
|
||||||
|
with_settings :issue_list_default_totals => ['estimated_hours'] do
|
||||||
|
visit '/projects/ecookbook/issues'
|
||||||
|
# Check that the page shows the Estimated hours total
|
||||||
|
assert page.has_css?('p.query-totals')
|
||||||
|
assert page.has_css?('span.total-for-estimated-hours')
|
||||||
|
# Open the Options of the form (necessary for having the totalable columns options clickable)
|
||||||
|
page.all('legend')[1].click
|
||||||
|
# Deselect the default totalable column (none should be left)
|
||||||
|
page.first('input[name="t[]"][value="estimated_hours"]').click
|
||||||
|
within('#query_form') do
|
||||||
|
click_link 'Apply'
|
||||||
|
end
|
||||||
|
# Check that Totals are not present in the reloaded page
|
||||||
|
assert !page.has_css?('p.query-totals')
|
||||||
|
assert !page.has_css?('span.total-for-estimated-hours')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user