Fixes #2471 - Chat can't be closed after timeout.
This commit is contained in:
parent
3ddb52c9b9
commit
485196b013
7 changed files with 39 additions and 20 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
2
public/assets/chat/chat-no-jquery.min.js
vendored
2
public/assets/chat/chat-no-jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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()
|
||||
|
||||
|
|
|
@ -1416,15 +1416,14 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
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();
|
||||
}
|
||||
|
|
2
public/assets/chat/chat.min.js
vendored
2
public/assets/chat/chat.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue