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
b33fb07e
Commit
b33fb07e
authored
Jun 18, 2019
by
Riccardo Padovani
Committed by
Sean McGivern
Jun 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search issuables by iids
parent
a25c637c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+6
-0
changelogs/unreleased/-30974-issue-search-by-number.yml
changelogs/unreleased/-30974-issue-search-by-number.yml
+5
-0
spec/controllers/concerns/issuable_collections_spec.rb
spec/controllers/concerns/issuable_collections_spec.rb
+11
-0
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
b33fb07e
...
@@ -104,6 +104,12 @@ module IssuableCollections
...
@@ -104,6 +104,12 @@ module IssuableCollections
# Used by view to highlight active option
# Used by view to highlight active option
@sort
=
options
[
:sort
]
@sort
=
options
[
:sort
]
# When a user looks for an exact iid, we do not filter by search but only by iid
if
params
[
:search
]
=~
/^#(?<iid>\d+)\z/
options
[
:iids
]
=
Regexp
.
last_match
[
:iid
]
params
[
:search
]
=
nil
end
if
@project
if
@project
options
[
:project_id
]
=
@project
.
id
options
[
:project_id
]
=
@project
.
id
options
[
:attempt_project_search_optimizations
]
=
true
options
[
:attempt_project_search_optimizations
]
=
true
...
...
changelogs/unreleased/-30974-issue-search-by-number.yml
0 → 100644
View file @
b33fb07e
---
title
:
"
Search
issuables
by
iids"
merge_request
:
!28302
author
:
Riccardo Padovani
type
:
fixed
spec/controllers/concerns/issuable_collections_spec.rb
View file @
b33fb07e
...
@@ -180,5 +180,16 @@ describe IssuableCollections do
...
@@ -180,5 +180,16 @@ describe IssuableCollections do
is_expected
.
not_to
include
(
'invalid_param'
,
'invalid_array'
)
is_expected
.
not_to
include
(
'invalid_param'
,
'invalid_array'
)
end
end
end
end
context
'search using an issue iid'
do
let
(
:params
)
{
{
search:
"#5"
}
}
it
'mutates the search into a filter by iid'
do
is_expected
.
to
include
({
'iids'
=>
'5'
,
'search'
=>
nil
})
end
end
end
end
end
end
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