Add searchable list for advanced filters [SCI-6466] (#3808)

Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
aignatov-bio 2022-02-01 14:39:04 +01:00 committed by GitHub
parent 8c8c4344d6
commit 0d6b2ad4b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -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),

View file

@ -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 = []