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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
241f5971
Commit
241f5971
authored
May 17, 2015
by
Nikita Verkhovin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add search issues/MR by number
parent
c74b49c2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
+33
-5
CHANGELOG
CHANGELOG
+1
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+9
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+9
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+14
-2
No files found.
CHANGELOG
View file @
241f5971
...
...
@@ -45,7 +45,7 @@ v 7.11.0 (unreleased)
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
- Protect OmniAuth request phase against CSRF.
- Don't send notifications to mentioned users that don't have access to the project in question.
-
-
Add search issues/MR by number
- Move snippets UI to fluid layout
- Improve UI for sidebar. Increase separation between navigation and content
- Improve new project command options (Ben Bodenmiller)
...
...
app/controllers/projects/issues_controller.rb
View file @
241f5971
...
...
@@ -19,7 +19,15 @@ class Projects::IssuesController < Projects::ApplicationController
def
index
terms
=
params
[
'issue_search'
]
@issues
=
get_issues_collection
@issues
=
@issues
.
full_search
(
terms
)
if
terms
.
present?
if
terms
.
present?
if
terms
=~
/\A#(\d+)\z/
@issues
=
@issues
.
where
(
iid:
$1
)
else
@issues
=
@issues
.
full_search
(
terms
)
end
end
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
241f5971
...
...
@@ -19,7 +19,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def
index
terms
=
params
[
'issue_search'
]
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
full_search
(
terms
)
if
terms
.
present?
if
terms
.
present?
if
terms
=~
/\A[#!](\d+)\z/
@merge_requests
=
@merge_requests
.
where
(
iid:
$1
)
else
@merge_requests
=
@merge_requests
.
full_search
(
terms
)
end
end
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
...
...
lib/gitlab/search_results.rb
View file @
241f5971
...
...
@@ -51,11 +51,23 @@ module Gitlab
end
def
issues
Issue
.
where
(
project_id:
limit_project_ids
).
full_search
(
query
).
order
(
'updated_at DESC'
)
issues
=
Issue
.
where
(
project_id:
limit_project_ids
)
if
query
=~
/#(\d+)\z/
issues
=
issues
.
where
(
iid:
$1
)
else
issues
=
issues
.
full_search
(
query
)
end
issues
.
order
(
'updated_at DESC'
)
end
def
merge_requests
MergeRequest
.
in_projects
(
limit_project_ids
).
full_search
(
query
).
order
(
'updated_at DESC'
)
merge_requests
=
MergeRequest
.
in_projects
(
limit_project_ids
)
if
query
=~
/[#!](\d+)\z/
merge_requests
=
merge_requests
.
where
(
iid:
$1
)
else
merge_requests
=
merge_requests
.
full_search
(
query
)
end
merge_requests
.
order
(
'updated_at DESC'
)
end
def
default_scope
...
...
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