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
a6d265b1
Commit
a6d265b1
authored
May 11, 2020
by
Eugenia Grieff
Committed by
Jan Provaznik
May 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issues filter for any epic
parent
485ac579
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
0 deletions
+27
-0
ee/app/finders/ee/issues_finder.rb
ee/app/finders/ee/issues_finder.rb
+2
-0
ee/app/finders/ee/issues_finder/params.rb
ee/app/finders/ee/issues_finder/params.rb
+4
-0
ee/app/models/ee/issue.rb
ee/app/models/ee/issue.rb
+1
-0
ee/changelogs/unreleased/215657-searching-issues-with-epic-any-doesn-t-return-anything.yml
...earching-issues-with-epic-any-doesn-t-return-anything.yml
+5
-0
ee/spec/finders/issues_finder_spec.rb
ee/spec/finders/issues_finder_spec.rb
+8
-0
ee/spec/models/issue_spec.rb
ee/spec/models/issue_spec.rb
+7
-0
No files found.
ee/app/finders/ee/issues_finder.rb
View file @
a6d265b1
...
...
@@ -55,6 +55,8 @@ module EE
if
params
.
filter_by_no_epic?
items
.
no_epic
elsif
params
.
filter_by_any_epic?
items
.
any_epic
else
items
.
in_epics
(
params
.
epics
)
end
...
...
ee/app/finders/ee/issues_finder/params.rb
View file @
a6d265b1
...
...
@@ -14,6 +14,10 @@ module EE
params
[
:epic_id
].
to_s
.
downcase
==
::
IssuableFinder
::
Params
::
FILTER_NONE
end
def
filter_by_any_epic?
params
[
:epic_id
].
to_s
.
downcase
==
::
IssuableFinder
::
Params
::
FILTER_ANY
end
def
weights?
params
[
:weight
].
present?
&&
params
[
:weight
]
!=
::
Issue
::
WEIGHT_ALL
end
...
...
ee/app/models/ee/issue.rb
View file @
a6d265b1
...
...
@@ -21,6 +21,7 @@ module EE
scope
:order_weight_asc
,
->
{
reorder
::
Gitlab
::
Database
.
nulls_last_order
(
'weight'
)
}
scope
:service_desk
,
->
{
where
(
author:
::
User
.
support_bot
)
}
scope
:no_epic
,
->
{
left_outer_joins
(
:epic_issue
).
where
(
epic_issues:
{
epic_id:
nil
})
}
scope
:any_epic
,
->
{
joins
(
:epic_issue
)
}
scope
:in_epics
,
->
(
epics
)
do
issue_ids
=
EpicIssue
.
where
(
epic_id:
epics
).
select
(
:issue_id
)
id_in
(
issue_ids
)
...
...
ee/changelogs/unreleased/215657-searching-issues-with-epic-any-doesn-t-return-anything.yml
0 → 100644
View file @
a6d265b1
---
title
:
Fix issues search to include the epic filter ANY
merge_request
:
31614
author
:
type
:
fixed
ee/spec/finders/issues_finder_spec.rb
View file @
a6d265b1
...
...
@@ -113,6 +113,14 @@ describe IssuesFinder do
end
end
end
context
'filter issues with any epic'
do
let
(
:params
)
{
{
epic_id:
::
IssuableFinder
::
Params
::
FILTER_ANY
}
}
it
'returns filtered issues'
do
expect
(
issues
).
to
contain_exactly
(
issue_1
,
issue_2
,
issue_subepic
)
end
end
end
end
end
...
...
ee/spec/models/issue_spec.rb
View file @
a6d265b1
...
...
@@ -128,6 +128,13 @@ describe Issue do
end
end
describe
'.any_epic'
do
it
'returns only issues with an epic assigned'
do
expect
(
described_class
.
count
).
to
eq
3
expect
(
described_class
.
any_epic
).
to
eq
[
epic_issue1
.
issue
,
epic_issue2
.
issue
]
end
end
describe
'.in_epics'
do
it
'returns only issues in selected epics'
do
expect
(
described_class
.
count
).
to
eq
3
...
...
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