From b76ae638462ab0f673e5915986070518dd3f9ad3 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 19 Aug 2021 09:08:42 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-2-stable-ee --- lib/api/groups.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/api/groups.rb') diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 9b6b28733ff..0896357cc73 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -35,7 +35,8 @@ module API :all_available, :custom_attributes, :owned, :min_access_level, - :include_parent_descendants + :include_parent_descendants, + :search ) find_params[:parent] = if params[:top_level_only] @@ -48,7 +49,6 @@ module API find_params.fetch(:all_available, current_user&.can_read_all_resources?) groups = GroupsFinder.new(current_user, find_params).execute - groups = groups.search(params[:search], include_parents: true) if params[:search].present? groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present? order_groups(groups) @@ -128,10 +128,6 @@ module API groups.reorder(group_without_similarity_options) # rubocop: disable CodeReuse/ActiveRecord end - def order_by_similarity? - params[:order_by] == 'similarity' && params[:search].present? - end - def group_without_similarity_options order_options = { params[:order_by] => params[:sort] } order_options['name'] = order_options.delete('similarity') if order_options.has_key?('similarity') @@ -141,7 +137,7 @@ module API # rubocop: disable CodeReuse/ActiveRecord def handle_similarity_order(group, projects) - if params[:search].present? && Feature.enabled?(:similarity_search, group, default_enabled: true) + if params[:search].present? projects.sorted_by_similarity_desc(params[:search]) else order_options = { name: :asc } -- cgit v1.2.3