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
b1721584
Commit
b1721584
authored
Apr 16, 2020
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better check for feature using mixin
parent
39abea2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
32 deletions
+14
-32
ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue
...ets/javascripts/burndown_chart/components/burn_charts.vue
+8
-10
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
...ec/frontend/burndown_chart/components/burn_charts_spec.js
+6
-22
No files found.
ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue
View file @
b1721584
<
script
>
import
{
GlButton
,
GlButtonGroup
}
from
'
@gitlab/ui
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
__
}
from
'
~/locale
'
;
import
BurndownChart
from
'
./burndown_chart.vue
'
;
...
...
@@ -9,6 +10,7 @@ export default {
GlButtonGroup
,
BurndownChart
,
},
mixins
:
[
glFeatureFlagsMixin
()],
props
:
{
startDate
:
{
type
:
String
,
...
...
@@ -32,12 +34,11 @@ export default {
data
()
{
return
{
issuesSelected
:
true
,
burnupChartsEnabled
:
gon
.
features
.
burnupCharts
,
};
},
computed
:
{
title
()
{
return
this
.
burnupChartsEnabled
?
__
(
'
Charts
'
)
:
__
(
'
Burndown chart
'
);
return
this
.
glFeatures
.
burnupCharts
?
__
(
'
Charts
'
)
:
__
(
'
Burndown chart
'
);
},
issueButtonCategory
()
{
return
this
.
issuesSelected
?
'
primary
'
:
'
secondary
'
;
...
...
@@ -47,11 +48,8 @@ export default {
},
},
methods
:
{
showIssueCount
()
{
this
.
issuesSelected
=
true
;
},
showIssueWeight
()
{
this
.
issuesSelected
=
false
;
setIssueSelected
(
selected
)
{
this
.
issuesSelected
=
selected
;
},
},
};
...
...
@@ -67,7 +65,7 @@ export default {
:category=
"issueButtonCategory"
variant=
"info"
size=
"small"
@
click=
"s
howIssueCount
"
@
click=
"s
etIssueSelected(true)
"
>
{{
__
(
'
Issues
'
)
}}
</gl-button>
...
...
@@ -77,13 +75,13 @@ export default {
variant=
"info"
size=
"small"
data-qa-selector=
"weight_button"
@
click=
"s
howIssueWeight
"
@
click=
"s
etIssueSelected(false)
"
>
{{
__
(
'
Issue weight
'
)
}}
</gl-button>
</gl-button-group>
</div>
<div
v-if=
"
burnupChartsEnabled
"
class=
"row"
>
<div
v-if=
"
glFeatures.burnupCharts
"
class=
"row"
>
<burndown-chart
:start-date=
"startDate"
:due-date=
"dueDate"
...
...
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
View file @
b1721584
...
...
@@ -20,30 +20,18 @@ describe('burndown_chart', () => {
openIssuesWeight
:
[],
};
const
createComponent
=
(
props
=
{})
=>
{
const
createComponent
=
(
{
props
=
{},
featureEnabled
=
false
}
=
{})
=>
{
wrapper
=
shallowMount
(
BurnCharts
,
{
propsData
:
{
...
defaultProps
,
...
props
,
},
provide
:
{
glFeatures
:
{
burnupCharts
:
featureEnabled
},
},
});
};
let
origProp
;
beforeEach
(()
=>
{
origProp
=
window
.
gon
;
window
.
gon
=
{
features
:
{
burnupCharts
:
false
,
},
};
});
afterEach
(()
=>
{
window
.
gon
=
origProp
;
});
it
(
'
includes Issues and Issue weight buttons
'
,
()
=>
{
createComponent
();
...
...
@@ -80,9 +68,7 @@ describe('burndown_chart', () => {
describe
(
'
feature disabled
'
,
()
=>
{
beforeEach
(()
=>
{
window
.
gon
.
features
.
burnupCharts
=
false
;
createComponent
();
createComponent
({
featureEnabled
:
false
});
});
it
(
'
does not reduce width of burndown chart
'
,
()
=>
{
...
...
@@ -97,9 +83,7 @@ describe('burndown_chart', () => {
describe
(
'
feature enabled
'
,
()
=>
{
beforeEach
(()
=>
{
window
.
gon
.
features
.
burnupCharts
=
true
;
createComponent
();
createComponent
({
featureEnabled
:
true
});
});
it
(
'
reduces width of burndown chart
'
,
()
=>
{
...
...
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