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