From 7adc0a12d0d9c47894c47a687ca83363f3251a1f Mon Sep 17 00:00:00 2001 From: Dominik Klein Date: Wed, 5 Jan 2022 15:03:15 +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_zendesk.coffee | 2 +- spec/system/import/freshdesk_spec.rb | 8 +++++++- spec/system/import/zendesk_spec.rb | 8 +++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/import_freshdesk.coffee b/app/assets/javascripts/app/controllers/import_freshdesk.coffee index 42b16e066..910aec332 100644 --- a/app/assets/javascripts/app/controllers/import_freshdesk.coffee +++ b/app/assets/javascripts/app/controllers/import_freshdesk.coffee @@ -165,7 +165,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_zendesk.coffee b/app/assets/javascripts/app/controllers/import_zendesk.coffee index a9ac9932b..8d982a5b5 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 e5fc58ba6..f0771b515 100644 --- a/spec/system/import/freshdesk_spec.rb +++ b/spec/system/import/freshdesk_spec.rb @@ -112,7 +112,13 @@ RSpec.describe 'Import Freshdesk', type: :system, set_up: false, authenticated_a Rake::Task['zammad:setup:auto_wizard'].execute - expect(page).to have_text('Login') + 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 40058452e..f9db78fdb 100644 --- a/spec/system/import/zendesk_spec.rb +++ b/spec/system/import/zendesk_spec.rb @@ -121,7 +121,13 @@ RSpec.describe 'Import Zendesk', type: :system, set_up: false, authenticated_as: Rake::Task['zammad:setup:auto_wizard'].execute - expect(page).to have_text('Login') + 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