From dc423af0e93a875cadb94fce6ac6cdb6641f7a55 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 29 Sep 2016 13:12:11 +0200 Subject: [PATCH] Issue: #4575, #4576, #4578 Missing tag colors --- app/coffee/modules/common/tags.coffee | 6 +++--- app/coffee/modules/kanban/kanban-usertories.coffee | 3 +-- app/coffee/modules/taskboard/taskboard-tasks.coffee | 5 ++--- app/modules/components/card/card-templates/card-tags.jade | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/coffee/modules/common/tags.coffee b/app/coffee/modules/common/tags.coffee index faa3ec3a..cb38eee9 100644 --- a/app/coffee/modules/common/tags.coffee +++ b/app/coffee/modules/common/tags.coffee @@ -63,7 +63,7 @@ ColorizeTagsDirective = -> backlog: _.template(""" <% _.each(tags, function(tag) { %> + <% if (tag[1] !== null) { %> style="border-left: 5px solid <%- tag[1] %>" <% } %> title="<%- tag[0] %>"><%- tag[0] %> @@ -73,7 +73,7 @@ ColorizeTagsDirective = -> <% _.each(tags, function(tag) { %> + <% if (tag[1] !== null) { %> style="border-color: <%- tag[1] %>" <% } %> title="<%- tag[0] %>" /> @@ -83,7 +83,7 @@ ColorizeTagsDirective = -> <% _.each(tags, function(tag) { %> + <% if (tag[1] !== null) { %> style="border-color: <%- tag[1] %>" <% } %> title="<%- tag[0] %>" /> diff --git a/app/coffee/modules/kanban/kanban-usertories.coffee b/app/coffee/modules/kanban/kanban-usertories.coffee index 0e811b13..dc1faf82 100644 --- a/app/coffee/modules/kanban/kanban-usertories.coffee +++ b/app/coffee/modules/kanban/kanban-usertories.coffee @@ -176,8 +176,7 @@ class KanbanUserstoriesService extends taiga.Service us.id = usModel.id us.assigned_to = @.usersById[usModel.assigned_to] us.colorized_tags = _.map us.model.tags, (tag) => - color = @.project.tags_colors[tag] - return {name: tag, color: color} + return {name: tag[0], color: tag[1]} return us diff --git a/app/coffee/modules/taskboard/taskboard-tasks.coffee b/app/coffee/modules/taskboard/taskboard-tasks.coffee index cc8f087d..013238fb 100644 --- a/app/coffee/modules/taskboard/taskboard-tasks.coffee +++ b/app/coffee/modules/taskboard/taskboard-tasks.coffee @@ -162,9 +162,8 @@ class TaskboardTasksService extends taiga.Service task.images = _.filter taskModel.attachments, (it) -> return !!it.thumbnail_card_url task.id = taskModel.id task.assigned_to = @.usersById[taskModel.assigned_to] - task.colorized_tags = _.map task.model.tags, (tag) => - color = @.project.tags_colors[tag] - return {name: tag, color: color} + task.colorized_tags = _.map task.model.tags, (tag) => + return {name: tag[0], color: tag[1]} usTasks[taskModel.user_story][taskModel.status].push(task) diff --git a/app/modules/components/card/card-templates/card-tags.jade b/app/modules/components/card/card-templates/card-tags.jade index a5161331..cb18254d 100644 --- a/app/modules/components/card/card-templates/card-tags.jade +++ b/app/modules/components/card/card-templates/card-tags.jade @@ -1,7 +1,7 @@ -.card-tags(ng-if="vm.visible('tags')") +.card-tags(ng-if="vm.visible('tags')") span.card-tag( tg-repeat="tag in vm.item.get('colorized_tags') track by tag.get('name')" - style="background-color: {{tag.get('color')}}" + style="background-color: {{tag.get('color')}}" title="{{tag.get('name')}}" ng-if="tag.get('color')" )