Skip to content

Commit

Permalink
Removed the need to have points earned in metadata.
Browse files Browse the repository at this point in the history
We now just calculate total points completed.
  • Loading branch information
kevPo committed Oct 26, 2016
1 parent 7e5ed6a commit 4c78061
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions lib/static/static/js/controllers/availabilityCtrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {
angular.module('huburn')
.controller('availabilityCtrl', ['$routeParams', '$scope', 'gitHubService', 'availabilityService', '$timeout',
function ($routeParams, $scope, gitHubService, availabilityService, $timeout) {
.controller('availabilityCtrl', ['$routeParams', '$scope', 'gitHubService', 'availabilityService', '$timeout', 'burnupCalculator',
function ($routeParams, $scope, gitHubService, availabilityService, $timeout, burnupCalculator) {
var sprintsInVelocity = 6;
var currentMilestone;
var velocityMilestones = [];
Expand Down Expand Up @@ -34,7 +34,9 @@
var getVelocity = function(milestone) {
gitHubService.get( { path: '/repos/' + $routeParams.repo + '/issues', milestone: milestone.number, state: 'all', per_page: 100 })
.then(function success(issues) {
milestone.metadata = getMetadata(milestone);
milestone.metadata = getMetadata(milestone);
// HACK : Need to get these types of methods off calculators
milestone.metadata.totalPointsWorkedOn = burnupCalculator.getTotalPoints(issues);
var milestones = velocityMilestones.slice(0);
milestones.push(milestone);
milestones.sort(function(a,b) { return new Date(a.due_on).getTime() - new Date(b.due_on).getTime(); });
Expand Down Expand Up @@ -97,7 +99,7 @@
function updateMilestoneDescription() {
gitHubService.patch({
path: '/repos/' + $routeParams.repo + '/milestones/' + currentMilestone,
'description': '<!--- @huburn: { "met": true, "pointsEarned": 0, "availabilityInDays": ' + $scope.availabilityInDays + ' } -->'
'description': '<!--- @huburn: { "met": true, "availabilityInDays": ' + $scope.availabilityInDays + ' } -->'
}).then(function success(data) {
$scope.saveSuccessful = true;
},
Expand Down
2 changes: 1 addition & 1 deletion lib/static/static/js/directives/huburnVelocityGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
function getVelocityMilestones(data) { return data.slice(-milestonesInVelocity); };
function sum(a,b) { return a+b; };
function met(m) { return m.metadata.met; };
function points(m) { return m.metadata.pointsEarned ? m.metadata.pointsEarned : m.metadata.points; };
function points(m) { return m.metadata.totalPointsWorkedOn; };
function dueOn(m) { return new Date(m.due_on); };

window.onresize = function() {
Expand Down
2 changes: 1 addition & 1 deletion lib/static/static/js/services/availabilityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

function getRecommendedPoints (milestones, availabilityInDays) {
var totalPointsPerDay = milestones.map(function(milestone) {
return milestone.metadata.pointsEarned / milestone.metadata.availabilityInDays;
return milestone.metadata.totalPointsWorkedOn / milestone.metadata.availabilityInDays;
}).reduce(function(total, pointsPerDay) {
return total + pointsPerDay;
}, 0);
Expand Down
2 changes: 1 addition & 1 deletion lib/static/static/js/velocityMetrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
function sum(a,b) { return a+b; };
function descendingCategory(a,b) { return b.count - a.count; };
function met(m) { return m.metadata.met; };
function points(m) { return m.metadata.pointsEarned ? m.metadata.pointsEarned : m.metadata.points; };
function points(m) { return m.metadata.totalPointsWorkedOn };
function freeranges(m) { return m.metadata.freeranges; };
function firelanes(m) { return m.metadata.firelanes; };
function escalations(m) { return m.metadata.escalations; };
Expand Down

0 comments on commit 4c78061

Please sign in to comment.