mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-24 15:54:00 +08:00
Add search for statuses
This commit is contained in:
parent
3bd44dc5ab
commit
87288d0771
3 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue