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
...
@@ -6,7 +6,7 @@ class Groups::MilestonesController < Groups::ApplicationController
before_action
:milestone
,
only:
[
:edit
,
:show
,
:update
,
:merge_requests
,
:participants
,
:labels
,
:destroy
]
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
:authorize_admin_milestones!
,
only:
[
:edit
,
:new
,
:create
,
:update
,
:destroy
]
before_action
do
before_action
do
push_frontend_feature_flag
(
:burnup_charts
,
group
)
push_frontend_feature_flag
(
:burnup_charts
)
end
end
def
index
def
index
...
...
app/controllers/projects/milestones_controller.rb
View file @
e6d77876
...
@@ -7,7 +7,7 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -7,7 +7,7 @@ class Projects::MilestonesController < Projects::ApplicationController
before_action
:check_issuables_available!
before_action
:check_issuables_available!
before_action
:milestone
,
only:
[
:edit
,
:update
,
:destroy
,
:show
,
:merge_requests
,
:participants
,
:labels
,
:promote
]
before_action
:milestone
,
only:
[
:edit
,
:update
,
:destroy
,
:show
,
:merge_requests
,
:participants
,
:labels
,
:promote
]
before_action
do
before_action
do
push_frontend_feature_flag
(
:burnup_charts
,
project
)
push_frontend_feature_flag
(
:burnup_charts
)
end
end
# Allow read any milestone
# Allow read any milestone
...
...
ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue
View file @
e6d77876
...
@@ -4,7 +4,6 @@ import { __ } from '~/locale';
...
@@ -4,7 +4,6 @@ import { __ } from '~/locale';
import
BurndownChart
from
'
./burndown_chart.vue
'
;
import
BurndownChart
from
'
./burndown_chart.vue
'
;
export
default
{
export
default
{
burnupChartsEnabled
:
gon
.
features
.
burnupCharts
,
components
:
{
components
:
{
GlDeprecatedButton
,
GlDeprecatedButton
,
GlButtonGroup
,
GlButtonGroup
,
...
@@ -33,11 +32,12 @@ export default {
...
@@ -33,11 +32,12 @@ export default {
data
()
{
data
()
{
return
{
return
{
issuesSelected
:
true
,
issuesSelected
:
true
,
burnupChartsEnabled
:
gon
.
features
.
burnupCharts
,
};
};
},
},
computed
:
{
computed
:
{
title
()
{
title
()
{
return
this
.
$options
.
burnupChartsEnabled
?
__
(
'
Charts
'
)
:
__
(
'
Burndown chart
'
);
return
this
.
burnupChartsEnabled
?
__
(
'
Charts
'
)
:
__
(
'
Burndown chart
'
);
},
},
},
},
methods
:
{
methods
:
{
...
@@ -75,7 +75,7 @@ export default {
...
@@ -75,7 +75,7 @@ export default {
</gl-deprecated-button>
</gl-deprecated-button>
</gl-button-group>
</gl-button-group>
</div>
</div>
<div
v-if=
"
$options.
burnupChartsEnabled"
class=
"row"
>
<div
v-if=
"burnupChartsEnabled"
class=
"row"
>
<burndown-chart
<burndown-chart
:start-date=
"startDate"
:start-date=
"startDate"
:due-date=
"dueDate"
:due-date=
"dueDate"
...
...
ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue
View file @
e6d77876
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
GlLineChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlLineChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
dateFormat
from
'
dateformat
'
;
import
ResizableChartContainer
from
'
~/vue_shared/components/resizable_chart/resizable_chart_container.vue
'
;
import
ResizableChartContainer
from
'
~/vue_shared/components/resizable_chart/resizable_chart_container.vue
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -50,7 +50,15 @@ export default {
...
@@ -50,7 +50,15 @@ export default {
computed
:
{
computed
:
{
dataSeries
()
{
dataSeries
()
{
let
name
;
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
=
[
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';
...
@@ -4,9 +4,6 @@ import BurndownChart from 'ee/burndown_chart/components/burndown_chart.vue';
describe
(
'
burndown_chart
'
,
()
=>
{
describe
(
'
burndown_chart
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
issuesButton
=
()
=>
wrapper
.
find
({
ref
:
'
totalIssuesButton
'
});
const
weightButton
=
()
=>
wrapper
.
find
({
ref
:
'
totalWeightButton
'
});
const
defaultProps
=
{
const
defaultProps
=
{
startDate
:
'
2019-08-07T00:00:00.000Z
'
,
startDate
:
'
2019-08-07T00:00:00.000Z
'
,
dueDate
:
'
2019-09-09T00:00:00.000Z
'
,
dueDate
:
'
2019-09-09T00:00:00.000Z
'
,
...
@@ -23,31 +20,6 @@ describe('burndown_chart', () => {
...
@@ -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
'
,
()
=>
{
describe
(
'
with single point
'
,
()
=>
{
it
(
'
does not show guideline
'
,
()
=>
{
it
(
'
does not show guideline
'
,
()
=>
{
createComponent
({
createComponent
({
...
...
locale/gitlab.pot
View file @
e6d77876
...
@@ -3533,6 +3533,9 @@ msgstr ""
...
@@ -3533,6 +3533,9 @@ msgstr ""
msgid "Changing group path can have unintended side effects."
msgid "Changing group path can have unintended side effects."
msgstr ""
msgstr ""
msgid "Charts"
msgstr ""
msgid "Charts can't be displayed as the request for data has timed out. %{documentationLink}"
msgid "Charts can't be displayed as the request for data has timed out. %{documentationLink}"
msgstr ""
msgstr ""
...
...
qa/qa/ee/page/project/milestone/show.rb
View file @
e6d77876
...
@@ -14,9 +14,12 @@ module QA
...
@@ -14,9 +14,12 @@ module QA
element
:total_issue_weight_value
element
:total_issue_weight_value
end
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
view
'ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue'
do
element
:burndown_chart
element
:burndown_chart
element
:weight_button
end
end
def
click_weight_button
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