diff --git a/app/coffee/modules/controllerMixins.coffee b/app/coffee/modules/controllerMixins.coffee index a21d0d2b..4c8df028 100644 --- a/app/coffee/modules/controllerMixins.coffee +++ b/app/coffee/modules/controllerMixins.coffee @@ -223,6 +223,7 @@ 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 @@ -249,6 +250,15 @@ 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() @@ -292,6 +302,10 @@ 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) @@ -324,9 +338,9 @@ class UsFiltersMixin totalTaggedElements: tagsWithAtLeastOneElement.length }, { - title: @translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"), - dataType: "assigned_to", - content: assignedTo + title: @translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_USERS"), + dataType: "assigned_users", + content: assignedUsers }, { 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 477bc92b..5f89f29a 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 6af3550e..82c97e4a 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -221,6 +221,7 @@ "PRIORITIES": "Priorities", "TAGS": "Tags", "ASSIGNED_TO": "Assigned to", + "ASSIGNED_USERS": "Assigned users", "ROLE": "Role", "CREATED_BY": "Created by", "CUSTOM_FILTERS": "Custom filters",