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
22113004
Commit
22113004
authored
Feb 04, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include subepics in IssuesFinder if requested
parent
64c36629
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
ee/app/finders/ee/issues_finder.rb
ee/app/finders/ee/issues_finder.rb
+9
-1
ee/spec/finders/issues_finder_spec.rb
ee/spec/finders/issues_finder_spec.rb
+14
-2
No files found.
ee/app/finders/ee/issues_finder.rb
View file @
22113004
...
...
@@ -87,13 +87,21 @@ module EE
params
[
:epic_id
].
to_s
.
downcase
==
::
IssuesFinder
::
FILTER_NONE
end
def
epics
if
params
[
:include_subepics
]
::
Gitlab
::
ObjectHierarchy
.
new
(
::
Epic
.
for_ids
(
params
[
:epic_id
])).
base_and_descendants
.
select
(
:id
)
else
params
[
:epic_id
]
end
end
def
by_epic
(
items
)
return
items
unless
by_epic?
if
filter_by_no_epic?
items
.
no_epic
else
items
.
in_epics
(
params
[
:epic_id
]
)
items
.
in_epics
(
epics
)
end
end
end
...
...
ee/spec/finders/issues_finder_spec.rb
View file @
22113004
...
...
@@ -97,8 +97,20 @@ describe IssuesFinder do
context
'filter issues by epic'
do
let
(
:params
)
{
{
epic_id:
epic_1
.
id
}
}
it
'returns all issues in the epic, subepic issues excluded'
do
expect
(
issues
).
to
contain_exactly
(
issue_1
)
context
'when include_subepics param is not included'
do
it
'returns all issues in the epic, subepic issues excluded'
do
expect
(
issues
).
to
contain_exactly
(
issue_1
)
end
end
context
'when include_subepics param is set to true'
do
before
do
params
[
:include_subepics
]
=
true
end
it
'returns all issues in the epic including subepic issues'
do
expect
(
issues
).
to
contain_exactly
(
issue_1
,
issue_subepic
)
end
end
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