fix: Set after destination new orders
parent
81e1811560
commit
fa1fbda759
|
@ -477,6 +477,10 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
for it, key in afterDestination # increase position of the us after the dragged us's
|
for it, key in afterDestination # increase position of the us after the dragged us's
|
||||||
orderList[it.id] = startIndex + key + 1
|
orderList[it.id] = startIndex + key + 1
|
||||||
|
|
||||||
|
setNextOrders = _.map(afterDestination, (it) =>
|
||||||
|
{us_id: it.id, order: orderList[it.id]}
|
||||||
|
)
|
||||||
|
|
||||||
# refresh order
|
# refresh order
|
||||||
@scope.userstories = _.sortBy @scope.userstories, (it) => @.backlogOrder[it.id]
|
@scope.userstories = _.sortBy @scope.userstories, (it) => @.backlogOrder[it.id]
|
||||||
@scope.visibleUserStories = _.map @scope.userstories, (it) -> return it.ref
|
@scope.visibleUserStories = _.map @scope.userstories, (it) -> return it.ref
|
||||||
|
@ -489,15 +493,17 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
|
|
||||||
# saving
|
# saving
|
||||||
if usList.length > 1 && (newSprintId != oldSprintId) # drag multiple to sprint
|
if usList.length > 1 && (newSprintId != oldSprintId) # drag multiple to sprint
|
||||||
data = modifiedUs.concat(setPreviousOrders)
|
data = modifiedUs.concat(setPreviousOrders, setNextOrders)
|
||||||
promise = @rs.userstories.bulkUpdateMilestone(project, newSprintId, data)
|
promise = @rs.userstories.bulkUpdateMilestone(project, newSprintId, data)
|
||||||
else if usList.length > 1 # drag multiple in backlog
|
else if usList.length > 1 # drag multiple in backlog
|
||||||
data = modifiedUs.concat(setPreviousOrders)
|
data = modifiedUs.concat(setPreviousOrders, setNextOrders)
|
||||||
promise = @rs.userstories.bulkUpdateBacklogOrder(project, data)
|
promise = @rs.userstories.bulkUpdateBacklogOrder(project, data)
|
||||||
else # drag single
|
else # drag single
|
||||||
setOrders = {}
|
setOrders = {}
|
||||||
for it in setPreviousOrders
|
for it in setPreviousOrders
|
||||||
setOrders[it.us_id] = it.order
|
setOrders[it.us_id] = it.order
|
||||||
|
for it in setNextOrders
|
||||||
|
setOrders[it.us_id] = it.order
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
Loading…
Reference in New Issue