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
5b1504d2
Commit
5b1504d2
authored
Nov 17, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linking issues from subgroups to epics in parent group
parent
e985161a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
ee/app/services/epic_issues/create_service.rb
ee/app/services/epic_issues/create_service.rb
+5
-1
spec/ee/spec/services/epic_issues/create_service_spec.rb
spec/ee/spec/services/epic_issues/create_service_spec.rb
+11
-1
No files found.
ee/app/services/epic_issues/create_service.rb
View file @
5b1504d2
...
...
@@ -19,7 +19,11 @@ module EpicIssues
def
linkable_issues
(
issues
)
return
[]
unless
can?
(
current_user
,
:admin_epic
,
issuable
.
group
)
issues
.
select
{
|
issue
|
issue
.
project
.
group
==
issuable
.
group
}
issues
.
select
{
|
issue
|
issuable_group_descendants
.
include?
(
issue
.
project
.
group
)
}
end
def
issuable_group_descendants
@descendants
||=
issuable
.
group
.
self_and_descendants
end
end
end
spec/ee/spec/services/epic_issues/create_service_spec.rb
View file @
5b1504d2
...
...
@@ -88,7 +88,17 @@ describe EpicIssues::CreateService do
end
end
context
'when an issue links is given'
do
context
'when an issue link is given'
do
subject
{
assign_issue
([
IssuesHelper
.
url_for_issue
(
issue
.
iid
,
issue
.
project
)])
}
include_examples
'returns success'
end
context
'when a link of an issue in a subgroup is given'
,
:nested_groups
do
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let
(
:project2
)
{
create
(
:project
,
group:
subgroup
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project2
)
}
subject
{
assign_issue
([
IssuesHelper
.
url_for_issue
(
issue
.
iid
,
issue
.
project
)])
}
include_examples
'returns success'
...
...
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