Commit 9fffb28d authored by Steve Abrams's avatar Steve Abrams

Merge branch '327106-use-default-filter-for-project-issue-and-merge_request-searches' into 'master'

Use default project filter for issue/merge request project searches

See merge request gitlab-org/gitlab!67921
parents 4ee9ac14 38f930b9
......@@ -8,7 +8,8 @@ module Gitlab
@project = project
@repository_ref = repository_ref.presence
super(current_user, query, [project], order_by: order_by, sort: sort, filters: filters)
# use the default filter for project searches since we are already limiting by a single project
super(current_user, query, [project], order_by: order_by, sort: sort, filters: filters, default_project_filter: true)
end
def objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil)
......
......@@ -168,7 +168,7 @@ module Gitlab
issues = IssuesFinder.new(current_user, issuable_params.merge(finder_params)).execute
unless default_project_filter
issues = issues.where(project_id: project_ids_relation) # rubocop: disable CodeReuse/ActiveRecord
issues = issues.in_projects(project_ids_relation)
end
apply_sort(issues, scope: 'issues')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment