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
22dd32b5
Commit
22dd32b5
authored
Apr 22, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix after wrong resolving
parent
5dc76abb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
3 deletions
+45
-3
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+45
-3
No files found.
app/finders/issuable_finder.rb
View file @
22dd32b5
...
...
@@ -279,9 +279,31 @@ class IssuableFinder
end
end
# When filtering by multiple labels we may end up duplicating issues (if one
# has multiple labels). This ensures we only return unique issues.
items
.
distinct
items
end
def
by_weight
(
items
)
return
items
unless
weights?
if
filter_by_no_weight?
items
.
where
(
weight:
[
-
1
,
nil
])
elsif
filter_by_any_weight?
items
.
where
.
not
(
weight:
[
-
1
,
nil
])
else
items
.
where
(
weight:
params
[
:weight
])
end
end
def
weights?
params
[
:weight
].
present?
&&
params
[
:weight
]
!=
Issue
::
WEIGHT_ALL
end
def
filter_by_no_weight?
params
[
:weight
]
==
Issue
::
WEIGHT_NONE
end
def
filter_by_any_weight?
params
[
:weight
]
==
Issue
::
WEIGHT_ANY
end
def
by_due_date
(
items
)
...
...
@@ -300,6 +322,26 @@ class IssuableFinder
items
end
def
filter_by_no_due_date?
due_date?
&&
params
[
:due_date
]
==
Issue
::
NoDueDate
.
name
end
def
filter_by_overdue?
due_date?
&&
params
[
:due_date
]
==
Issue
::
Overdue
.
name
end
def
filter_by_due_this_week?
due_date?
&&
params
[
:due_date
]
==
Issue
::
DueThisWeek
.
name
end
def
filter_by_due_this_month?
due_date?
&&
params
[
:due_date
]
==
Issue
::
DueThisMonth
.
name
end
def
due_date?
params
[
:due_date
].
present?
&&
klass
.
column_names
.
include?
(
'due_date'
)
end
def
label_names
params
[
:label_name
].
is_a?
(
String
)
?
params
[
:label_name
].
split
(
','
)
:
params
[
:label_name
]
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