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
f53bdd8e
Commit
f53bdd8e
authored
Jun 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
77e2c272
289ca35d
Changes
3
Hide 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 @
f53bdd8e
...
...
@@ -104,6 +104,12 @@ module IssuableCollections
# Used by view to highlight active option
@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
options
[
:project_id
]
=
@project
.
id
options
[
:attempt_project_search_optimizations
]
=
true
...
...
changelogs/unreleased/-30974-issue-search-by-number.yml
0 → 100644
View file @
f53bdd8e
---
title
:
"
Search
issuables
by
iids"
merge_request
:
!28302
author
:
Riccardo Padovani
type
:
fixed
spec/controllers/concerns/issuable_collections_spec.rb
View file @
f53bdd8e
...
...
@@ -180,5 +180,16 @@ describe IssuableCollections do
is_expected
.
not_to
include
(
'invalid_param'
,
'invalid_array'
)
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
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