From 20516d6f6e54a25489b818d0e04ef59693617bf1 Mon Sep 17 00:00:00 2001 From: Dominik Klein Date: Wed, 5 Jan 2022 11:30:04 +0100 Subject: [PATCH] Fixes #3879 - Freshdesk import ends up in Zammad interface without navigation. --- .../javascripts/app/controllers/import_freshdesk.coffee | 2 +- .../javascripts/app/controllers/import_kayako.coffee | 2 +- .../javascripts/app/controllers/import_zendesk.coffee | 2 +- spec/system/import/freshdesk_spec.rb | 6 ++++++ spec/system/import/kayako_spec.rb | 8 +++++++- spec/system/import/zendesk_spec.rb | 6 ++++++ 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/import_freshdesk.coffee b/app/assets/javascripts/app/controllers/import_freshdesk.coffee index 8f1ac6c21..e09c8b8eb 100644 --- a/app/assets/javascripts/app/controllers/import_freshdesk.coffee +++ b/app/assets/javascripts/app/controllers/import_freshdesk.coffee @@ -164,7 +164,7 @@ class ImportFreshdesk extends App.ControllerWizardFullScreen @$('.js-error').addClass('hide') if !_.isEmpty(data.finished_at) && _.isEmpty(data.result['error']) - window.location.reload() + @redirectToLogin() return if !_.isEmpty(data.result) diff --git a/app/assets/javascripts/app/controllers/import_kayako.coffee b/app/assets/javascripts/app/controllers/import_kayako.coffee index 49ebb5765..781a705fd 100644 --- a/app/assets/javascripts/app/controllers/import_kayako.coffee +++ b/app/assets/javascripts/app/controllers/import_kayako.coffee @@ -165,7 +165,7 @@ class ImportKayako extends App.ControllerWizardFullScreen @$('.js-error').addClass('hide') if !_.isEmpty(data.finished_at) && _.isEmpty(data.result['error']) - window.location.reload() + @redirectToLogin() return if !_.isEmpty(data.result) diff --git a/app/assets/javascripts/app/controllers/import_zendesk.coffee b/app/assets/javascripts/app/controllers/import_zendesk.coffee index 57fd72f7c..63feda5dd 100644 --- a/app/assets/javascripts/app/controllers/import_zendesk.coffee +++ b/app/assets/javascripts/app/controllers/import_zendesk.coffee @@ -163,7 +163,7 @@ class ImportZendesk extends App.ControllerWizardFullScreen @$('.js-error').addClass('hide') if !_.isEmpty(data.finished_at) && _.isEmpty(data.result['error']) - window.location.reload() + @redirectToLogin() return if !_.isEmpty(data.result) diff --git a/spec/system/import/freshdesk_spec.rb b/spec/system/import/freshdesk_spec.rb index 34630bead..bbead178e 100644 --- a/spec/system/import/freshdesk_spec.rb +++ b/spec/system/import/freshdesk_spec.rb @@ -113,6 +113,12 @@ RSpec.describe 'Import Freshdesk', type: :system, set_up: false, authenticated_a Rake::Task['zammad:setup:auto_wizard'].execute expect(page).to have_text(Setting.get('fqdn')) + + # Check that the login is working and also the left navigation side bar is visible. + login( + username: 'admin@example.com', + password: 'test', + ) end end end diff --git a/spec/system/import/kayako_spec.rb b/spec/system/import/kayako_spec.rb index ce226033e..8ffcbafc8 100644 --- a/spec/system/import/kayako_spec.rb +++ b/spec/system/import/kayako_spec.rb @@ -113,12 +113,18 @@ RSpec.describe 'Import Kayako', type: :system, set_up: false, authenticated_as: .and(have_css('.js-tickets .js-total', text: '5')) end - it 'shows login after import is finished' do + it 'shows login after import is finished and process login' do job.update! finished_at: Time.zone.now Rake::Task['zammad:setup:auto_wizard'].execute expect(page).to have_text(Setting.get('fqdn')) + + # Check that the login is working and also the left navigation side bar is visible. + login( + username: 'admin@example.com', + password: 'test', + ) end end end diff --git a/spec/system/import/zendesk_spec.rb b/spec/system/import/zendesk_spec.rb index 60ab45af7..4eff59b34 100644 --- a/spec/system/import/zendesk_spec.rb +++ b/spec/system/import/zendesk_spec.rb @@ -122,6 +122,12 @@ RSpec.describe 'Import Zendesk', type: :system, set_up: false, authenticated_as: Rake::Task['zammad:setup:auto_wizard'].execute expect(page).to have_text(Setting.get('fqdn')) + + # Check that the login is working and also the left navigation side bar is visible. + login( + username: 'admin@example.com', + password: 'test', + ) end end end