From 547b1016d4a691575f1367ab0e508354a2cbc856 Mon Sep 17 00:00:00 2001 From: Miguel Gonzalez Date: Tue, 31 Jul 2018 22:49:19 +0200 Subject: [PATCH] feat: Move US to the end when status archived and hidden --- app/coffee/modules/kanban/kanban-usertories.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/kanban/kanban-usertories.coffee b/app/coffee/modules/kanban/kanban-usertories.coffee index 5f89f29a..ea4cfc14 100644 --- a/app/coffee/modules/kanban/kanban-usertories.coffee +++ b/app/coffee/modules/kanban/kanban-usertories.coffee @@ -94,6 +94,7 @@ class KanbanUserstoriesService extends taiga.Service @.refresh() move: (usList, statusId, index) -> + initialLength = usList.length usByStatus = _.filter @.userstoriesRaw, (it) => @@ -123,7 +124,13 @@ class KanbanUserstoriesService extends taiga.Service setPreviousOrders = [] setNextOrders = [] - if !previous + isArchivedHiddenStatus = @.archivedStatus.indexOf(statusId) != -1 && + @.statusHide.indexOf(statusId) != -1 + + if isArchivedHiddenStatus + startIndex = new Date().getTime() + + else if !previous startIndex = 0 else if previous startIndex = @.order[previous.id] + 1