Fixes #2471 - Chat can't be closed after timeout.

This commit is contained in:
Rolf Schmidt 2021-10-14 16:21:06 +02:00 committed by Thorsten Eckel
parent 4b0fa96cc9
commit 3f48c222b5
7 changed files with 43 additions and 24 deletions

View file

@ -1097,16 +1097,14 @@ do(window) ->
return
if @initDelayId
clearTimeout(@initDelayId)
if !@sessionId
@log.debug 'can\'t close widget without sessionId'
return
if @sessionId
@log.debug 'session close before widget close'
@sessionClose()
@log.debug 'close widget'
event.stopPropagation() if event
@sessionClose()
if @isFullscreen
@enableScrollOnRoot()

View file

@ -1437,15 +1437,14 @@ var extend = function(child, parent) { for (var key in parent) { if (hasProp.cal
if (this.initDelayId) {
clearTimeout(this.initDelayId);
}
if (!this.sessionId) {
this.log.debug('can\'t close widget without sessionId');
return;
if (this.sessionId) {
this.log.debug('session close before widget close');
this.sessionClose();
}
this.log.debug('close widget');
if (event) {
event.stopPropagation();
}
this.sessionClose();
if (this.isFullscreen) {
this.enableScrollOnRoot();
}

File diff suppressed because one or more lines are too long

View file

@ -1108,16 +1108,14 @@ do($ = window.jQuery, window) ->
return
if @initDelayId
clearTimeout(@initDelayId)
if !@sessionId
@log.debug 'can\'t close widget without sessionId'
return
if @sessionId
@log.debug 'session close before widget close'
@sessionClose()
@log.debug 'close widget'
event.stopPropagation() if event
@sessionClose()
if @isFullscreen
@enableScrollOnRoot()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -388,4 +388,29 @@ RSpec.describe 'Chat Handling', type: :system do
include_examples 'chat button is hidden after idle timeout'
end
end
describe "Chat can't be closed after timeout #2471", authenticated_as: :authenticate do
shared_examples 'test issue #2471' do
it 'is able to close to the dialog after a idleTimeout happened' do
click agent_chat_switch_selector
open_window_and_switch
visit chat_url
click '.zammad-chat .js-chat-open'
expect(page).to have_selector('.js-restart', wait: 60)
click '.js-chat-toggle .zammad-chat-header-icon'
expect(page).to have_no_selector('zammad-chat-is-open', wait: 60)
end
end
context 'with jquery' do
include_examples 'test issue #2471'
end
context 'wihtout jquery' do
let(:chat_url_type) { 'znuny-no-jquery' }
include_examples 'test issue #2471'
end
end
end