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
Tatuya Kamada
gitlab-ce
Commits
d0165c82
Commit
d0165c82
authored
Nov 07, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add author_username and assignee_username
parent
fc6eab69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+2
-2
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+18
-6
No files found.
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
d0165c82
...
...
@@ -5,11 +5,11 @@
const validTokenKeys = [{
key: 'author',
type: 'string',
param: '
id
',
param: '
username
',
},{
key: 'assignee',
type: 'string',
param: '
id
',
param: '
username
',
},{
key: 'milestone',
type: 'string',
...
...
app/finders/issuable_finder.rb
View file @
d0165c82
...
...
@@ -165,31 +165,43 @@ class IssuableFinder
end
end
def
assignee?
def
assignee
_id
?
params
[
:assignee_id
].
present?
end
def
assignee_username?
params
[
:assignee_username
].
present?
end
def
assignee
return
@assignee
if
defined?
(
@assignee
)
@assignee
=
if
assignee?
&&
params
[
:assignee_id
]
!=
NONE
if
assignee
_id
?
&&
params
[
:assignee_id
]
!=
NONE
User
.
find
(
params
[
:assignee_id
])
elsif
assignee_username?
&&
params
[
:assignee_username
]
!=
NONE
User
.
find_by
(
username:
params
[
:assignee_username
])
else
nil
end
end
def
author?
def
author
_id
?
params
[
:author_id
].
present?
end
def
author_username?
params
[
:author_username
].
present?
end
def
author
return
@author
if
defined?
(
@author
)
@author
=
if
author?
&&
params
[
:author_id
]
!=
NONE
if
author
_id
?
&&
params
[
:author_id
]
!=
NONE
User
.
find
(
params
[
:author_id
])
elsif
author_username?
&&
params
[
:author_username
]
!=
NONE
User
.
find_by
(
username:
params
[
:author_username
])
else
nil
end
...
...
@@ -263,7 +275,7 @@ class IssuableFinder
end
def
by_assignee
(
items
)
if
assignee?
if
assignee
_id?
||
assignee_username
?
items
=
items
.
where
(
assignee_id:
assignee
.
try
(
:id
))
end
...
...
@@ -271,7 +283,7 @@ class IssuableFinder
end
def
by_author
(
items
)
if
author?
if
author
_id?
||
author_username
?
items
=
items
.
where
(
author_id:
author
.
try
(
:id
))
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