mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Add searchable list for advanced filters [SCI-6466] (#3808)
Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
parent
8c8c4344d6
commit
0d6b2ad4b4
2 changed files with 18 additions and 1 deletions
|
@ -35,7 +35,9 @@ class RepositoryColumnsController < ApplicationController
|
|||
end
|
||||
|
||||
def describe_all
|
||||
response_json = @repository.repository_columns.map do |column|
|
||||
response_json = @repository.repository_columns
|
||||
.where(data_type: Extends::REPOSITORY_ADVANCED_SEARCHABLE_COLUMNS)
|
||||
.map do |column|
|
||||
{
|
||||
id: column.id,
|
||||
name: escape_input(column.name),
|
||||
|
|
|
@ -118,6 +118,21 @@ class Extends
|
|||
}
|
||||
}
|
||||
|
||||
REPOSITORY_ADVANCED_SEARCHABLE_COLUMNS = %i(
|
||||
RepositoryTextValue
|
||||
RepositoryNumberValue
|
||||
RepositoryListValue
|
||||
RepositoryChecklistValue
|
||||
RepositoryStatusValue
|
||||
RepositoryAssetValue
|
||||
RepositoryDateTimeValue
|
||||
RepositoryDateTimeRangeValue
|
||||
RepositoryDateValue
|
||||
RepositoryDateRangeValue
|
||||
RepositoryTimeValue
|
||||
RepositoryTimeRangeValue
|
||||
)
|
||||
|
||||
# Array of preload relations used in search query for repository rows
|
||||
REPOSITORY_ROWS_PRELOAD_RELATIONS = []
|
||||
|
||||
|
|
Loading…
Reference in a new issue