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
21bab0e2
Commit
21bab0e2
authored
Jul 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
e9e519ac
0b859d2f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
app/models/dashboard_group_milestone.rb
app/models/dashboard_group_milestone.rb
+1
-2
changelogs/unreleased/group-milestones-dashboard-blunceford.yml
...logs/unreleased/group-milestones-dashboard-blunceford.yml
+5
-0
spec/controllers/dashboard/milestones_controller_spec.rb
spec/controllers/dashboard/milestones_controller_spec.rb
+13
-2
No files found.
app/models/dashboard_group_milestone.rb
View file @
21bab0e2
...
...
@@ -15,8 +15,7 @@ class DashboardGroupMilestone < GlobalMilestone
milestones
=
Milestone
.
of_groups
(
groups
.
select
(
:id
))
.
reorder_by_due_date_asc
.
order_by_name_asc
.
active
milestones
=
milestones
.
search_title
(
params
[
:search_title
])
if
params
[
:search_title
].
present?
milestones
.
map
{
|
m
|
new
(
m
)
}
Milestone
.
filter_by_state
(
milestones
,
params
[
:state
])
.
map
{
|
m
|
new
(
m
)
}
end
end
changelogs/unreleased/group-milestones-dashboard-blunceford.yml
0 → 100644
View file @
21bab0e2
---
title
:
Fix bug in dashboard display of closed milestones
merge_request
:
30820
author
:
type
:
fixed
spec/controllers/dashboard/milestones_controller_spec.rb
View file @
21bab0e2
...
...
@@ -47,6 +47,8 @@ describe Dashboard::MilestonesController do
describe
"#index"
do
let
(
:public_group
)
{
create
(
:group
,
:public
)
}
let!
(
:public_milestone
)
{
create
(
:milestone
,
group:
public_group
)
}
let!
(
:closed_group_milestone
)
{
create
(
:milestone
,
group:
group
,
state:
'closed'
)
}
let!
(
:closed_project_milestone
)
{
create
(
:milestone
,
project:
project
,
state:
'closed'
)
}
render_views
...
...
@@ -59,6 +61,15 @@ describe Dashboard::MilestonesController do
expect
(
json_response
.
map
{
|
i
|
i
[
"group_name"
]
}.
compact
).
to
match_array
(
group
.
name
)
end
it
'returns closed group and project milestones to which the user belongs'
do
get
:index
,
params:
{
state:
'closed'
},
format: :json
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
.
size
).
to
eq
(
2
)
expect
(
json_response
.
map
{
|
i
|
i
[
"name"
]
}).
to
match_array
([
closed_group_milestone
.
name
,
closed_project_milestone
.
name
])
expect
(
json_response
.
map
{
|
i
|
i
[
"group_name"
]
}.
compact
).
to
match_array
(
group
.
name
)
end
it
'searches legacy project milestones by title when search_title is given'
do
project_milestone
=
create
(
:milestone
,
title:
'Project milestone title'
,
project:
project
)
...
...
@@ -77,11 +88,11 @@ describe Dashboard::MilestonesController do
expect
(
response
.
body
).
not_to
include
(
project_milestone
.
title
)
end
it
'shows counts of group and project milestones to which the user belongs to'
do
it
'shows counts of
open and closed
group and project milestones to which the user belongs to'
do
get
:index
expect
(
response
.
body
).
to
include
(
"Open
\n
<span class=
\"
badge badge-pill
\"
>2</span>"
)
expect
(
response
.
body
).
to
include
(
"Closed
\n
<span class=
\"
badge badge-pill
\"
>
0
</span>"
)
expect
(
response
.
body
).
to
include
(
"Closed
\n
<span class=
\"
badge badge-pill
\"
>
2
</span>"
)
end
context
'external authorization'
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