From abb2374960201fb664caa417a7f55acfdb7ddb87 Mon Sep 17 00:00:00 2001 From: Miguel Gonzalez Date: Thu, 28 Jun 2018 08:55:20 +0200 Subject: [PATCH] Revert "Add assigned users filter" This reverts commit 867ddb5fd0172dda31fb2db6b38cd672b1422247. --- app/coffee/modules/controllerMixins.coffee | 20 +++---------------- .../modules/kanban/kanban-usertories.coffee | 12 +++++------ app/locales/taiga/locale-en.json | 1 - 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/app/coffee/modules/controllerMixins.coffee b/app/coffee/modules/controllerMixins.coffee index 4c8df028..a21d0d2b 100644 --- a/app/coffee/modules/controllerMixins.coffee +++ b/app/coffee/modules/controllerMixins.coffee @@ -223,7 +223,6 @@ class UsFiltersMixin loadFilters.project = @scope.projectId loadFilters.tags = urlfilters.tags loadFilters.status = urlfilters.status - loadFilters.assigned_users = urlfilters.assigned_users loadFilters.assigned_to = urlfilters.assigned_to loadFilters.owner = urlfilters.owner loadFilters.epic = urlfilters.epic @@ -250,15 +249,6 @@ class UsFiltersMixin return it tagsWithAtLeastOneElement = _.filter tags, (tag) -> return tag.count > 0 - assignedUsers = _.map data.assigned_users, (it) -> - if it.id - it.id = it.id.toString() - else - it.id = "null" - - it.name = it.full_name || "Unassigned" - - return it assignedTo = _.map data.assigned_to, (it) -> if it.id it.id = it.id.toString() @@ -302,10 +292,6 @@ class UsFiltersMixin selected = @.formatSelectedFilters("tags", tags, loadFilters.tags) @.selectedFilters = @.selectedFilters.concat(selected) - if loadFilters.assigned_users - selected = @.formatSelectedFilters("assigned_users", assignedUsers, loadFilters.assigned_users) - @.selectedFilters = @.selectedFilters.concat(selected) - if loadFilters.assigned_to selected = @.formatSelectedFilters("assigned_to", assignedTo, loadFilters.assigned_to) @.selectedFilters = @.selectedFilters.concat(selected) @@ -338,9 +324,9 @@ class UsFiltersMixin totalTaggedElements: tagsWithAtLeastOneElement.length }, { - title: @translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_USERS"), - dataType: "assigned_users", - content: assignedUsers + title: @translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"), + dataType: "assigned_to", + content: assignedTo }, { title: @translate.instant("COMMON.FILTERS.CATEGORIES.ROLE"), diff --git a/app/coffee/modules/kanban/kanban-usertories.coffee b/app/coffee/modules/kanban/kanban-usertories.coffee index 5f89f29a..477bc92b 100644 --- a/app/coffee/modules/kanban/kanban-usertories.coffee +++ b/app/coffee/modules/kanban/kanban-usertories.coffee @@ -95,7 +95,7 @@ class KanbanUserstoriesService extends taiga.Service move: (usList, statusId, index) -> initialLength = usList.length - + usByStatus = _.filter @.userstoriesRaw, (it) => return it.status == statusId @@ -130,19 +130,19 @@ class KanbanUserstoriesService extends taiga.Service previousWithTheSameOrder = _.filter(beforeDestination, (it) => it.kanban_order == @.order[previous.id] - ) + ) for it, key in afterDestination # increase position of the us after the dragged us's @.order[it.id] = @.order[previous.id] + key + initialLength + 1 - it.kanban_order = @.order[it.id] + it.kanban_order = @.order[it.id] setNextOrders = _.map(afterDestination, (it) => {us_id: it.id, order: @.order[it.id]} - ) + ) # we must send the USs previous to the dropped USs to tell the backend # which USs are before the dropped USs, if they have the same value to # order, the backend doens't know after which one do you want to drop - # the USs + # the USs if previousWithTheSameOrder.length > 1 setPreviousOrders = _.map(previousWithTheSameOrder, (it) => {us_id: it.id, order: @.order[it.id]} @@ -153,7 +153,7 @@ class KanbanUserstoriesService extends taiga.Service us.kanban_order = startIndex + key @.order[us.id] = us.kanban_order - modifiedUs.push({us_id: us.id, order: us.kanban_order}) + modifiedUs.push({us_id: us.id, order: us.kanban_order}) @.refresh() diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 82c97e4a..6af3550e 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -221,7 +221,6 @@ "PRIORITIES": "Priorities", "TAGS": "Tags", "ASSIGNED_TO": "Assigned to", - "ASSIGNED_USERS": "Assigned users", "ROLE": "Role", "CREATED_BY": "Created by", "CUSTOM_FILTERS": "Custom filters",