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
ce256c28
Commit
ce256c28
authored
Oct 24, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve label filtering implementation
parent
af4d16d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
app/finders/labels_finder.rb
app/finders/labels_finder.rb
+4
-10
No files found.
app/finders/labels_finder.rb
View file @
ce256c28
...
...
@@ -35,13 +35,11 @@ class LabelsFinder < UnionFinder
end
def
with_title
(
items
)
# Match no labels if an empty title is supplied to avoid matching all
# labels (e.g. when an issue is moved)
return
items
.
none
if
raw_title
&&
raw_title
.
empty?
if
title
items
=
items
.
where
(
title:
title
)
else
items
.
where
(
title:
title
)
elsif
params
[
:title
]
||
params
[
:name
]
# empty input, should match nothing
items
.
none
else
# not filtering
items
end
end
...
...
@@ -62,10 +60,6 @@ class LabelsFinder < UnionFinder
params
[
:title
].
presence
||
params
[
:name
].
presence
end
def
raw_title
params
[
:title
]
||
params
[
:name
]
end
def
project
return
@project
if
defined?
(
@project
)
...
...
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