Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
feat(nextSprint): highlight backlog component status
Browse files Browse the repository at this point in the history
Closes #DOST05-583
  • Loading branch information
Carlos Medina Sanchez committed Feb 1, 2018
1 parent eb9ef78 commit 7ded25e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mirrorgate-dashboard/src/components/tiles/team/nextSprint.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,22 @@ <h2 class="title">Backlog status</h2>
}
}

function getComponentState(stats){
var percentage = (stats.backlogEstimate * 100) / stats.velocity;
return percentage < 70 ? 'error' : percentage < 90 ? 'warn' : 'unknown';
}

MGComponent({
name: 'next-sprint-tile',
controllerClass: TeamController,
parent: Tile,
render: function (sprintData) {
processAlerts: function (sprintData) {
Utils.raiseEvent(this, {
status: sprintData ? 'unknown' : 'server-error'
status: sprintData ? (sprintData.stats ? getComponentState(sprintData.stats) : 'unknown') : 'server-error'
});
},

render: function (sprintData) {
if (sprintData) {
var model = this.getModel();
model.stats = sprintData.stats || {};
Expand All @@ -104,8 +110,9 @@ <h2 class="title">Backlog status</h2>

model.stats.backlogFillRate = 70 * model.stats.backlogEstimate / model.stats.velocity;
}

}

this.processAlerts(sprintData);
}
});

Expand Down

0 comments on commit 7ded25e

Please sign in to comment.