Fixes #3807 - Remove changes of 05a471f90d because they are not working as expected.

This commit is contained in:
Rolf Schmidt 2021-10-20 15:48:33 +01:00
parent b9bb88e96d
commit 4ca7c25480
2 changed files with 9 additions and 36 deletions

View file

@ -206,22 +206,13 @@ class App.TicketOverview extends App.Controller
article: article article: article
) )
ticket.article = article ticket.article = article
ticket.ajax().update( ticket.save(
ticket.attributes()
# this option will prevent callbacks and invalid data states in case of an error
failResponseNoTrigger: true
done: (r) => done: (r) =>
@batchCountIndex++ @batchCountIndex++
# refresh view after all tickets are proceeded # refresh view after all tickets are proceeded
if @batchCountIndex == @batchCount if @batchCountIndex == @batchCount
App.Event.trigger('overview:fetch') App.Event.trigger('overview:fetch')
fail: (record, settings, details) ->
console.log('record, settings, details', record, settings, details)
App.Event.trigger('notify', {
type: 'error'
msg: App.i18n.translateContent('Bulk action stopped %s!', error)
})
) )
return return
@ -234,21 +225,13 @@ class App.TicketOverview extends App.Controller
ticket.owner_id = id ticket.owner_id = id
if !_.isEmpty(groupId) if !_.isEmpty(groupId)
ticket.group_id = groupId ticket.group_id = groupId
ticket.ajax().update( ticket.save(
ticket.attributes()
# this option will prevent callbacks and invalid data states in case of an error
failResponseNoTrigger: true
done: (r) => done: (r) =>
@batchCountIndex++ @batchCountIndex++
# refresh view after all tickets are proceeded # refresh view after all tickets are proceeded
if @batchCountIndex == @batchCount if @batchCountIndex == @batchCount
App.Event.trigger('overview:fetch') App.Event.trigger('overview:fetch')
fail: (record, settings, details) ->
App.Event.trigger('notify', {
type: 'error'
msg: App.i18n.translateContent('Bulk action stopped %s!', settings.error)
})
) )
return return
@ -259,21 +242,13 @@ class App.TicketOverview extends App.Controller
#console.log "perform action #{action} with id #{id} on ", $(item).val() #console.log "perform action #{action} with id #{id} on ", $(item).val()
ticket = App.Ticket.find($(item).val()) ticket = App.Ticket.find($(item).val())
ticket.group_id = id ticket.group_id = id
ticket.ajax().update( ticket.save(
ticket.attributes()
# this option will prevent callbacks and invalid data states in case of an error
failResponseNoTrigger: true
done: (r) => done: (r) =>
@batchCountIndex++ @batchCountIndex++
# refresh view after all tickets are proceeded # refresh view after all tickets are proceeded
if @batchCountIndex == @batchCount if @batchCountIndex == @batchCount
App.Event.trigger('overview:fetch') App.Event.trigger('overview:fetch')
fail: (record, settings, details) ->
App.Event.trigger('notify', {
type: 'error'
msg: App.i18n.translateContent('Bulk action stopped %s!', error)
})
) )
return return

View file

@ -234,7 +234,6 @@ class Singleton extends Base
failResponse: (options) => failResponse: (options) =>
(xhr, statusText, error, settings) => (xhr, statusText, error, settings) =>
if options.failResponseNoTrigger isnt true
switch settings.type switch settings.type
when 'POST' then @createFailed() when 'POST' then @createFailed()
when 'DELETE' then @destroyFailed() when 'DELETE' then @destroyFailed()
@ -247,7 +246,6 @@ class Singleton extends Base
details = JSON.parse(detailsRaw) details = JSON.parse(detailsRaw)
options.fail?.call(@record, settings, details) options.fail?.call(@record, settings, details)
if options.failResponseNoTrigger isnt true
@record.trigger('destroy', @record) @record.trigger('destroy', @record)
# /add errors to calllback # /add errors to calllback