BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2368ffd9
Commit
2368ffd9
authored
Jun 09, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dashboard-milestone-tabs-loading-async' into 'master'
Fixed dashboard milestone tabs not loading Closes #33477 See merge request !12023
parents
e80df8f2
c0c82368
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
8 deletions
+110
-8
milestone_actions.rb
app/controllers/concerns/milestone_actions.rb
+3
-1
milestones_controller.rb
app/controllers/dashboard/milestones_controller.rb
+3
-1
milestones_helper.rb
app/helpers/milestones_helper.rb
+6
-0
dashboard-milestone-tabs-loading-async.yml
...ogs/unreleased/dashboard-milestone-tabs-loading-async.yml
+4
-0
dashboard.rb
config/routes/dashboard.rb
+7
-1
milestones_controller_spec.rb
spec/controllers/dashboard/milestones_controller_spec.rb
+38
-0
milestone_tabs_spec.rb
spec/features/dashboard/milestone_tabs_spec.rb
+40
-0
milestone_tabs_examples.rb
spec/support/milestone_tabs_examples.rb
+9
-5
No files found.
app/controllers/concerns/milestone_actions.rb
View file @
2368ffd9
...
...
@@ -46,8 +46,10 @@ module MilestoneActions
def
milestone_redirect_path
if
@project
namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
@milestone
)
els
e
els
if
@group
group_milestone_path
(
@group
,
@milestone
.
safe_title
,
title:
@milestone
.
title
)
else
dashboard_milestone_path
(
@milestone
.
safe_title
,
title:
@milestone
.
title
)
end
end
end
app/controllers/dashboard/milestones_controller.rb
View file @
2368ffd9
class
Dashboard
::
MilestonesController
<
Dashboard
::
ApplicationController
include
MilestoneActions
before_action
:projects
before_action
:milestone
,
only:
[
:show
]
before_action
:milestone
,
only:
[
:show
,
:merge_requests
,
:participants
,
:labels
]
def
index
respond_to
do
|
format
|
...
...
app/helpers/milestones_helper.rb
View file @
2368ffd9
...
...
@@ -121,6 +121,8 @@ module MilestonesHelper
merge_requests_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
elsif
@group
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
...
...
@@ -129,6 +131,8 @@ module MilestonesHelper
participants_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
elsif
@group
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
...
...
@@ -137,6 +141,8 @@ module MilestonesHelper
labels_namespace_project_milestone_path
(
@project
.
namespace
,
@project
,
milestone
,
format: :json
)
elsif
@group
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
changelogs/unreleased/dashboard-milestone-tabs-loading-async.yml
0 → 100644
View file @
2368ffd9
---
title
:
Fixed dashboard milestone tabs not loading
merge_request
:
author
:
config/routes/dashboard.rb
View file @
2368ffd9
...
...
@@ -4,7 +4,13 @@ resource :dashboard, controller: 'dashboard', only: [] do
get
:activity
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
:groups
,
only:
[
:index
]
...
...
spec/controllers/dashboard/milestones_controller_spec.rb
0 → 100644
View file @
2368ffd9
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 @
2368ffd9
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 @
2368ffd9
shared_examples
'milestone tabs'
do
def
go
(
path
,
extra_params
=
{})
params
=
if
milestone
.
is_a?
(
GlobalMilestone
)
{
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
params
=
case
milestone
when
DashboardMilestone
{
id:
milestone
.
safe_title
,
title:
milestone
.
title
}
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
)
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