Fix cases when action failed during confirm lightbox
parent
0a2c673bb1
commit
72a54e43af
|
@ -437,6 +437,7 @@ MembershipsRowActionsDirective = ($log, $repo, $rs, $confirm) ->
|
||||||
$confirm.notify("success", null, "We've deleted #{subtitle}.") # TODO: i18n
|
$confirm.notify("success", null, "We've deleted #{subtitle}.") # TODO: i18n
|
||||||
|
|
||||||
onError = ->
|
onError = ->
|
||||||
|
finish(false)
|
||||||
# TODO: i18in
|
# TODO: i18in
|
||||||
$confirm.notify("error", null, "We have not been able to delete #{subtitle}.")
|
$confirm.notify("error", null, "We have not been able to delete #{subtitle}.")
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading)
|
||||||
$rootscope.$broadcast("sprintform:remove:success")
|
$rootscope.$broadcast("sprintform:remove:success")
|
||||||
|
|
||||||
onError = ->
|
onError = ->
|
||||||
|
finish(false)
|
||||||
$confirm.notify("error")
|
$confirm.notify("error")
|
||||||
$repo.remove($scope.sprint).then(onSuccess, onError)
|
$repo.remove($scope.sprint).then(onSuccess, onError)
|
||||||
|
|
||||||
|
|
|
@ -422,6 +422,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
||||||
finish()
|
finish()
|
||||||
@.loadBacklog()
|
@.loadBacklog()
|
||||||
promise.then null, =>
|
promise.then null, =>
|
||||||
|
finish(false)
|
||||||
@confirm.notify("error")
|
@confirm.notify("error")
|
||||||
|
|
||||||
addNewUs: (type) ->
|
addNewUs: (type) ->
|
||||||
|
|
|
@ -138,6 +138,7 @@ class AttachmentsController extends taiga.Controller
|
||||||
@rootscope.$broadcast("attachment:delete")
|
@rootscope.$broadcast("attachment:delete")
|
||||||
|
|
||||||
onError = =>
|
onError = =>
|
||||||
|
finish(false)
|
||||||
@confirm.notify("error", null, "We have not been able to delete #{subtitle}.")
|
@confirm.notify("error", null, "We have not been able to delete #{subtitle}.")
|
||||||
return @q.reject()
|
return @q.reject()
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,10 @@ class ConfirmService extends taiga.Service
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
@loading.start(target)
|
@loading.start(target)
|
||||||
defered.resolve =>
|
defered.resolve (ok=true) =>
|
||||||
@loading.finish(target)
|
@loading.finish(target)
|
||||||
@.hide(el)
|
if ok
|
||||||
|
@.hide(el)
|
||||||
|
|
||||||
el.on "click.confirm-dialog", "a.button-red", (event) =>
|
el.on "click.confirm-dialog", "a.button-red", (event) =>
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
|
@ -135,6 +135,7 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
finish()
|
finish()
|
||||||
@location.path(@navUrls.resolve("project-issues", {project: @scope.project.slug}))
|
@location.path(@navUrls.resolve("project-issues", {project: @scope.project.slug}))
|
||||||
promise.then null, =>
|
promise.then null, =>
|
||||||
|
finish(false)
|
||||||
@confirm.notify("error")
|
@confirm.notify("error")
|
||||||
|
|
||||||
module.controller("IssueDetailController", IssueDetailController)
|
module.controller("IssueDetailController", IssueDetailController)
|
||||||
|
|
|
@ -626,13 +626,15 @@ IssuesFiltersDirective = ($log, $location, $rs, $confirm) ->
|
||||||
$confirm.ask(title, subtitle).then (finish) ->
|
$confirm.ask(title, subtitle).then (finish) ->
|
||||||
promise = $ctrl.deleteMyFilter(customFilterName)
|
promise = $ctrl.deleteMyFilter(customFilterName)
|
||||||
promise.then ->
|
promise.then ->
|
||||||
$ctrl.loadMyFilters().then (filters) ->
|
promise = $ctrl.loadMyFilters()
|
||||||
|
promise.then (filters) ->
|
||||||
finish()
|
finish()
|
||||||
$scope.filters.myFilters = filters
|
$scope.filters.myFilters = filters
|
||||||
renderFilters($scope.filters.myFilters)
|
renderFilters($scope.filters.myFilters)
|
||||||
$ctrl.loadMyFilters().then null, ->
|
promise.then null, ->
|
||||||
finish()
|
finish()
|
||||||
promise.then null, ->
|
promise.then null, ->
|
||||||
|
finish(false)
|
||||||
$confirm.notify("error")
|
$confirm.notify("error")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,7 @@ class TaskDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
finish()
|
finish()
|
||||||
@location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug}))
|
@location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug}))
|
||||||
promise.then null, =>
|
promise.then null, =>
|
||||||
|
finish(false)
|
||||||
@confirm.notify("error")
|
@confirm.notify("error")
|
||||||
|
|
||||||
module.controller("TaskDetailController", TaskDetailController)
|
module.controller("TaskDetailController", TaskDetailController)
|
||||||
|
|
|
@ -145,6 +145,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
finish()
|
finish()
|
||||||
@location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug}))
|
@location.path(@navUrls.resolve("project-backlog", {project: @scope.project.slug}))
|
||||||
promise.then null, =>
|
promise.then null, =>
|
||||||
|
finish(false)
|
||||||
$confirm.notify("error")
|
$confirm.notify("error")
|
||||||
|
|
||||||
module.controller("UserStoryDetailController", UserStoryDetailController)
|
module.controller("UserStoryDetailController", UserStoryDetailController)
|
||||||
|
|
|
@ -147,6 +147,7 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@confirm.notify("success")
|
@confirm.notify("success")
|
||||||
|
|
||||||
onError = =>
|
onError = =>
|
||||||
|
finish(false)
|
||||||
@confirm.notify("error")
|
@confirm.notify("error")
|
||||||
|
|
||||||
@repo.remove(@scope.wiki).then onSuccess, onError
|
@repo.remove(@scope.wiki).then onSuccess, onError
|
||||||
|
|
|
@ -113,12 +113,14 @@ WikiNavDirective = ($tgrepo, $log, $location, $confirm, $navUrls) ->
|
||||||
$confirm.ask(title, subtitle).then (finish) =>
|
$confirm.ask(title, subtitle).then (finish) =>
|
||||||
promise = $tgrepo.remove($scope.wikiLinks[linkId])
|
promise = $tgrepo.remove($scope.wikiLinks[linkId])
|
||||||
promise.then ->
|
promise.then ->
|
||||||
$ctrl.loadWikiLinks().then ->
|
promise = $ctrl.loadWikiLinks()
|
||||||
|
promise.then ->
|
||||||
finish()
|
finish()
|
||||||
render($scope.wikiLinks)
|
render($scope.wikiLinks)
|
||||||
$ctrl.loadWikiLinks().then null, ->
|
promise.then null, ->
|
||||||
finish()
|
finish()
|
||||||
promise.then null, ->
|
promise.then null, ->
|
||||||
|
finish(false)
|
||||||
$confirm.notify("error")
|
$confirm.notify("error")
|
||||||
|
|
||||||
$el.on "keyup", ".new input", debounce 2000, (event) ->
|
$el.on "keyup", ".new input", debounce 2000, (event) ->
|
||||||
|
|
Loading…
Reference in New Issue