Project

General

Profile

Feature #27821 » 27821.patch

Go MAEDA, 2023-04-08 10:37

View differences:

app/models/time_entry_query.rb
77 77
      :name => l("label_attribute_of_issue", :name => l(:field_category)),
78 78
      :values => lambda {project.issue_categories.collect{|s| [s.name, s.id.to_s]}}
79 79
    ) if project
80
    add_available_filter(
81
      "issue.subject",
82
      :type => :text,
83
      :name => l("label_attribute_of_issue", :name => l(:field_subject))
84
    )
80 85
    add_available_filter(
81 86
      "user_id",
82 87
      :type => :list_optional, :values => lambda {author_values}
......
222 227
    sql_for_field("category_id", operator, value, Issue.table_name, "category_id")
223 228
  end
224 229

  
230
  def sql_for_issue_subject_field(field, operator, value)
231
    sql_for_field("subject", operator, value, Issue.table_name, "subject")
232
  end
233

  
225 234
  def sql_for_project_status_field(field, operator, value, options={})
226 235
    sql_for_field(field, operator, value, Project.table_name, "status")
227 236
  end
test/functional/timelog_controller_test.rb
1258 1258
    assert_equal [entry].map(&:id).map(&:to_s), css_select('input[name="ids[]"]').map {|e| e.attr(:value)}
1259 1259
  end
1260 1260

  
1261
  def text_index_with_issue_subject_filter
1262
    get(
1263
      :index,
1264
      :params => {
1265
        :f => ['issue.subject'],
1266
        :op => {'issue.subject' => '~'},
1267
        :v => {'issue.subject' => ['"updating a recipe"']}
1268
      }
1269
    )
1270
    assert_response :success
1271
    assert_equal [3], css_select('input[name="ids[]"]').map {|e| e.attr(:value)}
1272
  end
1273

  
1261 1274
  def test_index_with_project_status_filter
1262 1275
    project = Project.find(3)
1263 1276
    project.close
(3-3/3)