Add search for statuses

This commit is contained in:
Urban Rotnik 2020-01-06 09:39:38 +01:00
parent 3bd44dc5ab
commit 87288d0771
3 changed files with 4 additions and 2 deletions

View file

@ -14,7 +14,7 @@ class RepositoryNumberValue < ApplicationRecord
SORTABLE_VALUE_INCLUDE = :repository_number_value
def formatted
data
data.to_s
end
def data_changed?(new_data)

View file

@ -24,7 +24,7 @@
<% repository_row.repository_cells.each do |cell| %>
<span>
<%=t "search.index.repositories.custom_column", column: cell.repository_column.name %>
<%= highlight cell.value.data, search_query.strip.split(/\s+/) %>
<%= highlight cell.value.formatted, search_query.strip.split(/\s+/) %>
</span>
<br>
<% end %>

View file

@ -64,12 +64,14 @@ class Extends
REPOSITORY_EXTRA_SEARCH_ATTR = ['repository_text_values.data',
'repository_list_items.data',
'repository_checklist_items.data',
'repository_status_items.status',
'active_storage_blobs.filename']
# Array of includes used in search query for repository rows
REPOSITORY_SEARCH_INCLUDES = [:repository_text_value,
repository_list_value: :repository_list_item,
repository_checklist_value: :repository_checklist_items,
repository_status_value: :repository_status_item,
repository_asset_value: { asset: { file_attachment: :blob } }]
# List of implemented core API versions