summaryrefslogtreecommitdiff
path: root/app/helpers/search_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /app/helpers/search_helper.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r--app/helpers/search_helper.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 5b596c328d1..f8bfc74b344 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -260,6 +260,7 @@ module SearchHelper
{
category: "Groups",
id: group.id,
+ value: "#{search_result_sanitize(group.name)}",
label: "#{search_result_sanitize(group.full_name)}",
url: group_path(group),
avatar_url: group.avatar_url || ''
@@ -311,7 +312,9 @@ module SearchHelper
id: mr.id,
label: search_result_sanitize(mr.title),
url: merge_request_path(mr),
- avatar_url: mr.project.avatar_url || ''
+ avatar_url: mr.project.avatar_url || '',
+ project_id: mr.target_project_id,
+ project_name: mr.target_project.name
}
end
end
@@ -325,7 +328,9 @@ module SearchHelper
id: i.id,
label: search_result_sanitize(i.title),
url: issue_path(i),
- avatar_url: i.project.avatar_url || ''
+ avatar_url: i.project.avatar_url || '',
+ project_id: i.project_id,
+ project_name: i.project.name
}
end
end
@@ -436,11 +441,11 @@ module SearchHelper
end
def show_user_search_tab?
- if @project
- project_search_tabs?(:members)
- else
- can?(current_user, :read_users_list)
- end
+ return project_search_tabs?(:members) if @project
+ return false unless can?(current_user, :read_users_list)
+ return true if @group
+
+ Feature.enabled?(:global_search_users_tab, current_user, type: :ops, default_enabled: :yaml)
end
def issuable_state_to_badge_class(issuable)