tg-2698 #ready-for-test - Fix probles with status between the options WIP limit and is_archived

stable
David Barragán Merino 2015-05-20 12:40:53 +02:00
parent 6083798188
commit 4f7367c5c2
3 changed files with 21 additions and 15 deletions

View File

@ -470,17 +470,20 @@ KanbanWipLimitDirective = ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$el.disableSelection() $el.disableSelection()
redrawWipLimit = -> status = $scope.$eval($attrs.tgKanbanWipLimit)
redrawWipLimit = =>
$el.find(".kanban-wip-limit").remove() $el.find(".kanban-wip-limit").remove()
timeout 200, -> timeout 200, =>
element = $el.find(".kanban-task")[$scope.$eval($attrs.tgKanbanWipLimit)] element = $el.find(".kanban-task")[status.wip_limit]
if element if element
angular.element(element).before("<div class='kanban-wip-limit'></div>") angular.element(element).before("<div class='kanban-wip-limit'></div>")
$scope.$on "redraw:wip", redrawWipLimit if status and not status.is_archived
$scope.$on "kanban:us:move", redrawWipLimit $scope.$on "redraw:wip", redrawWipLimit
$scope.$on "usform:new:success", redrawWipLimit $scope.$on "kanban:us:move", redrawWipLimit
$scope.$on "usform:bulk:success", redrawWipLimit $scope.$on "usform:new:success", redrawWipLimit
$scope.$on "usform:bulk:success", redrawWipLimit
$scope.$on "$destroy", -> $scope.$on "$destroy", ->
$el.off() $el.off()

View File

@ -38,7 +38,7 @@ section.project-us-status
div.icon.icon-check-square(ng-show="value.is_archived") div.icon.icon-check-square(ng-show="value.is_archived")
div.status-wip-limit div.status-wip-limit
span {{ value.wip_limit }} span(ng-hide="value.is_archived") {{ value.wip_limit }}
div.options-column div.options-column
a.edit-value.icon.icon-edit(href="", title="{{'ADMIN.COMMON.TITLE_ACTION_EDIT_VALUE' | translate}}") 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'}]") 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 div.status-wip-limit
input(name="wip_limit", type="number", placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}", input(name="wip_limit", type="number", ng-hide="value.is_archived",
ng-model="value.wip_limit", data-type="digits") ng-model="value.wip_limit", data-type="digits",
placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}")
div.options-column div.options-column
a.save.icon.icon-floppy(href="", title="{{'COMMON.SAVE' | translate}}") a.save.icon.icon-floppy(href="", title="{{'COMMON.SAVE' | translate}}")
@ -77,8 +78,9 @@ section.project-us-status
include ../../components/select-color include ../../components/select-color
div.status-name div.status-name
input(name="name", type="text", placeholder="{{'ADMIN.US_STATUS.PLACEHOLDER_WRITE_NAME' | translate}}", input(name="name", type="text",
ng-model="newValue.name", data-required="true", data-maxlength="255") ng-model="newValue.name", data-required="true", data-maxlength="255",
placeholder="{{'ADMIN.US_STATUS.PLACEHOLDER_WRITE_NAME' | translate}}")
div.is-closed-column div.is-closed-column
select(name="is_closed", ng-model="newValue.is_closed", data-required="true", 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'}]") 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 div.status-wip-limit
input(name="wip_limit", type="number", placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}", input(name="wip_limit", type="number", ng-hide="newValue.is_archived",
ng-model="newValue.wip_limit", data-type="digits") ng-model="newValue.wip_limit", data-type="digits",
placeholder="{{'ADMIN.US_STATUS.WIP_LIMIT_COLUMN' | translate}}")
div.options-column div.options-column
a.add-new.icon.icon-floppy(href="", title="{{'COMMON.ADD' | translate}}") a.add-new.icon.icon-floppy(href="", title="{{'COMMON.ADD' | translate}}")

View File

@ -36,7 +36,7 @@ div.kanban-table(tg-kanban-squish-column)
div.kanban-uses-box.task-column(ng-class='{vfold:folds[s.id]}', div.kanban-uses-box.task-column(ng-class='{vfold:folds[s.id]}',
ng-repeat="s in usStatusList track by s.id", ng-repeat="s in usStatusList track by s.id",
tg-kanban-sortable, tg-kanban-sortable,
tg-kanban-wip-limit="s.wip_limit", tg-kanban-wip-limit="s",
tg-kanban-column-height-fixer, tg-kanban-column-height-fixer,
tg-bind-scope) tg-bind-scope)