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
03c6b4d9
Commit
03c6b4d9
authored
Jun 28, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable burndown charts when issuable weights are unlicensed
parent
8bcb10e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+2
-1
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+4
-2
spec/features/projects/milestones/ee/milestone_spec.rb
spec/features/projects/milestones/ee/milestone_spec.rb
+17
-5
No files found.
app/controllers/projects/milestones_controller.rb
View file @
03c6b4d9
...
...
@@ -45,7 +45,8 @@ class Projects::MilestonesController < Projects::ApplicationController
end
def
show
if
@project
.
feature_available?
(
:burndown_charts
,
current_user
)
if
@project
.
feature_available?
(
:burndown_charts
,
current_user
)
&&
@project
.
feature_available?
(
:issue_weights
,
current_user
)
@burndown
=
Burndown
.
new
(
@milestone
)
end
end
...
...
app/helpers/milestones_helper.rb
View file @
03c6b4d9
...
...
@@ -134,14 +134,16 @@ module MilestonesHelper
end
def
can_generate_chart?
(
burndown
)
return
unless
@project
.
feature_available?
(
:burndown_charts
,
current_user
)
return
unless
@project
.
feature_available?
(
:burndown_charts
,
current_user
)
&&
@project
.
feature_available?
(
:issue_weights
,
current_user
)
burndown
&
.
valid?
&&
!
burndown
&
.
empty?
end
def
show_burndown_placeholder?
(
warning
)
return
false
if
cookies
[
'hide_burndown_message'
].
present?
return
false
unless
@project
.
feature_available?
(
:burndown_charts
,
current_user
)
return
false
unless
@project
.
feature_available?
(
:burndown_charts
,
current_user
)
&&
@project
.
feature_available?
(
:issue_weights
,
current_user
)
warning
.
nil?
&&
can?
(
current_user
,
:admin_milestone
,
@project
)
end
...
...
spec/features/projects/milestones/ee/milestone_spec.rb
View file @
03c6b4d9
...
...
@@ -88,11 +88,7 @@ describe 'Milestones on EE', feature: true do
end
end
context
'with the burndown chart feature disabled'
do
before
do
stub_licensed_features
(
burndown_charts:
false
)
end
shared_examples
'burndown charts disabled'
do
it
'has a link to upgrade to Bronze when checking the namespace plan'
do
# Not using `stub_application_setting` because the method is prepended in
# `EE::ApplicationSetting` which breaks when using `any_instance`
...
...
@@ -118,6 +114,22 @@ describe 'Milestones on EE', feature: true do
end
end
end
context
'with the burndown chart feature disabled'
do
before
do
stub_licensed_features
(
burndown_charts:
false
)
end
include_examples
'burndown charts disabled'
end
context
'with the issuable weights feature disabled'
do
before
do
stub_licensed_features
(
issue_weights:
false
)
end
include_examples
'burndown charts disabled'
end
end
context
'milestone summary'
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