1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 01:11:12 +00:00

Fix that column header is clickable even when the column is not actually sortable (#33548).

Patch by Vincent Robert and Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@20783 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2021-03-14 03:14:49 +00:00
parent 5063d3faf0
commit 83f3f45497
2 changed files with 11 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class QueryColumn
# Returns true if the column is sortable, otherwise false
def sortable?
!@sortable.nil?
@sortable.present?
end
def sortable

View File

@ -1707,6 +1707,16 @@ class QueryTest < ActiveSupport::TestCase
assert !q.sortable_columns['cf_1']
end
def test_sortable_should_return_false_for_multi_custom_field
field = CustomField.find(1)
field.update_attribute :multiple, true
q = IssueQuery.new
field_column = q.available_columns.detect {|c| c.name==:cf_1}
assert !field_column.sortable?
end
def test_default_sort
q = IssueQuery.new
assert_equal [['id', 'desc']], q.sort_criteria