Move to current sprint implementation for backlog
parent
3747b1f7d3
commit
988675c310
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
CreateEditUserstoryDirective = ($repo, $model, $rs) ->
|
CreateEditUserstoryDirective = ($repo, $model, $rs) ->
|
||||||
|
|
||||||
editDescription = ($scope, $el) ->
|
editDescription = ($scope, $el) ->
|
||||||
$el.find('.markdown-preview a').removeClass("active")
|
$el.find('.markdown-preview a').removeClass("active")
|
||||||
$el.find('.markdown-preview a.edit').addClass("active")
|
$el.find('.markdown-preview a.edit').addClass("active")
|
||||||
descriptionDOM = $el.find("textarea.description")
|
descriptionDOM = $el.find("textarea.description")
|
||||||
|
|
|
@ -201,6 +201,39 @@ BacklogDirective = ($repo) ->
|
||||||
onRemove: onRemoveItem
|
onRemove: onRemoveItem
|
||||||
})
|
})
|
||||||
|
|
||||||
|
##############################
|
||||||
|
## Move to current sprint link
|
||||||
|
##############################
|
||||||
|
linkMoveToCurrentSprint = ($scope, $el, $attrs, $ctrl) ->
|
||||||
|
|
||||||
|
moveToCurrentSprint = (selectedUss) ->
|
||||||
|
ussCurrent = _($scope.userstories)
|
||||||
|
# Remove them from backlog
|
||||||
|
$scope.userstories = ussCurrent.without.apply(ussCurrent, selectedUss).value()
|
||||||
|
# Add them to current sprint
|
||||||
|
$scope.sprints[0].user_stories = _.union(selectedUss, $scope.sprints[0].user_stories)
|
||||||
|
$ctrl.filterVisibleUserstories()
|
||||||
|
$repo.saveAll(selectedUss)
|
||||||
|
|
||||||
|
|
||||||
|
# Enable move to current sprint only when there are selected us's
|
||||||
|
$el.on "change", ".backlog-table-body .user-stories input:checkbox", (event) ->
|
||||||
|
moveToCurrentSprintDom = $el.find("#move-to-current-sprint")
|
||||||
|
if $el.find(".backlog-table-body .user-stories input:checkbox:checked").length > 0 and $scope.sprints.length > 0
|
||||||
|
moveToCurrentSprintDom.show()
|
||||||
|
else
|
||||||
|
moveToCurrentSprintDom.hide()
|
||||||
|
|
||||||
|
$el.on "click", "#move-to-current-sprint", (event) =>
|
||||||
|
# Calculating the us's to be modified
|
||||||
|
ussDom = $el.find(".backlog-table-body .user-stories input:checkbox:checked")
|
||||||
|
ussToMove = _.map ussDom, (item) ->
|
||||||
|
itemScope = angular.element(item).scope()
|
||||||
|
itemScope.us.milestone = $scope.sprints[0].id
|
||||||
|
return itemScope.us
|
||||||
|
|
||||||
|
$scope.$apply(_.partial(moveToCurrentSprint, ussToMove))
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
## Filters Link
|
## Filters Link
|
||||||
#########################
|
#########################
|
||||||
|
@ -226,6 +259,7 @@ BacklogDirective = ($repo) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
$ctrl = $el.controller()
|
$ctrl = $el.controller()
|
||||||
linkSortable($scope, $el, $attrs, $ctrl)
|
linkSortable($scope, $el, $attrs, $ctrl)
|
||||||
|
linkMoveToCurrentSprint($scope, $el, $attrs, $ctrl)
|
||||||
linkFilters($scope, $el, $attrs, $ctrl)
|
linkFilters($scope, $el, $attrs, $ctrl)
|
||||||
|
|
||||||
$scope.$on "$destroy", ->
|
$scope.$on "$destroy", ->
|
||||||
|
|
|
@ -12,7 +12,7 @@ block content
|
||||||
include views/components/summary
|
include views/components/summary
|
||||||
include views/modules/burndown
|
include views/modules/burndown
|
||||||
div.backlog-menu
|
div.backlog-menu
|
||||||
a.trans-button(href="", title="Move to Current Sprint")
|
a.trans-button.move-to-current-sprint(href="", title="Move to Current Sprint", id="move-to-current-sprint")
|
||||||
span.icon.icon-move
|
span.icon.icon-move
|
||||||
span.text Move to current Sprint
|
span.text Move to current Sprint
|
||||||
a.trans-button(href="", title="Show Filters", id="show-filters-button")
|
a.trans-button(href="", title="Show Filters", id="show-filters-button")
|
||||||
|
|
|
@ -14,5 +14,8 @@
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
|
&.move-to-current-sprint {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue