Revert "Merge branch '22680-unlabel-limit-autocomplete-to-selected-items' into 'master'"
This reverts merge request !6796
This commit is contained in:
parent
11ba759d33
commit
6b35c4ad65
|
@ -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);
|
||||
|
||||
|
|
|
@ -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])
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
title: Limit autocomplete to currently selected items for unlabel slash command
|
||||
merge_request: 22680
|
||||
author: Akram Fares
|
Loading…
Reference in New Issue