Merge pull request #1477 from alexhermida/ft/add_assinged_users_kanban_filter

Add assigned users filter
stable
Miguel Gonzalez 2018-06-27 13:23:34 +02:00 committed by GitHub
commit d9c29f3efe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 42 additions and 9 deletions

View File

@ -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"),

View File

@ -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()

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioritats",
"TAGS": "Etiquetes",
"ASSIGNED_TO": "Assignat a",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rol",
"CREATED_BY": "Creat per",
"CUSTOM_FILTERS": "Filtres personalitzats",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioritäten",
"TAGS": "Schlagwörter",
"ASSIGNED_TO": "Zugeordnet zu",
"ASSIGNED_USERS": "Zugewiesene Benutzer",
"ROLE": "Rolle",
"CREATED_BY": "Erstellt durch",
"CUSTOM_FILTERS": "Benutzerfilter",

View File

@ -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",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioridades",
"TAGS": "Etiquetas",
"ASSIGNED_TO": "Asignado a",
"ASSIGNED_USERS": "Usuarios asignados",
"ROLE": "Rol",
"CREATED_BY": "Creada por",
"CUSTOM_FILTERS": "Filtros personalizados",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "اولویت‌ها",
"TAGS": "برچسب‌ها",
"ASSIGNED_TO": "اختصاص یافته به",
"ASSIGNED_USERS": "کاربران اختصاص یافته",
"ROLE": "قش",
"CREATED_BY": "ایجاد توسط",
"CUSTOM_FILTERS": "فیلترهای سفارشی",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Kiireellisyydet",
"TAGS": "Avainsanat",
"ASSIGNED_TO": "Tekijä",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rooli",
"CREATED_BY": "Luoja",
"CUSTOM_FILTERS": "Omat suodattimet",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Priorités",
"TAGS": "Mots-clés",
"ASSIGNED_TO": "Affecté à",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rôle",
"CREATED_BY": "Créé par",
"CUSTOM_FILTERS": "Filtres personnalisés",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Priorità",
"TAGS": "Tag",
"ASSIGNED_TO": "Assegnato a",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Ruolo",
"CREATED_BY": "Creato da",
"CUSTOM_FILTERS": "Filtri personalizzati",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "優先度",
"TAGS": "タグ",
"ASSIGNED_TO": "割当",
"ASSIGNED_USERS": "割当ユーザー",
"ROLE": "役割",
"CREATED_BY": "作成者",
"CUSTOM_FILTERS": "カスタムフィルター",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "우선순위",
"TAGS": "태그",
"ASSIGNED_TO": "할당됨",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "역할",
"CREATED_BY": "생성함",
"CUSTOM_FILTERS": "사용자 정의 필터",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioriteter",
"TAGS": "Etiketter",
"ASSIGNED_TO": "Tildelt til",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rolle",
"CREATED_BY": "Laget av",
"CUSTOM_FILTERS": "Egendefinert filtre",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioriteit",
"TAGS": "Tags",
"ASSIGNED_TO": "Toegewezen aan",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rol",
"CREATED_BY": "Aangemaakt door",
"CUSTOM_FILTERS": "Eigen filters",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Priorytety",
"TAGS": "Tagi",
"ASSIGNED_TO": "Przypisane do",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rola",
"CREATED_BY": "Stworzona przez",
"CUSTOM_FILTERS": "Filtry niestandardowe",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioridades",
"TAGS": "Tags",
"ASSIGNED_TO": "Atribuído a",
"ASSIGNED_USERS": "Usuários atribuídos",
"ROLE": "Função",
"CREATED_BY": "Criado por",
"CUSTOM_FILTERS": "Filtros personalizados",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Приоритеты",
"TAGS": "Тэги",
"ASSIGNED_TO": "Назначено",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Роль",
"CREATED_BY": "Создано",
"CUSTOM_FILTERS": "Собственные фильтры",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Prioritet",
"TAGS": "Etiketter",
"ASSIGNED_TO": "Tilldelad till",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Roll",
"CREATED_BY": "Skapad av",
"CUSTOM_FILTERS": "Anpassad filter",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "Öncelikler",
"TAGS": "Etiketler ",
"ASSIGNED_TO": "Atanmış",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "Rol",
"CREATED_BY": "Oluşturan",
"CUSTOM_FILTERS": "Özel filtreler",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "优先级",
"TAGS": "标签",
"ASSIGNED_TO": "指派给",
"ASSIGNED_USERS": "被指派人列表",
"ROLE": "角色",
"CREATED_BY": "由创建",
"CUSTOM_FILTERS": "定制过滤器",

View File

@ -222,6 +222,7 @@
"PRIORITIES": "優先性",
"TAGS": "標籤",
"ASSIGNED_TO": "指派給 ",
"ASSIGNED_USERS": "Assigned users",
"ROLE": "角色",
"CREATED_BY": "由創建",
"CUSTOM_FILTERS": "客製過濾器 ",