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
430377d3
Commit
430377d3
authored
Jan 04, 2022
by
Siddharth Dungarwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add project_ids to search_controller
parent
e2b0cc80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
app/controllers/search_controller.rb
app/controllers/search_controller.rb
+1
-0
spec/controllers/search_controller_spec.rb
spec/controllers/search_controller_spec.rb
+2
-1
No files found.
app/controllers/search_controller.rb
View file @
430377d3
...
@@ -143,6 +143,7 @@ class SearchController < ApplicationController
...
@@ -143,6 +143,7 @@ class SearchController < ApplicationController
payload
[
:metadata
][
'meta.search.filters.confidential'
]
=
params
[
:confidential
]
payload
[
:metadata
][
'meta.search.filters.confidential'
]
=
params
[
:confidential
]
payload
[
:metadata
][
'meta.search.filters.state'
]
=
params
[
:state
]
payload
[
:metadata
][
'meta.search.filters.state'
]
=
params
[
:state
]
payload
[
:metadata
][
'meta.search.force_search_results'
]
=
params
[
:force_search_results
]
payload
[
:metadata
][
'meta.search.force_search_results'
]
=
params
[
:force_search_results
]
payload
[
:metadata
][
'meta.search.project_ids'
]
=
params
[
:project_ids
]
if
search_service
.
abuse_detected?
if
search_service
.
abuse_detected?
payload
[
:metadata
][
'abuse.confidence'
]
=
Gitlab
::
Abuse
.
confidence
(
:certain
)
payload
[
:metadata
][
'abuse.confidence'
]
=
Gitlab
::
Abuse
.
confidence
(
:certain
)
...
...
spec/controllers/search_controller_spec.rb
View file @
430377d3
...
@@ -396,9 +396,10 @@ RSpec.describe SearchController do
...
@@ -396,9 +396,10 @@ RSpec.describe SearchController do
expect
(
payload
[
:metadata
][
'meta.search.force_search_results'
]).
to
eq
(
'true'
)
expect
(
payload
[
:metadata
][
'meta.search.force_search_results'
]).
to
eq
(
'true'
)
expect
(
payload
[
:metadata
][
'meta.search.filters.confidential'
]).
to
eq
(
'true'
)
expect
(
payload
[
:metadata
][
'meta.search.filters.confidential'
]).
to
eq
(
'true'
)
expect
(
payload
[
:metadata
][
'meta.search.filters.state'
]).
to
eq
(
'true'
)
expect
(
payload
[
:metadata
][
'meta.search.filters.state'
]).
to
eq
(
'true'
)
expect
(
payload
[
:metadata
][
'meta.search.project_ids'
]).
to
eq
(
'true'
)
end
end
get
:show
,
params:
{
scope:
'issues'
,
search:
'hello world'
,
group_id:
'123'
,
project_id:
'456'
,
confidential:
true
,
state:
true
,
force_search_results:
true
}
get
:show
,
params:
{
scope:
'issues'
,
search:
'hello world'
,
group_id:
'123'
,
project_id:
'456'
,
project_ids
:[
'456'
,
'789'
],
confidential:
true
,
state:
true
,
force_search_results:
true
}
end
end
it
'appends the default scope in meta.search.scope'
do
it
'appends the default scope in meta.search.scope'
do
...
...
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