mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-25 01:04:02 +08:00
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:
commit
a35e6455df
2 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue