Add search issues/MR by number
This commit is contained in:
parent
c74b49c2e0
commit
241f5971ba
|
@ -45,7 +45,7 @@ v 7.11.0 (unreleased)
|
||||||
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
|
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
|
||||||
- Protect OmniAuth request phase against CSRF.
|
- Protect OmniAuth request phase against CSRF.
|
||||||
- Don't send notifications to mentioned users that don't have access to the project in question.
|
- 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
|
- Move snippets UI to fluid layout
|
||||||
- Improve UI for sidebar. Increase separation between navigation and content
|
- Improve UI for sidebar. Increase separation between navigation and content
|
||||||
- Improve new project command options (Ben Bodenmiller)
|
- Improve new project command options (Ben Bodenmiller)
|
||||||
|
|
|
@ -19,7 +19,15 @@ class Projects::IssuesController < Projects::ApplicationController
|
||||||
def index
|
def index
|
||||||
terms = params['issue_search']
|
terms = params['issue_search']
|
||||||
@issues = get_issues_collection
|
@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)
|
@issues = @issues.page(params[:page]).per(PER_PAGE)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
|
@ -19,7 +19,15 @@ class Projects::MergeRequestsController < Projects::ApplicationController
|
||||||
def index
|
def index
|
||||||
terms = params['issue_search']
|
terms = params['issue_search']
|
||||||
@merge_requests = get_merge_requests_collection
|
@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)
|
@merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
|
@ -51,11 +51,23 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def issues
|
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
|
end
|
||||||
|
|
||||||
def merge_requests
|
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
|
end
|
||||||
|
|
||||||
def default_scope
|
def default_scope
|
||||||
|
|
Loading…
Reference in New Issue