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
0f0bf2a2
Commit
0f0bf2a2
authored
Feb 14, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude public group milestones from counts
Only count milestones in groups that the user is a member of
parent
c6016ac8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
app/controllers/dashboard/milestones_controller.rb
app/controllers/dashboard/milestones_controller.rb
+1
-3
changelogs/unreleased/56332-exclude-public-group-milestones-from-count.yml
...ased/56332-exclude-public-group-milestones-from-count.yml
+5
-0
spec/controllers/dashboard/milestones_controller_spec.rb
spec/controllers/dashboard/milestones_controller_spec.rb
+5
-4
No files found.
app/controllers/dashboard/milestones_controller.rb
View file @
0f0bf2a2
...
...
@@ -25,8 +25,6 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
private
def
group_milestones
groups
=
GroupsFinder
.
new
(
current_user
,
all_available:
false
).
execute
DashboardGroupMilestone
.
build_collection
(
groups
,
params
)
end
...
...
@@ -45,6 +43,6 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
end
def
groups
@groups
||=
GroupsFinder
.
new
(
current_user
,
state_all:
tru
e
).
execute
@groups
||=
GroupsFinder
.
new
(
current_user
,
all_available:
fals
e
).
execute
end
end
changelogs/unreleased/56332-exclude-public-group-milestones-from-count.yml
0 → 100644
View file @
0f0bf2a2
---
title
:
Fix counts in milestones dashboard
merge_request
:
25230
author
:
type
:
fixed
spec/controllers/dashboard/milestones_controller_spec.rb
View file @
0f0bf2a2
...
...
@@ -3,11 +3,9 @@ require 'spec_helper'
describe
Dashboard
::
MilestonesController
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:public_group
)
{
create
(
:group
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project_milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:group_milestone
)
{
create
(
:milestone
,
group:
group
)
}
let!
(
:public_milestone
)
{
create
(
:milestone
,
group:
public_group
)
}
let
(
:milestone
)
do
DashboardMilestone
.
build
(
[
project
],
...
...
@@ -45,6 +43,9 @@ describe Dashboard::MilestonesController do
end
describe
"#index"
do
let
(
:public_group
)
{
create
(
:group
,
:public
)
}
let!
(
:public_milestone
)
{
create
(
:milestone
,
group:
public_group
)
}
render_views
it
'returns group and project milestones to which the user belongs'
do
...
...
@@ -74,10 +75,10 @@ describe Dashboard::MilestonesController do
expect
(
response
.
body
).
not_to
include
(
project_milestone
.
title
)
end
it
'should
contain
group and project milestones to which the user belongs to'
do
it
'should
show counts of
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
\"
>
3
</span>"
)
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>"
)
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