Now assigned to change is persisted on kanban.
parent
649e610f90
commit
9f37ce70ec
|
@ -54,16 +54,39 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
promise.then null, =>
|
promise.then null, =>
|
||||||
console.log "FAIL"
|
console.log "FAIL"
|
||||||
|
|
||||||
# @scope.$on("usform:bulk:success", @.loadUserstories)
|
|
||||||
# @scope.$on("sprintform:create:success", @.loadSprints)
|
|
||||||
# @scope.$on("sprintform:create:success", @.loadProjectStats)
|
|
||||||
# @scope.$on("sprintform:remove:success", @.loadSprints)
|
|
||||||
# @scope.$on("sprintform:remove:success", @.loadProjectStats)
|
|
||||||
@scope.$on("usform:new:success", @.onNewUserstory)
|
@scope.$on("usform:new:success", @.onNewUserstory)
|
||||||
@scope.$on("usform:edit:success", @.onUserstoryEdited)
|
@scope.$on("usform:edit:success", @.onUserstoryEdited)
|
||||||
|
@scope.$on("assigned-to:added", @.onAssignedToChanged)
|
||||||
@scope.$on("kanban:us:move", @.moveUs)
|
@scope.$on("kanban:us:move", @.moveUs)
|
||||||
# @scope.$on("sprint:us:moved", @.loadSprints)
|
|
||||||
# @scope.$on("sprint:us:moved", @.loadProjectStats)
|
# Template actions
|
||||||
|
|
||||||
|
editUserStory: (us) ->
|
||||||
|
@rootscope.$broadcast("usform:edit", us)
|
||||||
|
|
||||||
|
addNewUs: (type, statusId) ->
|
||||||
|
switch type
|
||||||
|
when "standard" then @rootscope.$broadcast("usform:new", statusId)
|
||||||
|
when "bulk" then @rootscope.$broadcast("usform:bulk", statusId)
|
||||||
|
|
||||||
|
changeUsAssignedTo: (us) ->
|
||||||
|
@rootscope.$broadcast("assigned-to:add", us)
|
||||||
|
|
||||||
|
# Scope Events Handlers
|
||||||
|
|
||||||
|
onNewUserstory: (ctx, us) ->
|
||||||
|
@scope.usByStatus[us.status].splice(0, 0, us)
|
||||||
|
|
||||||
|
onAssignedToChanged: (ctx, userid, us) ->
|
||||||
|
us.assigned_to = userid
|
||||||
|
promise = @repo.save(us)
|
||||||
|
promise.then null, ->
|
||||||
|
console.log "FAIL" # TODO
|
||||||
|
|
||||||
|
onUserstoryEdited: (ctx, us) ->
|
||||||
|
@.loadUserstories()
|
||||||
|
|
||||||
|
# Load data methods
|
||||||
|
|
||||||
loadProjectStats: ->
|
loadProjectStats: ->
|
||||||
return @rs.projects.stats(@scope.projectId).then (stats) =>
|
return @rs.projects.stats(@scope.projectId).then (stats) =>
|
||||||
|
@ -156,25 +179,6 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
|
|
||||||
return promise
|
return promise
|
||||||
|
|
||||||
## Template actions
|
|
||||||
editUserStory: (us) ->
|
|
||||||
@rootscope.$broadcast("usform:edit", us)
|
|
||||||
|
|
||||||
addNewUs: (type, statusId) ->
|
|
||||||
switch type
|
|
||||||
when "standard" then @rootscope.$broadcast("usform:new", statusId)
|
|
||||||
when "bulk" then @rootscope.$broadcast("usform:bulk", statusId)
|
|
||||||
|
|
||||||
changeUsAssignedTo: (us) ->
|
|
||||||
@rootscope.$broadcast("assigned-to:add", us)
|
|
||||||
|
|
||||||
# Scope Events Handlers
|
|
||||||
onNewUserstory: (ctx, us) ->
|
|
||||||
@scope.usByStatus[us.status].splice(0, 0, us)
|
|
||||||
|
|
||||||
onUserstoryEdited: (ctx, us) ->
|
|
||||||
@.loadUserstories()
|
|
||||||
|
|
||||||
|
|
||||||
module.controller("KanbanController", KanbanController)
|
module.controller("KanbanController", KanbanController)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue