mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-29 11:49:37 +00:00
Fixed that boolean custom field groups have same label for blank and false values (#18894).
git-svn-id: http://svn.redmine.org/redmine/trunk@13921 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
93ced61b2a
commit
0cde1fccbc
@ -22,7 +22,7 @@
|
||||
<tr class="group open">
|
||||
<td colspan="<%= query.inline_columns.size + 2 %>">
|
||||
<span class="expander" onclick="toggleRowGroup(this);"> </span>
|
||||
<%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span>
|
||||
<%= (group.blank? && group != false) ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span>
|
||||
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
|
||||
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
|
||||
</td>
|
||||
|
||||
@ -294,6 +294,22 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_index_grouped_by_boolean_custom_field_should_distinguish_blank_and_false_values
|
||||
cf = IssueCustomField.create!(:name => 'Bool', :is_for_all => true, :tracker_ids => [1,2,3], :field_format => 'bool')
|
||||
CustomValue.create!(:custom_field => cf, :customized => Issue.find(1), :value => '1')
|
||||
CustomValue.create!(:custom_field => cf, :customized => Issue.find(2), :value => '0')
|
||||
CustomValue.create!(:custom_field => cf, :customized => Issue.find(3), :value => '')
|
||||
|
||||
with_settings :default_language => 'en' do
|
||||
get :index, :project_id => 1, :set_filter => 1, :group_by => "cf_#{cf.id}"
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
assert_select 'tr.group', :text => /Yes/
|
||||
assert_select 'tr.group', :text => /No/
|
||||
assert_select 'tr.group', :text => /none/
|
||||
end
|
||||
|
||||
def test_index_with_query_grouped_by_tracker_in_normal_order
|
||||
3.times {|i| Issue.generate!(:tracker_id => (i + 1))}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user