Regression fix: conserve order on kanbnan using new kanban_order field
Completelly independently of backlog.stable
parent
51159a1058
commit
f5ed7e9499
|
@ -219,12 +219,12 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
@scope.usByStatus[statusId].splice(index, 0, us)
|
@scope.usByStatus[statusId].splice(index, 0, us)
|
||||||
|
|
||||||
us.status = statusId
|
us.status = statusId
|
||||||
else if not @scope.project.is_backlog_activated
|
else
|
||||||
current_position = @scope.usByStatus[us.status].indexOf(us)
|
r = @scope.usByStatus[statusId].indexOf(us)
|
||||||
new_position = index
|
@scope.usByStatus[statusId].splice(r, 1)
|
||||||
|
@scope.usByStatus[statusId].splice(index, 0, us)
|
||||||
|
|
||||||
@scope.usByStatus[us.status].splice(current_position, 1)
|
itemsToSave = @.resortUserStories(@scope.usByStatus[statusId])
|
||||||
@scope.usByStatus[us.status].splice(new_position, 0, us)
|
|
||||||
|
|
||||||
# Persist the userstory
|
# Persist the userstory
|
||||||
promise = @repo.save(us)
|
promise = @repo.save(us)
|
||||||
|
@ -232,16 +232,10 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
# Rehash userstories order field
|
# Rehash userstories order field
|
||||||
# and persist in bulk all changes.
|
# and persist in bulk all changes.
|
||||||
promise = promise.then =>
|
promise = promise.then =>
|
||||||
items = @.resortUserStories(@scope.usByStatus[statusId])
|
data = @.prepareBulkUpdateData(itemsToSave)
|
||||||
data = @.prepareBulkUpdateData(items)
|
|
||||||
|
|
||||||
return @rs.userstories.bulkUpdateKanbanOrder(us.project, data).then =>
|
return @rs.userstories.bulkUpdateKanbanOrder(us.project, data).then =>
|
||||||
# @rootscope.$broadcast("sprint:us:moved", us, oldSprintId, newSprintId)
|
return itemsToSave
|
||||||
return items
|
|
||||||
|
|
||||||
promise.then null, ->
|
|
||||||
# TODO
|
|
||||||
console.log "FAIL"
|
|
||||||
|
|
||||||
return promise
|
return promise
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,6 @@ div.kanban-table
|
||||||
tg-kanban-sortable,
|
tg-kanban-sortable,
|
||||||
tg-kanban-wip-limit,
|
tg-kanban-wip-limit,
|
||||||
tg-kanban-column-height-fixer)
|
tg-kanban-column-height-fixer)
|
||||||
div.kanban-task(ng-repeat="us in usByStatus[status.id] track by us.id",
|
div.kanban-task(ng-repeat="us in usByStatus[status.id]|orderBy:'kanban_order' track by us.id",
|
||||||
tg-kanban-userstory, ng-model="us",
|
tg-kanban-userstory, ng-model="us",
|
||||||
ng-class="ctrl.getCardClass(status.id)")
|
ng-class="ctrl.getCardClass(status.id)")
|
||||||
|
|
Loading…
Reference in New Issue