Updating doom line when changing us points

stable
Alejandro Alonso 2014-07-03 10:28:35 +02:00
parent be7e4c11dc
commit 8c12807296
2 changed files with 10 additions and 4 deletions

View File

@ -287,8 +287,13 @@ BacklogDirective = ($repo, $rootscope) ->
# Remove them from backlog # Remove them from backlog
$scope.userstories = ussCurrent.without.apply(ussCurrent, selectedUss).value() $scope.userstories = ussCurrent.without.apply(ussCurrent, selectedUss).value()
extraPoints = _.map(selectedUss, (v, k) -> v.total_points)
totalExtraPoints = _.reduce(extraPoints, (acc, num) -> acc + num)
# Add them to current sprint # Add them to current sprint
$scope.sprints[0].user_stories = _.union(selectedUss, $scope.sprints[0].user_stories) $scope.sprints[0].user_stories = _.union(selectedUss, $scope.sprints[0].user_stories)
# Update the total of points
$scope.sprints[0].total_points += totalExtraPoints
$ctrl.filterVisibleUserstories() $ctrl.filterVisibleUserstories()
$repo.saveAll(selectedUss) $repo.saveAll(selectedUss)
@ -596,8 +601,6 @@ UsPointsDirective = ($repo) ->
event.preventDefault() event.preventDefault()
target = angular.element(event.target) target = angular.element(event.target)
console.log target
if target.is("span") if target.is("span")
event.stopPropagation() event.stopPropagation()
@ -643,6 +646,9 @@ UsPointsDirective = ($repo) ->
$repo.refresh(us).then -> $repo.refresh(us).then ->
$ctrl.loadProjectStats() $ctrl.loadProjectStats()
scopeDefer $scope, ->
$scope.$emit("doomline:redraw")
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()

View File

@ -20,10 +20,10 @@ section.sprints
div.sprint-date(tg-date-range="sprint.estimated_start,sprint.estimated_finish") div.sprint-date(tg-date-range="sprint.estimated_start,sprint.estimated_finish")
ul ul
li li
span.number(tg-bo-html="sprint.closed_points") -- span.number(ng-bind="sprint.closed_points|default:''") --
span.description closed span.description closed
li li
span.number(tg-bo-html="sprint.total_points") -- span.number(ng-bind="sprint.total_points|default:''")
span.description total span.description total
div.sprint-progress-bar div.sprint-progress-bar
div.current-progress(tg-sprint-progressbar="sprint") div.current-progress(tg-sprint-progressbar="sprint")