Skip to content

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

Disable turbo stream for form

Oliver Günther842ae27f9e86
diff --git a/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb b/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb
index dfab890d718..4bbd73674b0 100644
--- a/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb
+++ b/modules/auth_saml/app/components/saml/providers/sections/form_component.html.erb
@@ -3,8 +3,7 @@
id: "saml-providers-edit-form",
model: provider,
url:,
- method: form_method,
- data: { turbo: true, turbo_stream: true }
+ method: form_method
) do |form|
flex_layout do |flex|
if @heading
diff --git a/modules/auth_saml/app/controllers/saml/providers_controller.rb b/modules/auth_saml/app/controllers/saml/providers_controller.rb
index 9d71804f14a..de8af751e85 100644
--- a/modules/auth_saml/app/controllers/saml/providers_controller.rb
+++ b/modules/auth_saml/app/controllers/saml/providers_controller.rb
@@ -65,7 +65,6 @@ module Saml
.call(**create_params)
@provider = call.result
- binding.pry
if call.success?
successful_save_response
@@ -81,7 +80,7 @@ module Saml
.call(update_params)
if call.success?
- flash[:notice] = I18n.t(:notice_successful_update)
+ flash[:notice] = I18n.t(:notice_successful_update) unless @edit_mode
successful_save_response
else
@provider = call.result
@@ -108,11 +107,14 @@ module Saml
def successful_save_response
respond_to do |format|
format.turbo_stream do
- component = Saml::Providers::ViewComponent.new(@provider,
- edit_mode: @edit_mode,
- edit_state: @next_edit_state,
- view_mode: :show)
- update_via_turbo_stream(component:)
+ update_via_turbo_stream(
+ component: Saml::Providers::ViewComponent.new(
+ @provider,
+ edit_mode: @edit_mode,
+ edit_state: @next_edit_state,
+ view_mode: :show
+ )
+ )
render turbo_stream: turbo_streams
end
format.html do
@@ -192,8 +194,8 @@ module Saml
def update_params
params
- .require(:saml_provider)
- .permit(:display_name, *Saml::Provider.stored_attributes[:options])
+ .require(:saml_provider)
+ .permit(:display_name, *Saml::Provider.stored_attributes[:options])
end
def find_provider