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
d36d04f4
Commit
d36d04f4
authored
Mar 31, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add toggle between issue count and issue weight
parent
c2d6dd32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
app/assets/javascripts/burndown_chart/index.js
app/assets/javascripts/burndown_chart/index.js
+23
-1
app/views/shared/milestones/_burndown.html.haml
app/views/shared/milestones/_burndown.html.haml
+6
-1
No files found.
app/assets/javascripts/burndown_chart/index.js
View file @
d36d04f4
...
...
@@ -17,10 +17,32 @@ $(() => {
const
startDate
=
chartElm
.
data
(
'
startDate
'
);
const
dueDate
=
chartElm
.
data
(
'
endDate
'
);
const
chartData
=
chartElm
.
data
(
'
chartData
'
);
const
openIssuesCount
=
chartData
.
map
(
d
=>
[
d
[
0
],
d
[
1
]]);
const
openIssuesWeight
=
chartData
.
map
(
d
=>
[
d
[
0
],
d
[
2
]]);
const
chart
=
new
BurndownChart
({
container
,
startDate
,
dueDate
});
chart
.
setData
(
chartData
,
{
label
:
'
Open Issues
'
,
animate
:
true
});
let
currentView
=
'
count
'
;
chart
.
setData
(
openIssuesCount
,
{
label
:
'
Open Issues
'
,
animate
:
true
});
$
(
'
.burndown-header
'
).
on
(
'
click
'
,
'
.btn
'
,
function
switchData
()
{
const
$this
=
$
(
this
);
const
show
=
$this
.
data
(
'
show
'
);
if
(
currentView
!==
show
)
{
currentView
=
show
;
$this
.
addClass
(
'
active
'
).
siblings
().
removeClass
(
'
active
'
);
switch
(
show
)
{
case
'
count
'
:
chart
.
setData
(
openIssuesCount
,
{
label
:
'
Open Issues
'
,
animate
:
true
});
break
;
case
'
weight
'
:
chart
.
setData
(
openIssuesWeight
,
{
label
:
'
Open Issue Weight
'
,
animate
:
true
});
break
;
default
:
break
;
}
}
});
window
.
addEventListener
(
'
resize
'
,
()
=>
chart
.
animateResize
(
1
));
$
(
document
).
on
(
'
click
'
,
'
.js-sidebar-toggle
'
,
()
=>
chart
.
animateResize
(
2
));
...
...
app/views/shared/milestones/_burndown.html.haml
View file @
d36d04f4
...
...
@@ -25,5 +25,10 @@
-
if
can_generate_chart
.burndown-header
%h3
Open issues
Burndown Chart
.btn-group
%button
.btn.btn-xs.btn-primary.active
{
data:
{
show:
'count'
}
}
Issues
%button
.btn.btn-xs.btn-primary
{
data:
{
show:
'weight'
}
}
Issue Weight
.burndown-chart
{
data:
{
start_date:
burndown
.
start_date
.
strftime
(
"%Y-%m-%d"
),
end_date:
burndown
.
end_date
.
strftime
(
"%Y-%m-%d"
),
chart_data:
burndown
.
chart_data
.
to_json
}
}
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