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
Boxiang Sun
gitlab-ce
Commits
15911ef3
Commit
15911ef3
authored
Jul 31, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix group milestone path on issuable sidebar
parent
a9f56ae1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
13 deletions
+62
-13
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+13
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
changelogs/unreleased/fix-group-milestone-link-in-issuable-sidebar.yml
...released/fix-group-milestone-link-in-issuable-sidebar.yml
+4
-0
spec/factories/milestones.rb
spec/factories/milestones.rb
+1
-1
spec/helpers/gitlab_routing_helper_spec.rb
spec/helpers/gitlab_routing_helper_spec.rb
+43
-10
No files found.
app/helpers/gitlab_routing_helper.rb
View file @
15911ef3
...
...
@@ -48,7 +48,11 @@ module GitlabRoutingHelper
end
def
milestone_path
(
entity
,
*
args
)
project_milestone_path
(
entity
.
project
,
entity
,
*
args
)
if
entity
.
is_group_milestone?
group_milestone_path
(
entity
.
group
,
entity
,
*
args
)
elsif
entity
.
is_project_milestone?
project_milestone_path
(
entity
.
project
,
entity
,
*
args
)
end
end
def
issue_url
(
entity
,
*
args
)
...
...
@@ -63,6 +67,14 @@ module GitlabRoutingHelper
project_pipeline_url
(
pipeline
.
project
,
pipeline
.
id
,
*
args
)
end
def
milestone_url
(
entity
,
*
args
)
if
entity
.
is_group_milestone?
group_milestone_url
(
entity
.
group
,
entity
,
*
args
)
elsif
entity
.
is_project_milestone?
project_milestone_url
(
entity
.
project
,
entity
,
*
args
)
end
end
def
pipeline_job_url
(
pipeline
,
build
,
*
args
)
project_job_url
(
pipeline
.
project
,
build
.
id
,
*
args
)
end
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
15911ef3
...
...
@@ -37,7 +37,7 @@
=
link_to
'Edit'
,
'#'
,
class:
'edit-link pull-right'
.value.hide-collapsed
-
if
issuable
.
milestone
=
link_to
issuable
.
milestone
.
title
,
project_milestone_path
(
@project
,
issuable
.
milestone
),
class:
"bold has-tooltip"
,
title:
milestone_remaining_days
(
issuable
.
milestone
),
data:
{
container:
"body"
,
html:
1
}
=
link_to
issuable
.
milestone
.
title
,
milestone_path
(
issuable
.
milestone
),
class:
"bold has-tooltip"
,
title:
milestone_remaining_days
(
issuable
.
milestone
),
data:
{
container:
"body"
,
html:
1
}
-
else
%span
.no-value
None
...
...
changelogs/unreleased/fix-group-milestone-link-in-issuable-sidebar.yml
0 → 100644
View file @
15911ef3
---
title
:
Fix links to group milestones from issue and merge request sidebar
merge_request
:
author
:
spec/factories/milestones.rb
View file @
15911ef3
...
...
@@ -17,7 +17,7 @@ FactoryGirl.define do
state
"closed"
end
after
(
:build
)
do
|
milestone
,
evaluator
|
after
(
:build
,
:stub
)
do
|
milestone
,
evaluator
|
if
evaluator
.
group
milestone
.
group
=
evaluator
.
group
elsif
evaluator
.
group_id
...
...
spec/helpers/gitlab_routing_helper_spec.rb
View file @
15911ef3
require
'spec_helper'
describe
GitlabRoutingHelper
do
let
(
:project
)
{
build_stubbed
(
:empty_project
)
}
let
(
:group
)
{
build_stubbed
(
:group
)
}
describe
'Project URL helpers'
do
describe
'#project_member_path'
do
let
(
:project_member
)
{
create
(
:project_member
)
}
...
...
@@ -9,14 +12,10 @@ describe GitlabRoutingHelper do
end
describe
'#request_access_project_members_path'
do
let
(
:project
)
{
build_stubbed
(
:empty_project
)
}
it
{
expect
(
request_access_project_members_path
(
project
)).
to
eq
request_access_project_project_members_path
(
project
)
}
end
describe
'#leave_project_members_path'
do
let
(
:project
)
{
build_stubbed
(
:empty_project
)
}
it
{
expect
(
leave_project_members_path
(
project
)).
to
eq
leave_project_project_members_path
(
project
)
}
end
...
...
@@ -35,8 +34,6 @@ describe GitlabRoutingHelper do
describe
'Group URL helpers'
do
describe
'#group_members_url'
do
let
(
:group
)
{
build_stubbed
(
:group
)
}
it
{
expect
(
group_members_url
(
group
)).
to
eq
group_group_members_url
(
group
)
}
end
...
...
@@ -47,14 +44,10 @@ describe GitlabRoutingHelper do
end
describe
'#request_access_group_members_path'
do
let
(
:group
)
{
build_stubbed
(
:group
)
}
it
{
expect
(
request_access_group_members_path
(
group
)).
to
eq
request_access_group_group_members_path
(
group
)
}
end
describe
'#leave_group_members_path'
do
let
(
:group
)
{
build_stubbed
(
:group
)
}
it
{
expect
(
leave_group_members_path
(
group
)).
to
eq
leave_group_group_members_path
(
group
)
}
end
...
...
@@ -70,4 +63,44 @@ describe GitlabRoutingHelper do
it
{
expect
(
resend_invite_group_member_path
(
group_member
)).
to
eq
resend_invite_group_group_member_path
(
group_member
.
source
,
group_member
)
}
end
end
describe
'#milestone_path'
do
context
'for a group milestone'
do
let
(
:milestone
)
{
build_stubbed
(
:milestone
,
group:
group
,
iid:
1
)
}
it
'links to the group milestone page'
do
expect
(
milestone_path
(
milestone
))
.
to
eq
(
group_milestone_path
(
group
,
milestone
))
end
end
context
'for a project milestone'
do
let
(
:milestone
)
{
build_stubbed
(
:milestone
,
project:
project
,
iid:
1
)
}
it
'links to the project milestone page'
do
expect
(
milestone_path
(
milestone
))
.
to
eq
(
project_milestone_path
(
project
,
milestone
))
end
end
end
describe
'#milestone_url'
do
context
'for a group milestone'
do
let
(
:milestone
)
{
build_stubbed
(
:milestone
,
group:
group
,
iid:
1
)
}
it
'links to the group milestone page'
do
expect
(
milestone_url
(
milestone
))
.
to
eq
(
group_milestone_url
(
group
,
milestone
))
end
end
context
'for a project milestone'
do
let
(
:milestone
)
{
build_stubbed
(
:milestone
,
project:
project
,
iid:
1
)
}
it
'links to the project milestone page'
do
expect
(
milestone_url
(
milestone
))
.
to
eq
(
project_milestone_url
(
project
,
milestone
))
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