Project

General

Profile

Feature #4138 » 0002-Make-time-entries-searchable-by-their-custom-field-v.patch

Patch against trunk @ r21200. - Mischa The Evil, 2021-08-26 10:33

View differences:

app/views/custom_fields/_form.html.erb
<p><%= f.check_box :is_filter %></p>
<% end %>
<% if %w(IssueCustomField ProjectCustomField).include?(@custom_field.class.name) && @custom_field.format.searchable_supported %>
<% if %w(IssueCustomField ProjectCustomField TimeEntryCustomField).include?(@custom_field.class.name) && @custom_field.format.searchable_supported %>
<p><%= f.check_box :searchable %></p>
<% end %>
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
test/fixtures/custom_fields.yml
- Other value
field_format: list
position: 1
custom_fields_012:
name: Searchable time entry field
regexp: ""
is_for_all: false
is_filter: false
type: TimeEntryCustomField
possible_values: ""
id: 12
is_required: false
field_format: string
searchable: true
default_value: ""
editable: true
position: 2
test/fixtures/custom_values.yml
customized_id: 1
id: 17
value: '2009-12-01'
custom_values_018:
customized_type: TimeEntry
custom_field_id: 12
customized_id: 2
id: 18
value: "stringfortimeentry custom field search"
test/functional/search_controller_test.rb
end
end
def test_search_time_entries_searchable_custom_fields_on_project
get :index, :params => {:id => 1, :q => "stringfortimeentry", :time_entries => 1}
assert_response :success
assert_select '#search-results' do
assert_select 'dt.time-entry', 1
assert_select 'dt.time-entry span.project', 0
assert_select 'dt.time-entry a', :text => /150.00 hours \(Bug #1 \(New\): Cannot print recipes\)/
end
end
def test_search_all_projects_with_scope_param
get :index, :params => {:q => 'issue', :scope => 'all'}
assert_response :success
(4-4/4)