-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add non-dev time comparisons #4
base: master
Are you sure you want to change the base?
Changes from all commits
f9b4826
287fb0f
28d6eb9
6289a84
9116c5a
a71f0f2
1b2d0fb
932977d
8b0d948
d46252f
c877ac2
20e19c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,10 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
unless _(allBugs).isEmpty() | ||
drawDonutChart(getGroupedData(allBugs, 'status'), 'bugs-by-status', 0.40, 283, true) | ||
|
||
allTimeSpent = getAllTimeSpent() | ||
unless _(allTimeSpent).isEmpty() | ||
drawDonutChart(allTimeSpent, 'all-logged-work', 0.40, 450, true) | ||
|
||
openBugs = getOpenBugs() | ||
unless _(openBugs).isEmpty() | ||
drawDonutChart(getGroupedData(openBugs, 'priority'), 'open-bugs-by-priority', 0.40, 283, true) | ||
|
@@ -60,6 +64,10 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
true | ||
) | ||
|
||
NonDevTasksTimeSpent = getNonDevTasksTimeSpent() | ||
unless _(NonDevTasksTimeSpent).isEmpty() | ||
drawDonutChart(NonDevTasksTimeSpent, 'non-dev-tickets', 0.40, 450, false) | ||
|
||
@drawDonutChart = (data, domId, ratio, size, showLegend) -> | ||
nv.addGraph -> | ||
chart = nv.models.pieChart() | ||
|
@@ -69,7 +77,7 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
.height(size) | ||
.showLabels(false) | ||
.showLegend(showLegend) | ||
.tooltipContent((key, y, e) -> "<h3> #{key} </h3> <p> #{Math.round(y)} </p>") | ||
.tooltipContent((key, y, e) -> "<h3> #{key} </h3> <p> #{y} </p>") | ||
.width(size) | ||
.x((d) -> d.label) | ||
.y((d) -> d.value) | ||
|
@@ -90,6 +98,61 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
{ fields: { 'points': 0 } } | ||
).fetch() | ||
|
||
@getAllTimeSpent = -> | ||
bugsTime = 0 | ||
featureTime = 0 | ||
nonDevTime = 0 | ||
bugAddition = getAllBugs().forEach((ticket) -> | ||
workForticket = ticket.worklog.forEach((log) -> | ||
if log.date <= getEndDate() and log.date >= getStartDate() | ||
bugsTime += log.time | ||
) | ||
) | ||
featureAddition = getFeatureTickets().forEach((ticket) -> | ||
workForticket = ticket.worklog.forEach((log) -> | ||
if log.date <= getEndDate() and log.date >= getStartDate() | ||
featureTime += log.time | ||
) | ||
) | ||
nonDevAddition = getNonDevTasks().forEach((ticket) -> | ||
workForticket = ticket.worklog.forEach((log) -> | ||
if log.date <= getEndDate() and log.date >= getStartDate() | ||
nonDevTime += log.time | ||
) | ||
) | ||
allTime = | ||
Bugs: bugsTime | ||
NewDevelopment: featureTime | ||
NonDev: nonDevTime | ||
aggregatedData = _(allTime).map((value, key) -> | ||
label: key | ||
value: value | ||
) | ||
aggregatedData | ||
|
||
@getAllTimeSpentRecently = -> | ||
bugsTime = 0 | ||
featureTime = 0 | ||
nonDevTime = 0 | ||
bugAddition = getAllBugs().forEach((ticket) -> | ||
bugsTime += ticket.timespent | ||
) | ||
featureAddition = getFeatureTickets().forEach((ticket) -> | ||
featureTime += ticket.timespent | ||
) | ||
nonDevAddition = getNonDevTasks().forEach((ticket) -> | ||
nonDevTime += ticket.timespent | ||
) | ||
allTime = | ||
Bugs: bugsTime | ||
Features: featureTime | ||
NonDev: nonDevTime | ||
aggregatedData = _(allTime).map((value, key) -> | ||
label: key | ||
value: value | ||
) | ||
aggregatedData | ||
|
||
@getClosedBugs = -> | ||
Tickets.find( | ||
status: $in: closedTicketStatuses | ||
|
@@ -126,6 +189,13 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
) | ||
aggregatedData | ||
|
||
@getEndDate = -> | ||
settings = getSettings() | ||
if settings.analysisEndDate | ||
moment(settings.analysisEndDate).toDate() | ||
else | ||
moment().toDate() | ||
|
||
@getEstimatedCompletionDate = -> | ||
settings = getSettings() | ||
unless settings is undefined | ||
|
@@ -149,10 +219,35 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
|
||
addWeekdaysToToday(calendarDaysRemaining) | ||
|
||
@getFeatureTickets = -> | ||
Tickets.find( | ||
labels: $ne: 'ExcludeFromKanburn' | ||
type: $ne: 'Bug' | ||
) | ||
|
||
@getGroupedData = (data, grouping) -> | ||
groupedData = _(data).groupBy(grouping) | ||
_(groupedData).map((value, key) -> { label: key, value: Math.round(value.length) }) | ||
|
||
@getNonDevTasks = -> | ||
Tickets.find( | ||
labels: 'ExcludeFromKanburn' | ||
status: $nin: closedTicketStatuses | ||
type: 'Task' | ||
).fetch() | ||
|
||
@getNonDevTasksTimeSpent = -> | ||
nonDevTasksTimeSpentData = getNonDevTasks().map((value, key) -> | ||
totalTime = 0 | ||
workForticket = value.worklog.forEach((log) -> | ||
if log.date <= getEndDate() and log.date >= getStartDate() | ||
totalTime += log.time | ||
) | ||
label: value.title | ||
value: if totalTime? then totalTime else 0 | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need these parens |
||
nonDevTasksTimeSpentData | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also don't think this variable or return are needed. |
||
|
||
@getOpenBugs = -> | ||
Tickets.find( | ||
status: $nin: closedTicketStatuses | ||
|
@@ -180,6 +275,13 @@ closedTicketStatuses = ['Closed', 'Delivery QA', 'Deployed', 'Review'] | |
{ name: 'Measures', activeClass: isActiveSquad('Measures') } | ||
] | ||
|
||
@getStartDate = -> | ||
settings = getSettings() | ||
if settings.analysisStartDate | ||
moment(settings.analysisStartDate).toDate() | ||
else | ||
moment('7/20/2015').toDate() | ||
|
||
@getTicketsOnHold = -> | ||
Tickets.find( | ||
title: /\bhold/i | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ Meteor.publish 'tickets', (selectedSquad) -> | |
headerValue = CryptoJS.enc.Utf8.parse("#{username}:#{password}") | ||
authorizationHeader = "Basic #{CryptoJS.enc.Base64.stringify(headerValue)}" | ||
baseUrl = 'https://jira.arcadiasolutions.com/rest/api/latest/search?jql=' | ||
fields = 'components,customfield_10002,issuetype,labels,priority,status,summary' | ||
fields = 'components,customfield_10002,issuetype,labels,priority,status,summary,timespent,worklog' | ||
|
||
apiRoute = (filterId) -> | ||
"#{baseUrl}filter=#{filterId}&fields=#{fields}&maxResults=1000" | ||
|
@@ -60,15 +60,23 @@ Meteor.publish 'tickets', (selectedSquad) -> | |
ticketsForSelectedSquad = nonBugTickets.concat(bugTickets).concat(ticketsWithoutComponents) | ||
|
||
formattedTickets = _(ticketsForSelectedSquad).forEach (issue) -> | ||
worklog = issue.fields.worklog.worklogs.map (worklog) -> | ||
{ | ||
time: worklog.timeSpentSeconds/3600 | ||
date: moment(worklog.started).toDate() | ||
} | ||
doc = | ||
component: if issue.fields.components[0] then issue.fields.components[0].name else '' | ||
id: issue.key | ||
points: issue.fields.customfield_10002 or '' | ||
priority: issue.fields.priority.name | ||
labels: issue.fields.labels | ||
status: issue.fields.status.name | ||
timespent: issue.fields.timespent/3600 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to see if we can use moment to do some nice formatting here. At the very least some rounding would be nice. |
||
title: issue.fields.summary | ||
type: issue.fields.issuetype.name | ||
worklog: worklog | ||
|
||
|
||
self.added 'tickets', Random.id(), doc | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use
reduce()
for these functions - http://underscorejs.org/#reduce