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
Jérome Perrin
gitlab-ce
Commits
c0c82368
Commit
c0c82368
authored
Jun 08, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed dashboard milestone tabs not loading
Closes #33477
parent
fd072e22
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
8 deletions
+110
-8
app/controllers/concerns/milestone_actions.rb
app/controllers/concerns/milestone_actions.rb
+3
-1
app/controllers/dashboard/milestones_controller.rb
app/controllers/dashboard/milestones_controller.rb
+3
-1
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+6
-0
changelogs/unreleased/dashboard-milestone-tabs-loading-async.yml
...ogs/unreleased/dashboard-milestone-tabs-loading-async.yml
+4
-0
config/routes/dashboard.rb
config/routes/dashboard.rb
+7
-1
spec/controllers/dashboard/milestones_controller_spec.rb
spec/controllers/dashboard/milestones_controller_spec.rb
+38
-0
spec/features/dashboard/milestone_tabs_spec.rb
spec/features/dashboard/milestone_tabs_spec.rb
+40
-0
spec/support/milestone_tabs_examples.rb
spec/support/milestone_tabs_examples.rb
+9
-5
No files found.
app/controllers/concerns/milestone_actions.rb
View file @
c0c82368
...
@@ -46,8 +46,10 @@ module MilestoneActions
...
@@ -46,8 +46,10 @@ module MilestoneActions
def
milestone_redirect_path
def
milestone_redirect_path
if
@project
if
@project
namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
@milestone
)
namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
@milestone
)
els
e
els
if
@group
group_milestone_path
(
@group
,
@milestone
.
safe_title
,
title:
@milestone
.
title
)
group_milestone_path
(
@group
,
@milestone
.
safe_title
,
title:
@milestone
.
title
)
else
dashboard_milestone_path
(
@milestone
.
safe_title
,
title:
@milestone
.
title
)
end
end
end
end
end
end
app/controllers/dashboard/milestones_controller.rb
View file @
c0c82368
class
Dashboard::MilestonesController
<
Dashboard
::
ApplicationController
class
Dashboard::MilestonesController
<
Dashboard
::
ApplicationController
include
MilestoneActions
before_action
:projects
before_action
:projects
before_action
:milestone
,
only:
[
:show
]
before_action
:milestone
,
only:
[
:show
,
:merge_requests
,
:participants
,
:labels
]
def
index
def
index
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/helpers/milestones_helper.rb
View file @
c0c82368
...
@@ -121,6 +121,8 @@ module MilestonesHelper
...
@@ -121,6 +121,8 @@ module MilestonesHelper
merge_requests_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
merge_requests_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
elsif
@group
elsif
@group
merge_requests_group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
format: :json
)
merge_requests_group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
format: :json
)
else
merge_requests_dashboard_milestone_path
(
milestone
,
title:
milestone
.
title
,
format: :json
)
end
end
end
end
...
@@ -129,6 +131,8 @@ module MilestonesHelper
...
@@ -129,6 +131,8 @@ module MilestonesHelper
participants_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
participants_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
elsif
@group
elsif
@group
participants_group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
format: :json
)
participants_group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
format: :json
)
else
participants_dashboard_milestone_path
(
milestone
,
title:
milestone
.
title
,
format: :json
)
end
end
end
end
...
@@ -137,6 +141,8 @@ module MilestonesHelper
...
@@ -137,6 +141,8 @@ module MilestonesHelper
labels_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
labels_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
elsif
@group
elsif
@group
labels_group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
format: :json
)
labels_group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
format: :json
)
else
labels_dashboard_milestone_path
(
milestone
,
title:
milestone
.
title
,
format: :json
)
end
end
end
end
end
end
changelogs/unreleased/dashboard-milestone-tabs-loading-async.yml
0 → 100644
View file @
c0c82368
---
title
:
Fixed dashboard milestone tabs not loading
merge_request
:
author
:
config/routes/dashboard.rb
View file @
c0c82368
...
@@ -4,7 +4,13 @@ resource :dashboard, controller: 'dashboard', only: [] do
...
@@ -4,7 +4,13 @@ resource :dashboard, controller: 'dashboard', only: [] do
get
:activity
get
:activity
scope
module: :dashboard
do
scope
module: :dashboard
do
resources
:milestones
,
only:
[
:index
,
:show
]
resources
:milestones
,
only:
[
:index
,
:show
]
do
member
do
get
:merge_requests
get
:participants
get
:labels
end
end
resources
:labels
,
only:
[
:index
]
resources
:labels
,
only:
[
:index
]
resources
:groups
,
only:
[
:index
]
resources
:groups
,
only:
[
:index
]
...
...
spec/controllers/dashboard/milestones_controller_spec.rb
0 → 100644
View file @
c0c82368
require
'spec_helper'
describe
Dashboard
::
MilestonesController
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project_milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:milestone
)
do
DashboardMilestone
.
build
(
[
project
],
project_milestone
.
title
)
end
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone:
project_milestone
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'Issue Label'
,
issues:
[
issue
])
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
milestone:
project_milestone
)
}
let
(
:milestone_path
)
{
dashboard_milestone_path
(
milestone
.
safe_title
,
title:
milestone
.
title
)
}
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
end
it_behaves_like
'milestone tabs'
describe
"#show"
do
render_views
def
view_milestone
get
:show
,
id:
milestone
.
safe_title
,
title:
milestone
.
title
end
it
'shows milestone page'
do
view_milestone
expect
(
response
).
to
have_http_status
(
200
)
end
end
end
spec/features/dashboard/milestone_tabs_spec.rb
0 → 100644
View file @
c0c82368
require
'spec_helper'
describe
'Dashboard milestone tabs'
,
:js
,
:feature
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
)
}
let
(
:project_milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:milestone
)
do
DashboardMilestone
.
build
(
[
project
],
project_milestone
.
title
)
end
let!
(
:merge_request
)
{
create
(
:labeled_merge_request
,
source_project:
project
,
target_project:
project
,
milestone:
project_milestone
,
labels:
[
label
])
}
before
do
project
.
add_master
(
user
)
login_as
(
user
)
visit
dashboard_milestone_path
(
milestone
.
safe_title
,
title:
milestone
.
title
)
end
it
'loads merge requests async'
do
click_link
'Merge Requests'
expect
(
page
).
to
have_selector
(
'.merge_requests-sortable-list'
)
end
it
'loads participants async'
do
click_link
'Participants'
expect
(
page
).
to
have_selector
(
'#tab-participants .bordered-list'
)
end
it
'loads labels async'
do
click_link
'Labels'
expect
(
page
).
to
have_selector
(
'#tab-labels .bordered-list'
)
end
end
spec/support/milestone_tabs_examples.rb
View file @
c0c82368
shared_examples
'milestone tabs'
do
shared_examples
'milestone tabs'
do
def
go
(
path
,
extra_params
=
{})
def
go
(
path
,
extra_params
=
{})
params
=
if
milestone
.
is_a?
(
GlobalMilestone
)
params
=
{
group_id:
group
.
to_param
,
id:
milestone
.
safe_title
,
title:
milestone
.
title
}
case
milestone
else
when
DashboardMilestone
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
id:
milestone
.
iid
}
{
id:
milestone
.
safe_title
,
title:
milestone
.
title
}
end
when
GroupMilestone
{
group_id:
group
.
to_param
,
id:
milestone
.
safe_title
,
title:
milestone
.
title
}
else
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
id:
milestone
.
iid
}
end
get
path
,
params
.
merge
(
extra_params
)
get
path
,
params
.
merge
(
extra_params
)
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