diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2016-10-13 04:33:09 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2016-12-15 15:20:33 +0000 |
commit | 1356e40f22c555f676777ed9385a12b09c19fdce (patch) | |
tree | b8291341f9ea2dbdda5db5254b70bf631162ae69 /app/controllers/projects_controller.rb | |
parent | 677e7e837e3fb41deb46cb77de8b9395d031c07c (diff) | |
download | gitlab-ce-1356e40f22c555f676777ed9385a12b09c19fdce.tar.gz |
Changed autocomplete_sources into an action that returns a single 'at' type of sources at a time18435-autocomplete-is-not-performant
Finished up autocomplete_sources action and added frontend to fetch data only when its needed
Added wait_for_ajax to specs
Fixed builds and improved the setup/destroy lifecycle
Changed global namespace and DRYed up loading logic
Added safety for accidentally loading data twice
Removed destroy as its not necessary and is messing with click events from a blur race condition
Created AutocompleteSourcesController and updated routes
Fixed @undefined from tabbing before load ends
Disable tabSelectsMatch until we have loaded data
Review changes
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a8a18b4fa16..d5ee503c44c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -127,39 +127,6 @@ class ProjectsController < Projects::ApplicationController redirect_to edit_project_path(@project), alert: ex.message end - def autocomplete_sources - noteable = - case params[:type] - when 'Issue' - IssuesFinder.new(current_user, project_id: @project.id). - execute.find_by(iid: params[:type_id]) - when 'MergeRequest' - MergeRequestsFinder.new(current_user, project_id: @project.id). - execute.find_by(iid: params[:type_id]) - when 'Commit' - @project.commit(params[:type_id]) - else - nil - end - - autocomplete = ::Projects::AutocompleteService.new(@project, current_user) - participants = ::Projects::ParticipantsService.new(@project, current_user).execute(noteable) - - @suggestions = { - emojis: Gitlab::AwardEmoji.urls, - issues: autocomplete.issues, - milestones: autocomplete.milestones, - mergerequests: autocomplete.merge_requests, - labels: autocomplete.labels, - members: participants, - commands: autocomplete.commands(noteable, params[:type]) - } - - respond_to do |format| - format.json { render json: @suggestions } - end - end - def new_issue_address return render_404 unless Gitlab::IncomingEmail.supports_issue_creation? |