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
Léo-Paul Géneau
gitlab-ce
Commits
7530e4ec
Commit
7530e4ec
authored
Jun 12, 2018
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Banzai reference for milestones belonging to parent groups
parent
10a190db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
lib/banzai/filter/milestone_reference_filter.rb
lib/banzai/filter/milestone_reference_filter.rb
+1
-1
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
+9
-1
No files found.
lib/banzai/filter/milestone_reference_filter.rb
View file @
7530e4ec
...
@@ -65,7 +65,7 @@ module Banzai
...
@@ -65,7 +65,7 @@ module Banzai
# We don't support IID lookups for group milestones, because IIDs can
# We don't support IID lookups for group milestones, because IIDs can
# clash between group and project milestones.
# clash between group and project milestones.
if
project
.
group
&&
!
params
[
:iid
]
if
project
.
group
&&
!
params
[
:iid
]
finder_params
[
:group_ids
]
=
[
project
.
group
.
id
]
finder_params
[
:group_ids
]
=
project
.
group
.
self_and_ancestors
.
select
(
:id
)
end
end
MilestonesFinder
.
new
(
finder_params
).
find_by
(
params
)
MilestonesFinder
.
new
(
finder_params
).
find_by
(
params
)
...
...
spec/lib/banzai/filter/milestone_reference_filter_spec.rb
View file @
7530e4ec
...
@@ -3,7 +3,8 @@ require 'spec_helper'
...
@@ -3,7 +3,8 @@ require 'spec_helper'
describe
Banzai
::
Filter
::
MilestoneReferenceFilter
do
describe
Banzai
::
Filter
::
MilestoneReferenceFilter
do
include
FilterSpecHelper
include
FilterSpecHelper
let
(
:group
)
{
create
(
:group
,
:public
)
}
let
(
:parent_group
)
{
create
(
:group
,
:public
)
}
let
(
:group
)
{
create
(
:group
,
:public
,
parent:
parent_group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
group:
group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
group:
group
)
}
it
'requires project context'
do
it
'requires project context'
do
...
@@ -340,6 +341,13 @@ describe Banzai::Filter::MilestoneReferenceFilter do
...
@@ -340,6 +341,13 @@ describe Banzai::Filter::MilestoneReferenceFilter do
expect
(
doc
.
css
(
'a'
)).
to
be_empty
expect
(
doc
.
css
(
'a'
)).
to
be_empty
end
end
it
'supports parent group references'
,
:nested_groups
do
milestone
.
update!
(
group:
parent_group
)
doc
=
reference_filter
(
"See
#{
reference
}
"
)
expect
(
doc
.
css
(
'a'
).
first
.
text
).
to
eq
(
milestone
.
name
)
end
end
end
context
'group context'
do
context
'group context'
do
...
...
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