From 4f7367c5c249cc084ec0ea0dfe6217af9a9fbd13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 20 May 2015 12:40:53 +0200 Subject: [PATCH] tg-2698 #ready-for-test - Fix probles with status between the options WIP limit and is_archived --- app/coffee/modules/kanban/main.coffee | 17 ++++++++++------- .../modules/admin/project-us-status.jade | 17 ++++++++++------- app/partials/includes/modules/kanban-table.jade | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/app/coffee/modules/kanban/main.coffee b/app/coffee/modules/kanban/main.coffee index 5d9a0b61..6b45ea6b 100644 --- a/app/coffee/modules/kanban/main.coffee +++ b/app/coffee/modules/kanban/main.coffee @@ -470,17 +470,20 @@ KanbanWipLimitDirective = -> link = ($scope, $el, $attrs) -> $el.disableSelection() - redrawWipLimit = -> + status = $scope.$eval($attrs.tgKanbanWipLimit) + + redrawWipLimit = => $el.find(".kanban-wip-limit").remove() - timeout 200, -> - element = $el.find(".kanban-task")[$scope.$eval($attrs.tgKanbanWipLimit)] + timeout 200, => + element = $el.find(".kanban-task")[status.wip_limit] if element angular.element(element).before("
") - $scope.$on "redraw:wip", redrawWipLimit - $scope.$on "kanban:us:move", redrawWipLimit - $scope.$on "usform:new:success", redrawWipLimit - $scope.$on "usform:bulk:success", redrawWipLimit + if status and not status.is_archived + $scope.$on "redraw:wip", redrawWipLimit + $scope.$on "kanban:us:move", redrawWipLimit + $scope.$on "usform:new:success", redrawWipLimit + $scope.$on "usform:bulk:success", redrawWipLimit $scope.$on "$destroy", -> $el.off() diff --git a/app/partials/includes/modules/admin/project-us-status.jade b/app/partials/includes/modules/admin/project-us-status.jade index 7d7273cd..dd1adf63 100644 --- a/app/partials/includes/modules/admin/project-us-status.jade +++ b/app/partials/includes/modules/admin/project-us-status.jade @@ -38,7 +38,7 @@ section.project-us-status div.icon.icon-check-square(ng-show="value.is_archived") div.status-wip-limit - span {{ value.wip_limit }} + span(ng-hide="value.is_archived") {{ value.wip_limit }} div.options-column a.edit-value.icon.icon-edit(href="", title="{{'ADMIN.COMMON.TITLE_ACTION_EDIT_VALUE' | translate}}") @@ -63,8 +63,9 @@ section.project-us-status ng-options="e.id as e.name | translate for e in [{'id':true, 'name':'COMMON.YES'},{'id':false, 'name': 'COMMON.NO'}]") div.status-wip-limit - input(name="wip_limit", type="number", placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}", - ng-model="value.wip_limit", data-type="digits") + input(name="wip_limit", type="number", ng-hide="value.is_archived", + ng-model="value.wip_limit", data-type="digits", + placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}") div.options-column a.save.icon.icon-floppy(href="", title="{{'COMMON.SAVE' | translate}}") @@ -77,8 +78,9 @@ section.project-us-status include ../../components/select-color div.status-name - input(name="name", type="text", placeholder="{{'ADMIN.US_STATUS.PLACEHOLDER_WRITE_NAME' | translate}}", - ng-model="newValue.name", data-required="true", data-maxlength="255") + input(name="name", type="text", + ng-model="newValue.name", data-required="true", data-maxlength="255", + placeholder="{{'ADMIN.US_STATUS.PLACEHOLDER_WRITE_NAME' | translate}}") div.is-closed-column select(name="is_closed", ng-model="newValue.is_closed", data-required="true", @@ -89,8 +91,9 @@ section.project-us-status ng-options="e.id as e.name | translate for e in [{'id':true, 'name':'COMMON.YES'},{'id':false, 'name': 'COMMON.NO'}]") div.status-wip-limit - input(name="wip_limit", type="number", placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}", - ng-model="newValue.wip_limit", data-type="digits") + input(name="wip_limit", type="number", ng-hide="newValue.is_archived", + ng-model="newValue.wip_limit", data-type="digits", + placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}") div.options-column a.add-new.icon.icon-floppy(href="", title="{{'COMMON.ADD' | translate}}") diff --git a/app/partials/includes/modules/kanban-table.jade b/app/partials/includes/modules/kanban-table.jade index 1e29a995..8c624c10 100644 --- a/app/partials/includes/modules/kanban-table.jade +++ b/app/partials/includes/modules/kanban-table.jade @@ -36,7 +36,7 @@ div.kanban-table(tg-kanban-squish-column) div.kanban-uses-box.task-column(ng-class='{vfold:folds[s.id]}', ng-repeat="s in usStatusList track by s.id", tg-kanban-sortable, - tg-kanban-wip-limit="s.wip_limit", + tg-kanban-wip-limit="s", tg-kanban-column-height-fixer, tg-bind-scope)