diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-17 09:39:23 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-11-17 09:39:23 +0000 |
commit | 6b35c4ad65205391a054725e2bf0b86985895b86 (patch) | |
tree | cee09fe391651f4356e7841fd0415f44cdb5afbb /app | |
parent | 11ba759d33b3f59b1dd493ab04dd75f447c0d374 (diff) | |
download | gitlab-ce-6b35c4ad65205391a054725e2bf0b86985895b86.tar.gz |
Revert "Merge branch '22680-unlabel-limit-autocomplete-to-selected-items' into 'master'"revert-0a3cafb2
This reverts merge request !6796
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js.es6 | 6 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 4 | ||||
-rw-r--r-- | app/services/projects/autocomplete_service.rb | 9 |
3 files changed, 2 insertions, 17 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js.es6 b/app/assets/javascripts/gfm_auto_complete.js.es6 index 19bfdf1de8c..58c1179d250 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.es6 +++ b/app/assets/javascripts/gfm_auto_complete.js.es6 @@ -51,11 +51,6 @@ if (!GitLab.GfmAutoComplete.dataLoaded) { return this.at; } else { - if (value.indexOf("unlabel") !== -1) { - GitLab.GfmAutoComplete.input.atwho('load', '~', GitLab.GfmAutoComplete.cachedData.unlabels); - } else { - GitLab.GfmAutoComplete.input.atwho('load', '~', GitLab.GfmAutoComplete.cachedData.labels); - } return value; } } @@ -363,4 +358,3 @@ }; }).call(this); - diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7376c2bfeb7..a8a18b4fa16 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -144,15 +144,13 @@ class ProjectsController < Projects::ApplicationController autocomplete = ::Projects::AutocompleteService.new(@project, current_user) participants = ::Projects::ParticipantsService.new(@project, current_user).execute(noteable) - unlabels = autocomplete.unlabels(noteable) @suggestions = { emojis: Gitlab::AwardEmoji.urls, issues: autocomplete.issues, milestones: autocomplete.milestones, mergerequests: autocomplete.merge_requests, - labels: autocomplete.labels - unlabels, - unlabels: unlabels, + labels: autocomplete.labels, members: participants, commands: autocomplete.commands(noteable, params[:type]) } diff --git a/app/services/projects/autocomplete_service.rb b/app/services/projects/autocomplete_service.rb index 223461e88b6..015f2828921 100644 --- a/app/services/projects/autocomplete_service.rb +++ b/app/services/projects/autocomplete_service.rb @@ -13,14 +13,7 @@ module Projects end def labels - LabelsFinder.new(current_user, project_id: project.id).execute. - pluck(:title, :color).map { |l| { title: l.first, color: l.second } } - end - - def unlabels(noteable) - return [] unless noteable && noteable.respond_to?(:labels) - - noteable.labels.pluck(:title, :color).map { |l| { title: l.first, color: l.second } } + LabelsFinder.new(current_user, project_id: project.id).execute.select([:title, :color]) end def commands(noteable, type) |