From e9c49662179ab2d40c06dfdc40d5db6f5d7ef6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Hermida?= Date: Thu, 9 Aug 2018 13:24:26 +0200 Subject: [PATCH] Fix refresh in due-dates and assign issues to sprint --- app/coffee/modules/common/lightboxes.coffee | 5 +++-- app/coffee/modules/issues/detail.coffee | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/coffee/modules/common/lightboxes.coffee b/app/coffee/modules/common/lightboxes.coffee index 3f090525..8f272502 100644 --- a/app/coffee/modules/common/lightboxes.coffee +++ b/app/coffee/modules/common/lightboxes.coffee @@ -670,7 +670,7 @@ module.directive("tgLightboxLeaveProjectWarning", ["lightboxService", LightboxLe ## Set Due Date Lightbox Directive ############################################################################# -SetDueDateDirective = (lightboxService, $loading, $translate, $confirm, $modelTransform) -> +SetDueDateDirective = ($rootscope, lightboxService, $loading, $translate, $confirm, $modelTransform) -> link = ($scope, $el, attrs) -> prettyDate = $translate.instant("COMMON.PICKERDATE.FORMAT") lightboxService.open($el) @@ -717,6 +717,7 @@ SetDueDateDirective = (lightboxService, $loading, $translate, $confirm, $modelTr transform.finally -> currentLoading.finish() lightboxService.close($el) + $rootscope.$broadcast("object:updated") $el.on "click", ".submit-button", (event) -> event.preventDefault() @@ -747,7 +748,7 @@ SetDueDateDirective = (lightboxService, $loading, $translate, $confirm, $modelTr scope: true } -module.directive("tgLbSetDueDate", ["lightboxService", "$tgLoading", "$translate", "$tgConfirm" +module.directive("tgLbSetDueDate", ["$rootScope", "lightboxService", "$tgLoading", "$translate", "$tgConfirm" "$tgQueueModelTransformation", SetDueDateDirective]) diff --git a/app/coffee/modules/issues/detail.coffee b/app/coffee/modules/issues/detail.coffee index 16ad0aec..764bf273 100644 --- a/app/coffee/modules/issues/detail.coffee +++ b/app/coffee/modules/issues/detail.coffee @@ -704,7 +704,7 @@ module.directive("tgPromoteIssueToUsButton", ["$rootScope", "$tgRepo", "$tgConfi ## Add Issue to Sprint button directive ############################################################################# -AssignSprintToIssueButtonDirective = ($rootScope, $rs, $repo, $loading, $translate, +AssignSprintToIssueButtonDirective = ($rootscope, $rs, $repo, $loading, $translate, lightboxService, $modelTransform, $confirm) -> link = ($scope, $el, $attrs, $model) -> avaliableMilestones = [] @@ -743,10 +743,11 @@ lightboxService, $modelTransform, $confirm) -> $confirm.ask(title, null, message).then (askResponse) -> onSuccess = -> - $scope.$broadcast("assign-sprint-to-issue:success", null) + $rootscope.$broadcast("assign-sprint-to-issue:success", null) askResponse.finish() lightboxService.close($el) + onError = -> askResponse.finish(false) $confirm.notify("error") @@ -780,7 +781,7 @@ lightboxService, $modelTransform, $confirm) -> transform.then -> currentLoading.finish() lightboxService.close($el.find(".lightbox-assign-sprint-to-issue")) - $scope.$broadcast("assign-sprint-to-issue:success", selectedSprint.id) + $rootscope.$broadcast("assign-sprint-to-issue:success", selectedSprint.id) return { link: link