Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/projects_finder.rb')
-rw-r--r--app/finders/projects_finder.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index dca3d12f3c9..5537058cc79 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -180,12 +180,20 @@ class ProjectsFinder < UnionFinder
# rubocop: enable CodeReuse/ActiveRecord
def by_topics(items)
- params[:topic].present? ? items.tagged_with(params[:topic]) : items
+ return items unless params[:topic].present?
+
+ topics = params[:topic].instance_of?(String) ? params[:topic].strip.split(/\s*,\s*/) : params[:topic]
+ topics.each do |topic|
+ items = items.with_topic(topic)
+ end
+
+ items
end
def by_search(items)
params[:search] ||= params[:name]
+ return items if Feature.enabled?(:disable_anonymous_project_search, type: :ops) && current_user.nil?
return items.none if params[:search].present? && params[:minimum_search_length].present? && params[:search].length < params[:minimum_search_length].to_i
items.optionally_search(params[:search], include_namespace: params[:search_namespaces].present?)