Merge pull request #7454 from aignatov-bio/ai-sci-10593-not-all-dropdown-items-vissible

Fix item card dropdown options list [SCI-10593]
This commit is contained in:
ajugo 2024-04-10 10:53:33 +02:00 committed by GitHub
commit a35e6455df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View file

@ -32,11 +32,14 @@ module RepositoryColumns
end
def items
column_list_items = @repository_column.repository_list_items
.where('data ILIKE ?',
"%#{search_params[:query]}%")
.limit(Constants::SEARCH_LIMIT)
.select(:id, :data)
column_list_items = if params[:all_options]
@repository_column.repository_list_items.select(:id, :data)
else
@repository_column.repository_list_items
.where('data ILIKE ?', "%#{search_params[:query]}%")
.limit(Constants::SEARCH_LIMIT)
.select(:id, :data)
end
render json: column_list_items.map { |i| { value: i.id, label: escape_input(i.data) } }, status: :ok
end

View file

@ -66,7 +66,7 @@ export default {
mounted() {
this.isLoading = true;
$.get(this.optionsPath, (data) => {
$.get(this.optionsPath, { all_options: true }, (data) => {
if (Array.isArray(data)) {
this.options = data.map((option) => {
const { value, label } = option;
@ -75,6 +75,7 @@ export default {
return false;
}
this.options = [];
return true;
}).always(() => {
this.isLoading = false;
this.selected = this.id;