mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-25 00:03:27 +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
|
SORTABLE_VALUE_INCLUDE = :repository_number_value
|
||||||
|
|
||||||
def formatted
|
def formatted
|
||||||
data
|
data.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def data_changed?(new_data)
|
def data_changed?(new_data)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<% repository_row.repository_cells.each do |cell| %>
|
<% repository_row.repository_cells.each do |cell| %>
|
||||||
<span>
|
<span>
|
||||||
<%=t "search.index.repositories.custom_column", column: cell.repository_column.name %>
|
<%=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>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -64,12 +64,14 @@ class Extends
|
||||||
REPOSITORY_EXTRA_SEARCH_ATTR = ['repository_text_values.data',
|
REPOSITORY_EXTRA_SEARCH_ATTR = ['repository_text_values.data',
|
||||||
'repository_list_items.data',
|
'repository_list_items.data',
|
||||||
'repository_checklist_items.data',
|
'repository_checklist_items.data',
|
||||||
|
'repository_status_items.status',
|
||||||
'active_storage_blobs.filename']
|
'active_storage_blobs.filename']
|
||||||
|
|
||||||
# Array of includes used in search query for repository rows
|
# Array of includes used in search query for repository rows
|
||||||
REPOSITORY_SEARCH_INCLUDES = [:repository_text_value,
|
REPOSITORY_SEARCH_INCLUDES = [:repository_text_value,
|
||||||
repository_list_value: :repository_list_item,
|
repository_list_value: :repository_list_item,
|
||||||
repository_checklist_value: :repository_checklist_items,
|
repository_checklist_value: :repository_checklist_items,
|
||||||
|
repository_status_value: :repository_status_item,
|
||||||
repository_asset_value: { asset: { file_attachment: :blob } }]
|
repository_asset_value: { asset: { file_attachment: :blob } }]
|
||||||
|
|
||||||
# List of implemented core API versions
|
# List of implemented core API versions
|
||||||
|
|
Loading…
Reference in a new issue