From e412c1f25e9abfebaa7b5669e1acf7f26a66d722 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 15 Jun 2016 08:53:11 +0100 Subject: [PATCH] Fixed issue with move dropdown not being searchable Closes #18634 --- app/assets/javascripts/issuable_form.js.coffee | 4 ++++ app/controllers/autocomplete_controller.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/app/assets/javascripts/issuable_form.js.coffee b/app/assets/javascripts/issuable_form.js.coffee index 898506fde32..5b7a4831dfc 100644 --- a/app/assets/javascripts/issuable_form.js.coffee +++ b/app/assets/javascripts/issuable_form.js.coffee @@ -102,6 +102,10 @@ class @IssuableForm return { results: data } + data: (query) -> + { + search: query + } formatResult: (project) -> project.name_with_namespace formatSelection: (project) -> diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb index 3865b2d61fd..c89678cf2d8 100644 --- a/app/controllers/autocomplete_controller.rb +++ b/app/controllers/autocomplete_controller.rb @@ -35,6 +35,7 @@ class AutocompleteController < ApplicationController project = Project.find_by_id(params[:project_id]) projects = current_user.authorized_projects + projects = projects.search(params[:search]) if params[:search].present? projects = projects.select do |project| current_user.can?(:admin_issue, project) end