summaryrefslogtreecommitdiff
path: root/app/views/layouts
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-05-07 08:26:44 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-07 08:26:44 +0000
commit67c9f822dd60ef55323082cd0b17ccd6108a24c6 (patch)
tree716d434e45d4b43161e889d99c37b31415e22049 /app/views/layouts
parent6a052a14e938ef073977afd808dd12a801f44369 (diff)
parentcfa92112d189dce1028bce7145a5cbe609c389a8 (diff)
downloadgitlab-ce-67c9f822dd60ef55323082cd0b17ccd6108a24c6.tar.gz
Merge branch '4084-epics-username-autocomplete-ce' into 'master'
Backport CE changes from "autocomplete usernames in Epic comments/description" See merge request gitlab-org/gitlab-ce!18605
Diffstat (limited to 'app/views/layouts')
-rw-r--r--app/views/layouts/_init_auto_complete.html.haml15
1 files changed, 5 insertions, 10 deletions
diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml
index 4276e6ee4bb..240e03a5d53 100644
--- a/app/views/layouts/_init_auto_complete.html.haml
+++ b/app/views/layouts/_init_auto_complete.html.haml
@@ -1,16 +1,11 @@
-- project = @target_project || @project
+- object = @target_project || @project || @group
- noteable_type = @noteable.class if @noteable.present?
-- if project
+- datasources = autocomplete_data_sources(object, noteable_type)
+
+- if object
-# haml-lint:disable InlineJavaScript
:javascript
gl = window.gl || {};
gl.GfmAutoComplete = gl.GfmAutoComplete || {};
- gl.GfmAutoComplete.dataSources = {
- members: "#{members_project_autocomplete_sources_path(project, type: noteable_type, type_id: params[:id])}",
- issues: "#{issues_project_autocomplete_sources_path(project)}",
- mergeRequests: "#{merge_requests_project_autocomplete_sources_path(project)}",
- labels: "#{labels_project_autocomplete_sources_path(project, type: noteable_type, type_id: params[:id])}",
- milestones: "#{milestones_project_autocomplete_sources_path(project)}",
- commands: "#{commands_project_autocomplete_sources_path(project, type: noteable_type, type_id: params[:id])}"
- };
+ gl.GfmAutoComplete.dataSources = #{datasources.to_json};