mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-09 12:46:07 +10:00
Faster autocomplete for users/issues/emojiis
Instead of loading all issues and merge requests we load only open one. This will reduce time load for autocomplete resources significantly
This commit is contained in:
@@ -101,11 +101,20 @@ class ProjectsController < ApplicationController
|
||||
def autocomplete_sources
|
||||
note_type = params['type']
|
||||
note_id = params['type_id']
|
||||
autocomplete = ::Projects::AutocompleteService.new(@project)
|
||||
participants = ::Projects::ParticipantsService.new(@project).execute(note_type, note_id)
|
||||
|
||||
emojis = Emoji.names.map do |e|
|
||||
{
|
||||
name: e,
|
||||
path: view_context.image_url("emoji/#{e}.png")
|
||||
}
|
||||
end
|
||||
|
||||
@suggestions = {
|
||||
emojis: Emoji.names.map { |e| { name: e, path: view_context.image_url("emoji/#{e}.png") } },
|
||||
issues: @project.issues.select([:iid, :title, :description]),
|
||||
mergerequests: @project.merge_requests.select([:iid, :title, :description]),
|
||||
emojis: emojis,
|
||||
issues: autocomplete.issues,
|
||||
mergerequests: autocomplete.merge_requests,
|
||||
members: participants
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user