OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Close modals when turbo navigates
Oliver Günther5a31de47820d
diff --git a/frontend/src/app/core/augmenting/openproject-augmenting.module.ts b/frontend/src/app/core/augmenting/openproject-augmenting.module.tsindex 395ca9f6fc0..31e4c868487 100644--- a/frontend/src/app/core/augmenting/openproject-augmenting.module.ts+++ b/frontend/src/app/core/augmenting/openproject-augmenting.module.ts@@ -37,5 +37,9 @@ export class OpenprojectAugmentingModule {constructor(modalWrapper:OpModalWrapperAugmentService) {// Setup augmenting servicesmodalWrapper.setupListener();++ document.addEventListener('turbo:load', () => {+ modalWrapper.setupListener();+ });}}diff --git a/frontend/src/app/shared/components/modal/modal-wrapper-augment.service.ts b/frontend/src/app/shared/components/modal/modal-wrapper-augment.service.tsindex 5c5a0a13869..d4307e3ab16 100644--- a/frontend/src/app/shared/components/modal/modal-wrapper-augment.service.ts+++ b/frontend/src/app/shared/components/modal/modal-wrapper-augment.service.ts@@ -43,7 +43,9 @@ export class OpModalWrapperAugmentService {@Inject(DOCUMENT) protected documentElement:Document,protected injector:Injector,protected opModalService:OpModalService,- ) {}+ ) {+ documentElement.addEventListener('turbo:before-render', () => opModalService.close());+ }/*** Create initial listeners for Rails-rendered modalsdiff --git a/modules/two_factor_authentication/spec/features/account_activation_spec.rb b/modules/two_factor_authentication/spec/features/account_activation_spec.rbindex 78c2a665a0a..3c5ac03cf98 100644--- a/modules/two_factor_authentication/spec/features/account_activation_spec.rb+++ b/modules/two_factor_authentication/spec/features/account_activation_spec.rb@@ -1,7 +1,9 @@require_relative "../spec_helper"require_relative "shared_2fa_examples"-RSpec.describe "activating an invited account", :js,+RSpec.describe "activating an invited account",+ :js,+ :with_cuprite,with_settings: {plugin_openproject_two_factor_authentication: { "active_strategies" => [:developer] }} do@@ -49,12 +51,11 @@ RSpec.describe "activating an invited account", :js,# rubocop:enable RSpec/AnyInstanceactivate!-expect_flash(message: "Developer strategy generated the following one-time password:")- SeleniumHubWaiter.waitfill_in I18n.t(:field_otp), with: sms_tokenclick_button I18n.t(:button_login)+ wait_for_network_idlevisit my_account_pathexpect(page).to have_css(".form--field-container", text: user.login)diff --git a/modules/two_factor_authentication/spec/features/shared_2fa_examples.rb b/modules/two_factor_authentication/spec/features/shared_2fa_examples.rbindex 3042abf82fa..2d0a94a2465 100644--- a/modules/two_factor_authentication/spec/features/shared_2fa_examples.rb+++ b/modules/two_factor_authentication/spec/features/shared_2fa_examples.rb@@ -44,6 +44,7 @@ RSpec.shared_examples "create enforced sms device" doSeleniumHubWaiter.waitfill_in "device_phone_number", with: "invalid"click_on "Continue"+ wait_for_network_idle# Expect error on invalid phoneexpect_flash(type: :error, message: "Phone number must be of format +XX XXXXXXXXX")@@ -51,12 +52,12 @@ RSpec.shared_examples "create enforced sms device" doSeleniumHubWaiter.waitfill_in "device_phone_number", with: "+49 123456789"click_on "Continue"+ wait_for_network_idle# Confirm pageexpect(page).to have_css("h2", text: I18n.t("two_factor_authentication.devices.confirm_device"))expect(page).to have_css("input#otp")- SeleniumHubWaiter.wait# Fill in wrong tokenfill_in "otp", with: "whatever"