Project

General

Profile

Patch #26674 » additional_css_for_query_column_headers.patch

Marius BĂLTEANU, 2017-12-18 23:45

View differences:

app/helpers/queries_helper.rb
195 195
    else
196 196
      content = column.caption
197 197
    end
198
    content_tag('th', content)
198
    content_tag('th', content, :class => column.css_classes)
199 199
  end
200 200

  
201 201
  def column_content(column, item)
test/functional/issues_controller_test.rb
1012 1012
    assert_response :success
1013 1013

  
1014 1014
    # query should use specified columns + id and checkbox
1015
    assert_select 'table.issues thead th', columns.size + 2
1015
    assert_select 'table.issues thead' do
1016
      assert_select 'th', columns.size + 2
1017
      assert_select 'th.tracker'
1018
      assert_select 'th.subject'
1019
      assert_select 'th.assigned_to'
1020
    end
1016 1021

  
1017 1022
    # columns should be stored in session
1018 1023
    assert_kind_of Hash, session[:issue_query]
......
1073 1078

  
1074 1079
    # query should use specified columns
1075 1080
    assert_equal ["#", "Tracker", "Subject", "Searchable field"], columns_in_issues_list
1076
    assert_select 'table.issues td.cf_2.string'
1081
    assert_select 'table.issues' do
1082
      assert_select 'th.cf_2.string'
1083
      assert_select 'td.cf_2.string'
1084
    end
1077 1085
  end
1078 1086

  
1079 1087
  def test_index_with_multi_custom_field_column
......
1119 1127
          :set_filter => 1,
1120 1128
          :c => %w(start_date)
1121 1129
        }
1122
      assert_select "table.issues td.start_date", :text => '24/08/1987'
1130
      assert_select 'table.issues' do
1131
        assert_select 'th.start_date'
1132
        assert_select 'td.start_date', :text => '24/08/1987'
1133
      end
1123 1134
    end
1124 1135
  end
1125 1136

  
test/functional/timelog_controller_test.rb
721 721
      assert_response :success
722 722
    end
723 723

  
724
    assert_select 'table.time-entries thead' do
725
      assert_select 'th.spent_on'
726
      assert_select 'th.issue'
727
      assert_select 'th.user'
728
      assert_select 'th.hours'
729
    end
730
    assert_select 'table.time-entries tbody' do
731
      assert_select 'td.spent_on'
732
      assert_select 'td.issue'
733
      assert_select 'td.user'
734
      assert_select 'td.hours'
735
    end
724 736
    assert_equal ['Date', 'Issue', 'User', 'Hours'], columns_in_list
725 737
  end
726 738

  
......
947 959
      :c => %w(project spent_on issue comments hours issue.status)
948 960
    }
949 961
    assert_response :success
962

  
963
    assert_select 'th.issue-status'
950 964
    assert_select 'td.issue-status', :text => issue.status.name
951 965
  end
952 966

  
......
1059 1073
      :sort => field_name
1060 1074
    }
1061 1075
    assert_response :success
1062
    assert_select "th a.sort", :text => 'String Field'
1076
    assert_select "th.cf_#{field.id} a.sort", :text => 'String Field'
1063 1077

  
1064 1078
    # Make sure that values are properly sorted
1065 1079
    values = css_select("td.#{field_name}").map(&:text).reject(&:blank?)
(2-2/2)