mirror of
https://github.com/status-im/burnchart.git
synced 2025-02-09 09:03:52 +00:00
fix empty milestones div by 0
This commit is contained in:
parent
bd9a43e1a9
commit
391adb5388
@ -1,5 +1,6 @@
|
|||||||
#Tasks to do
|
#Tasks to do
|
||||||
|
|
||||||
|
- [ ] success/warn topbar on milestone page is only shown if we async load data
|
||||||
- [ ] create notes about how original people can upgrade to burnchart
|
- [ ] create notes about how original people can upgrade to burnchart
|
||||||
- [ ] clean up docs, track them on git or using Assembly system?
|
- [ ] clean up docs, track them on git or using Assembly system?
|
||||||
- [ ] rename repo to burnchart
|
- [ ] rename repo to burnchart
|
||||||
@ -14,12 +15,12 @@
|
|||||||
##Next Release
|
##Next Release
|
||||||
|
|
||||||
- [ ] https://github.com/medic/medic-webapp project is overdue and trendline & ideal line end on that date; should max on that date or today's date
|
- [ ] https://github.com/medic/medic-webapp project is overdue and trendline & ideal line end on that date; should max on that date or today's date
|
||||||
- [*] https://github.com/ractivejs/ractive gives me NaN for a milestone progress %
|
|
||||||
- [ ] http://burnchart.io#rails I would expect it to list all the projects for that owner so I can select one of them (Ryan)
|
- [ ] http://burnchart.io#rails I would expect it to list all the projects for that owner so I can select one of them (Ryan)
|
||||||
- [ ] why didn't Reset DB load demo data? (Ryan)
|
- [ ] why didn't Reset DB load demo data? (Ryan)
|
||||||
|
|
||||||
##Backlog
|
##Backlog
|
||||||
|
|
||||||
|
- [ ] be able to specify milestone by name (will nicely show in title)
|
||||||
- [ ] focus on form fields style (blue outline etc)
|
- [ ] focus on form fields style (blue outline etc)
|
||||||
- [ ] switch off `user-select` on buttons
|
- [ ] switch off `user-select` on buttons
|
||||||
- [ ] make async pages transition so that there is no "jumping" on the page
|
- [ ] make async pages transition so that there is no "jumping" on the page
|
||||||
@ -30,7 +31,6 @@
|
|||||||
- [ ] responsive layout
|
- [ ] responsive layout
|
||||||
- [ ] show project name on the milestone page, in the title
|
- [ ] show project name on the milestone page, in the title
|
||||||
- [ ] conctact the people that have starred the original burndown chart telling them about the repo; keep track of connects via a tiny crm/spreadsheet and use a custom email address like radek@burnchart.io
|
- [ ] conctact the people that have starred the original burndown chart telling them about the repo; keep track of connects via a tiny crm/spreadsheet and use a custom email address like radek@burnchart.io
|
||||||
- [ ] success/warn topbar on milestone page is only shown if we async load data
|
|
||||||
- [ ] html entities (like & at the bottom of the page) are not being rendered correctly; {{{}}} ?
|
- [ ] html entities (like & at the bottom of the page) are not being rendered correctly; {{{}}} ?
|
||||||
- [ ] `rails/rails/24` has issues in two clusters as if merged from two milestones
|
- [ ] `rails/rails/24` has issues in two clusters as if merged from two milestones
|
||||||
- [ ] trendline cutting into axes
|
- [ ] trendline cutting into axes
|
||||||
|
@ -1,19 +1,24 @@
|
|||||||
moment = require 'moment'
|
moment = require 'moment'
|
||||||
|
|
||||||
# Progress in %.
|
# Progress in %.
|
||||||
progress = (a, b) -> 100 * (a / (b + a))
|
progress = (a, b) ->
|
||||||
|
if a + b is 0 then 0 else 100 * (a / (b + a))
|
||||||
|
|
||||||
# Calculate the stats for a milestone.
|
# Calculate the stats for a milestone.
|
||||||
# Is it on time? What is the progress?
|
# Is it on time? What is the progress?
|
||||||
module.exports = (milestone) ->
|
module.exports = (milestone) ->
|
||||||
isDone = no ; isOnTime = yes ; isOverdue = no
|
isDone = no ; isOnTime = yes ; isOverdue = no ; isEmpty = yes; points = 0
|
||||||
|
|
||||||
# Progress in points.
|
# Progress in points.
|
||||||
points = progress milestone.issues.closed.size, milestone.issues.open.size
|
a = milestone.issues.closed.size
|
||||||
isDone = yes if points is 100
|
b = milestone.issues.open.size
|
||||||
|
if a + b > 0
|
||||||
|
isEmpty = no
|
||||||
|
points = progress a, b
|
||||||
|
isDone = yes if points is 100
|
||||||
|
|
||||||
# Milestones with no due date are always on track.
|
# Milestones with no due date are always on track.
|
||||||
return { isOverdue, isOnTime, isDone, 'progress': { points } } unless milestone.due_on
|
return { isOverdue, isOnTime, isDone, isEmpty, 'progress': { points } } unless milestone.due_on
|
||||||
|
|
||||||
a = +new Date milestone.created_at
|
a = +new Date milestone.created_at
|
||||||
b = +new Date
|
b = +new Date
|
||||||
|
@ -62,9 +62,17 @@ module.exports = Eventful.extend
|
|||||||
'system': yes
|
'system': yes
|
||||||
'ttl': null
|
'ttl': null
|
||||||
} if err
|
} if err
|
||||||
|
|
||||||
# Save the milestone with issues.
|
# Save the milestone with issues.
|
||||||
projects.addMilestone project, data
|
projects.addMilestone project, data
|
||||||
|
|
||||||
|
# No issues?
|
||||||
|
return @publish '!app/notify', {
|
||||||
|
'text': 'The milestone has no issues'
|
||||||
|
'type': 'warn'
|
||||||
|
'system': yes
|
||||||
|
'ttl': null
|
||||||
|
} if data.stats.isEmpty
|
||||||
|
|
||||||
# Done?
|
# Done?
|
||||||
@publish '!app/notify', {
|
@publish '!app/notify', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user