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
1b7f137e
Commit
1b7f137e
authored
Aug 09, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix filtering issues by "No Label"
parent
5490a9fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
app/services/boards/issues/list_service.rb
app/services/boards/issues/list_service.rb
+9
-9
spec/services/boards/issues/list_service_spec.rb
spec/services/boards/issues/list_service_spec.rb
+1
-1
No files found.
app/services/boards/issues/list_service.rb
View file @
1b7f137e
...
@@ -3,7 +3,8 @@ module Boards
...
@@ -3,7 +3,8 @@ module Boards
class
ListService
<
Boards
::
BaseService
class
ListService
<
Boards
::
BaseService
def
execute
def
execute
issues
=
IssuesFinder
.
new
(
user
,
filter_params
).
execute
issues
=
IssuesFinder
.
new
(
user
,
filter_params
).
execute
issues
=
without_board_labels
(
issues
)
if
list
.
backlog?
issues
=
without_board_labels
(
issues
)
unless
list
.
label?
issues
=
with_list_label
(
issues
)
if
list
.
label?
issues
issues
end
end
...
@@ -16,7 +17,6 @@ module Boards
...
@@ -16,7 +17,6 @@ module Boards
def
filter_params
def
filter_params
set_default_scope
set_default_scope
set_default_sort
set_default_sort
set_list_label
set_project
set_project
set_state
set_state
...
@@ -31,13 +31,6 @@ module Boards
...
@@ -31,13 +31,6 @@ module Boards
params
[
:sort
]
=
'priority'
params
[
:sort
]
=
'priority'
end
end
def
set_list_label
return
unless
list
.
label?
params
[
:label_name
]
||=
[]
params
[
:label_name
]
<<
list
.
label_name
end
def
set_project
def
set_project
params
[
:project_id
]
=
project
.
id
params
[
:project_id
]
=
project
.
id
end
end
...
@@ -58,6 +51,13 @@ module Boards
...
@@ -58,6 +51,13 @@ module Boards
.
where
(
label_id:
board_label_ids
).
limit
(
1
).
arel
.
exists
.
where
(
label_id:
board_label_ids
).
limit
(
1
).
arel
.
exists
)
)
end
end
def
with_list_label
(
issues
)
issues
.
where
(
LabelLink
.
where
(
"label_links.target_type = 'Issue' AND label_links.target_id = issues.id"
)
.
where
(
"label_links.label_id = ?"
,
list
.
label_id
).
limit
(
1
).
arel
.
exists
)
end
end
end
end
end
end
end
spec/services/boards/issues/list_service_spec.rb
View file @
1b7f137e
...
@@ -39,7 +39,7 @@ describe Boards::Issues::ListService, services: true do
...
@@ -39,7 +39,7 @@ describe Boards::Issues::ListService, services: true do
it
'delegates search to IssuesFinder'
do
it
'delegates search to IssuesFinder'
do
params
=
{
id:
list1
.
id
}
params
=
{
id:
list1
.
id
}
expect_any_instance_of
(
IssuesFinder
).
to
receive
(
:execute
).
once
expect_any_instance_of
(
IssuesFinder
).
to
receive
(
:execute
).
once
.
and_call_original
described_class
.
new
(
project
,
user
,
params
).
execute
described_class
.
new
(
project
,
user
,
params
).
execute
end
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