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
chore[Op#56496]: Collapase mixin into a single module
Kabiru Mwenja39040c696cea
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex 3ed423a1317..609198f726f 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -52,7 +52,7 @@ class ApplicationController < ActionController::Baseinclude AdditionalUrlHelpersinclude OpenProjectErrorHelperinclude Security::DefaultUrlOptions- include OpModal::Flashable+ include OpModalFlashablelayout "base"diff --git a/app/controllers/concerns/op_modal/flashable.rb b/app/controllers/concerns/op_modal_flashable.rbsimilarity index 69%rename from app/controllers/concerns/op_modal/flashable.rbrename to app/controllers/concerns/op_modal_flashable.rbindex ea747b0a633..9d8d36ff88d 100644--- a/app/controllers/concerns/op_modal/flashable.rb+++ b/app/controllers/concerns/op_modal_flashable.rb@@ -26,24 +26,22 @@# See COPYRIGHT and LICENSE files for more details.#++-module OpModal- module Flashable- extend ActiveSupport::Concern+module OpModalFlashable+ extend ActiveSupport::Concern- included do- add_flash_types :op_modal- end+ included do+ add_flash_types :op_modal+ end- def flash_op_modal(component:, parameters: {})- flash[:op_modal] = { component: component.name, parameters: }- end+ def flash_op_modal(component:, parameters: {})+ flash[:op_modal] = { component: component.name, parameters: }+ end- def store_callback_op_modal_flash(component:, parameters: {})- session[:callback_op_modal] = { component: component.name, parameters: }- end+ def store_callback_op_modal_flash(component:, parameters: {})+ session[:callback_op_modal] = { component: component.name, parameters: }+ end- def retrieve_callback_op_modal_flash- session.delete(:callback_op_modal) if session[:callback_op_modal].present?- end+ def retrieve_callback_op_modal_flash+ session.delete(:callback_op_modal) if session[:callback_op_modal].present?endenddiff --git a/lookbook/docs/patterns/09-flash-modal.md.erb b/lookbook/docs/patterns/09-flash-modal.md.erbindex daeb087c42c..da831cb5595 100644--- a/lookbook/docs/patterns/09-flash-modal.md.erb+++ b/lookbook/docs/patterns/09-flash-modal.md.erb@@ -20,7 +20,7 @@ Internally, the `FlashMessagesHelper#render_flash_messages` will select flash me### Flash a modal on callback from external service-When you want to display a modal after a callback request from an external service, store the op modal component directly in the `session` in the controller action that performs by calling `OpModal::Flashable#store_callback_op_modal_flash` bofore the open redirect and then extract them in the controller action that handles the callback via `OpTurbo::Flashable#retrieve_callback_op_modal_flash`.+When you want to display a modal after a callback request from an external service, store the op modal component directly in the `session` in the controller action that performs by calling `OpModalFlashable#store_callback_op_modal_flash` bofore the open redirect and then extract them in the controller action that handles the callback via `OpTurbo::Flashable#retrieve_callback_op_modal_flash`.Ex.