From a8da4d66a81ee14b8669a04a3624fb6f0fa7daf2 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 3 Feb 2016 09:16:55 +0100 Subject: [PATCH] remove previous validation lightbox errors --- app/coffee/modules/backlog/lightboxes.coffee | 3 +++ app/coffee/modules/common/lightboxes.coffee | 8 ++++++++ app/coffee/modules/issues/lightboxes.coffee | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/app/coffee/modules/backlog/lightboxes.coffee b/app/coffee/modules/backlog/lightboxes.coffee index 72cd04e5..99c1ebd0 100644 --- a/app/coffee/modules/backlog/lightboxes.coffee +++ b/app/coffee/modules/backlog/lightboxes.coffee @@ -36,8 +36,11 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading, link = ($scope, $el, attrs) -> hasErrors = false createSprint = true + form = null resetSprint = () -> + form.reset() if form + $scope.sprint = { project: null name: null diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index 57f688b7..82f640b0 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -268,6 +268,7 @@ module.directive("tgBlockingMessageInput", ["$log", "$tgTemplate", "$compile", B CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, $loading, $translate, $confirm, $q, attachmentsService) -> link = ($scope, $el, attrs) -> + form = null $scope.createEditUs = {} $scope.isNew = true @@ -285,6 +286,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, attachmentsToDelete = attachmentsToDelete.push(attachment) $scope.$on "usform:new", (ctx, projectId, status, statusList) -> + form.reset() if form $scope.isNew = true $scope.usStatusList = statusList $scope.attachments = Immutable.List() @@ -312,6 +314,8 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, lightboxService.open($el) $scope.$on "usform:edit", (ctx, us, attachments) -> + form.reset() if form + $scope.us = us $scope.attachments = Immutable.fromJS(attachments) $scope.isNew = false @@ -431,7 +435,11 @@ module.directive("tgLbCreateEditUserstory", [ CreateBulkUserstoriesDirective = ($repo, $rs, $rootscope, lightboxService, $loading) -> link = ($scope, $el, attrs) -> + form = null + $scope.$on "usform:bulk", (ctx, projectId, status) -> + form.reset() if form + $scope.new = { projectId: projectId statusId: status diff --git a/app/coffee/modules/issues/lightboxes.coffee b/app/coffee/modules/issues/lightboxes.coffee index de23b12e..298ca7f6 100644 --- a/app/coffee/modules/issues/lightboxes.coffee +++ b/app/coffee/modules/issues/lightboxes.coffee @@ -39,6 +39,8 @@ CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService, $loading, $scope.attachments = Immutable.List() $scope.$on "issueform:new", (ctx, project)-> + form.reset() + attachmentsToAdd = Immutable.List() $el.find(".tag-input").val("") @@ -116,7 +118,11 @@ module.directive("tgLbCreateIssue", ["$tgRepo", "$tgConfirm", "$rootScope", "lig CreateBulkIssuesDirective = ($repo, $rs, $confirm, $rootscope, $loading, lightboxService) -> link = ($scope, $el, attrs) -> + form = null + $scope.$on "issueform:bulk", (ctx, projectId, status)-> + form.reset() if form + lightboxService.open($el) $scope.new = { projectId: projectId