Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
38f930b9
Commit
38f930b9
authored
Aug 11, 2021
by
Terri Chu
Committed by
Steve Abrams
Aug 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use default project filter for issue/merge request project searches
Changelog: performance
parent
e524d530
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
lib/gitlab/project_search_results.rb
lib/gitlab/project_search_results.rb
+2
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+1
-1
No files found.
lib/gitlab/project_search_results.rb
View file @
38f930b9
...
@@ -8,7 +8,8 @@ module Gitlab
...
@@ -8,7 +8,8 @@ module Gitlab
@project
=
project
@project
=
project
@repository_ref
=
repository_ref
.
presence
@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
end
def
objects
(
scope
,
page:
nil
,
per_page:
DEFAULT_PER_PAGE
,
preload_method:
nil
)
def
objects
(
scope
,
page:
nil
,
per_page:
DEFAULT_PER_PAGE
,
preload_method:
nil
)
...
...
lib/gitlab/search_results.rb
View file @
38f930b9
...
@@ -168,7 +168,7 @@ module Gitlab
...
@@ -168,7 +168,7 @@ module Gitlab
issues
=
IssuesFinder
.
new
(
current_user
,
issuable_params
.
merge
(
finder_params
)).
execute
issues
=
IssuesFinder
.
new
(
current_user
,
issuable_params
.
merge
(
finder_params
)).
execute
unless
default_project_filter
unless
default_project_filter
issues
=
issues
.
where
(
project_id:
project_ids_relation
)
# rubocop: disable CodeReuse/ActiveRecord
issues
=
issues
.
in_projects
(
project_ids_relation
)
end
end
apply_sort
(
issues
,
scope:
'issues'
)
apply_sort
(
issues
,
scope:
'issues'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment