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
e6d77876
Commit
e6d77876
authored
Apr 13, 2020
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and update specs
Add burn_charts spec, move relevent tests there
parent
0d3ad66b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
87 additions
and
36 deletions
+87
-36
app/controllers/groups/milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+1
-1
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-1
ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue
...ets/javascripts/burndown_chart/components/burn_charts.vue
+3
-3
ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue
.../javascripts/burndown_chart/components/burndown_chart.vue
+10
-2
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
...ec/frontend/burndown_chart/components/burn_charts_spec.js
+65
-0
ee/spec/frontend/burndown_chart/components/burndown_chart_spec.js
...frontend/burndown_chart/components/burndown_chart_spec.js
+0
-28
locale/gitlab.pot
locale/gitlab.pot
+3
-0
qa/qa/ee/page/project/milestone/show.rb
qa/qa/ee/page/project/milestone/show.rb
+4
-1
No files found.
app/controllers/groups/milestones_controller.rb
View file @
e6d77876
...
...
@@ -6,7 +6,7 @@ class Groups::MilestonesController < Groups::ApplicationController
before_action
:milestone
,
only:
[
:edit
,
:show
,
:update
,
:merge_requests
,
:participants
,
:labels
,
:destroy
]
before_action
:authorize_admin_milestones!
,
only:
[
:edit
,
:new
,
:create
,
:update
,
:destroy
]
before_action
do
push_frontend_feature_flag
(
:burnup_charts
,
group
)
push_frontend_feature_flag
(
:burnup_charts
)
end
def
index
...
...
app/controllers/projects/milestones_controller.rb
View file @
e6d77876
...
...
@@ -7,7 +7,7 @@ class Projects::MilestonesController < Projects::ApplicationController
before_action
:check_issuables_available!
before_action
:milestone
,
only:
[
:edit
,
:update
,
:destroy
,
:show
,
:merge_requests
,
:participants
,
:labels
,
:promote
]
before_action
do
push_frontend_feature_flag
(
:burnup_charts
,
project
)
push_frontend_feature_flag
(
:burnup_charts
)
end
# Allow read any milestone
...
...
ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue
View file @
e6d77876
...
...
@@ -4,7 +4,6 @@ import { __ } from '~/locale';
import
BurndownChart
from
'
./burndown_chart.vue
'
;
export
default
{
burnupChartsEnabled
:
gon
.
features
.
burnupCharts
,
components
:
{
GlDeprecatedButton
,
GlButtonGroup
,
...
...
@@ -33,11 +32,12 @@ export default {
data
()
{
return
{
issuesSelected
:
true
,
burnupChartsEnabled
:
gon
.
features
.
burnupCharts
,
};
},
computed
:
{
title
()
{
return
this
.
$options
.
burnupChartsEnabled
?
__
(
'
Charts
'
)
:
__
(
'
Burndown chart
'
);
return
this
.
burnupChartsEnabled
?
__
(
'
Charts
'
)
:
__
(
'
Burndown chart
'
);
},
},
methods
:
{
...
...
@@ -75,7 +75,7 @@ export default {
</gl-deprecated-button>
</gl-button-group>
</div>
<div
v-if=
"
$options.
burnupChartsEnabled"
class=
"row"
>
<div
v-if=
"burnupChartsEnabled"
class=
"row"
>
<burndown-chart
:start-date=
"startDate"
:due-date=
"dueDate"
...
...
ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue
View file @
e6d77876
...
...
@@ -2,7 +2,7 @@
import
{
GlLineChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
ResizableChartContainer
from
'
~/vue_shared/components/resizable_chart/resizable_chart_container.vue
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
components
:
{
...
...
@@ -50,7 +50,15 @@ export default {
computed
:
{
dataSeries
()
{
let
name
;
const
data
=
this
.
issuesSelected
?
this
.
openIssuesCount
:
this
.
openIssuesWeight
;
let
data
;
if
(
this
.
issuesSelected
)
{
name
=
s__
(
'
BurndownChartLabel|Open issues
'
);
data
=
this
.
openIssuesCount
;
}
else
{
name
=
s__
(
'
BurndownChartLabel|Open issue weight
'
);
data
=
this
.
openIssuesWeight
;
}
const
series
=
[
{
...
...
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
0 → 100644
View file @
e6d77876
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
BurnCharts
from
'
ee/burndown_chart/components/burn_charts.vue
'
;
describe
(
'
burndown_chart
'
,
()
=>
{
let
wrapper
;
const
issuesButton
=
()
=>
wrapper
.
find
({
ref
:
'
totalIssuesButton
'
});
const
weightButton
=
()
=>
wrapper
.
find
({
ref
:
'
totalWeightButton
'
});
const
defaultProps
=
{
startDate
:
'
2019-08-07T00:00:00.000Z
'
,
dueDate
:
'
2019-09-09T00:00:00.000Z
'
,
openIssuesCount
:
[],
openIssuesWeight
:
[],
};
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
BurnCharts
,
{
propsData
:
{
...
defaultProps
,
...
props
,
},
});
};
let
origProp
;
beforeEach
(()
=>
{
origProp
=
window
.
gon
;
window
.
gon
=
{
features
:
{
monacoSnippets
:
false
,
},
};
});
afterEach
(()
=>
{
window
.
gon
=
origProp
;
});
it
(
'
inclues Issues and Issue weight buttons
'
,
()
=>
{
createComponent
();
expect
(
issuesButton
().
text
()).
toBe
(
'
Issues
'
);
expect
(
weightButton
().
text
()).
toBe
(
'
Issue weight
'
);
});
it
(
'
defaults to total issues
'
,
()
=>
{
createComponent
();
expect
(
issuesButton
().
attributes
(
'
variant
'
)).
toBe
(
'
primary
'
);
expect
(
weightButton
().
attributes
(
'
variant
'
)).
toBe
(
'
inverted-primary
'
);
});
it
(
'
toggles Issue weight
'
,
()
=>
{
createComponent
();
weightButton
().
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
issuesButton
().
attributes
(
'
variant
'
)).
toBe
(
'
inverted-primary
'
);
expect
(
weightButton
().
attributes
(
'
variant
'
)).
toBe
(
'
primary
'
);
});
});
});
ee/spec/frontend/burndown_chart/components/burndown_chart_spec.js
View file @
e6d77876
...
...
@@ -4,9 +4,6 @@ import BurndownChart from 'ee/burndown_chart/components/burndown_chart.vue';
describe
(
'
burndown_chart
'
,
()
=>
{
let
wrapper
;
const
issuesButton
=
()
=>
wrapper
.
find
({
ref
:
'
totalIssuesButton
'
});
const
weightButton
=
()
=>
wrapper
.
find
({
ref
:
'
totalWeightButton
'
});
const
defaultProps
=
{
startDate
:
'
2019-08-07T00:00:00.000Z
'
,
dueDate
:
'
2019-09-09T00:00:00.000Z
'
,
...
...
@@ -23,31 +20,6 @@ describe('burndown_chart', () => {
});
};
it
(
'
inclues Issues and Issue weight buttons
'
,
()
=>
{
createComponent
();
expect
(
issuesButton
().
text
()).
toBe
(
'
Issues
'
);
expect
(
weightButton
().
text
()).
toBe
(
'
Issue weight
'
);
});
it
(
'
defaults to total issues
'
,
()
=>
{
createComponent
();
expect
(
issuesButton
().
attributes
(
'
variant
'
)).
toBe
(
'
primary
'
);
expect
(
weightButton
().
attributes
(
'
variant
'
)).
toBe
(
'
inverted-primary
'
);
});
it
(
'
toggles Issue weight
'
,
()
=>
{
createComponent
();
weightButton
().
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
issuesButton
().
attributes
(
'
variant
'
)).
toBe
(
'
inverted-primary
'
);
expect
(
weightButton
().
attributes
(
'
variant
'
)).
toBe
(
'
primary
'
);
});
});
describe
(
'
with single point
'
,
()
=>
{
it
(
'
does not show guideline
'
,
()
=>
{
createComponent
({
...
...
locale/gitlab.pot
View file @
e6d77876
...
...
@@ -3533,6 +3533,9 @@ msgstr ""
msgid "Changing group path can have unintended side effects."
msgstr ""
msgid "Charts"
msgstr ""
msgid "Charts can't be displayed as the request for data has timed out. %{documentationLink}"
msgstr ""
...
...
qa/qa/ee/page/project/milestone/show.rb
View file @
e6d77876
...
...
@@ -14,9 +14,12 @@ module QA
element
:total_issue_weight_value
end
view
'ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue'
do
element
:weight_button
end
view
'ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue'
do
element
:burndown_chart
element
:weight_button
end
def
click_weight_button
...
...
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