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

[Op#54117] Refactor storage view components to use the more declaritive `OpTurbo::{ComponentStream,Streamable}` helpers (#15922)

Kabiru Mwenjaf99864f02b74
diff --git a/modules/storages/app/components/storages/admin/access_management_component.html.erb b/modules/storages/app/components/storages/admin/access_management_component.html.erb
index fad5d11eebc..d91a65e7dcf 100644
--- a/modules/storages/app/components/storages/admin/access_management_component.html.erb
+++ b/modules/storages/app/components/storages/admin/access_management_component.html.erb
@@ -1,34 +1,36 @@
<%=
- grid_layout('op-storage-view--row',
- tag: :div,
- test_selector: 'storage-access-management-section',
- align_items: :center) do |grid|
- grid.with_area(:item, tag: :div, mr: 3) do
- concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'access-management-label')) do
- I18n.t('storages.file_storage_view.access_management.subtitle')
- end)
- concat(configuration_check_label_for(:access_management_configured))
- end
+ component_wrapper(tag: 'turbo-frame') do
+ grid_layout('op-storage-view--row',
+ tag: :div,
+ test_selector: 'storage-access-management-section',
+ align_items: :center) do |grid|
+ grid.with_area(:item, tag: :div, mr: 3) do
+ concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'access-management-label')) do
+ I18n.t('storages.file_storage_view.access_management.subtitle')
+ end)
+ concat(configuration_check_label_for(:access_management_configured))
+ end
- grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'access-management-description') do
- render(Primer::Beta::Text.new) { access_management_description }
- end
+ grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'access-management-description') do
+ render(Primer::Beta::Text.new) { access_management_description }
+ end
- if editable_storage?
- grid.with_area(:"icon-button", tag: :div, color: :muted) do
- flex_layout(justify_content: :flex_end) do |icons_container|
- icons_container.with_column do
- render(
- Primer::Beta::IconButton.new(
- icon: :pencil,
- tag: :a,
- scheme: :invisible,
- href: edit_admin_settings_storage_access_management_path(storage),
- aria: { label: I18n.t('storages.label_edit_storage_access_management') },
- test_selector: 'storage-edit-access-management-button',
- data: { turbo_stream: true }
+ if editable_storage?
+ grid.with_area(:"icon-button", tag: :div, color: :muted) do
+ flex_layout(justify_content: :flex_end) do |icons_container|
+ icons_container.with_column do
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :pencil,
+ tag: :a,
+ scheme: :invisible,
+ href: edit_admin_settings_storage_access_management_path(storage),
+ aria: { label: I18n.t('storages.label_edit_storage_access_management') },
+ test_selector: 'storage-edit-access-management-button',
+ data: { turbo_stream: true }
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/access_management_component.rb b/modules/storages/app/components/storages/admin/access_management_component.rb
index 21adaff978e..0819ca1f0e1 100644
--- a/modules/storages/app/components/storages/admin/access_management_component.rb
+++ b/modules/storages/app/components/storages/admin/access_management_component.rb
@@ -31,10 +31,13 @@
module Storages::Admin
class AccessManagementComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
include StorageViewInformation
alias_method :storage, :model
+ def self.wrapper_key = :access_management_section
+
private
def access_management_description
diff --git a/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.html.erb b/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.html.erb
index c9feeb2d4e1..fa01dfba65a 100644
--- a/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.html.erb
+++ b/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.html.erb
@@ -1,29 +1,31 @@
<%=
- grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
- grid.with_area(:item, tag: :div, mr: 3) do
- concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-managed-project-folders-label')) { I18n.t('storages.file_storage_view.automatically_managed_folders') })
- concat(automatically_managed_project_folders_status_label)
- end
+ component_wrapper(tag: 'turbo-frame') do
+ grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
+ grid.with_area(:item, tag: :div, mr: 3) do
+ concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-managed-project-folders-label')) { I18n.t('storages.file_storage_view.automatically_managed_folders') })
+ concat(automatically_managed_project_folders_status_label)
+ end
- grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-automatically-managed-project-folders-description') do
- render(Primer::Beta::Text.new) { I18n.t('storages.page_titles.managed_project_folders.subtitle_short') }
- end
+ grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-automatically-managed-project-folders-description') do
+ render(Primer::Beta::Text.new) { I18n.t('storages.page_titles.managed_project_folders.subtitle_short') }
+ end
- if editable_storage?
- grid.with_area(:"icon-button", tag: :div, color: :muted) do
- flex_layout(justify_content: :flex_end) do |icons_container|
- icons_container.with_column do
- render(
- Primer::Beta::IconButton.new(
- icon: :pencil,
- tag: :a,
- href: edit_button_path,
- scheme: :invisible,
- aria: { label: I18n.t('storages.label_edit_storage_automatically_managed_folders') },
- test_selector: 'storage-edit-automatically-managed-project-folders-button',
- data: { turbo_stream: true }
+ if editable_storage?
+ grid.with_area(:"icon-button", tag: :div, color: :muted) do
+ flex_layout(justify_content: :flex_end) do |icons_container|
+ icons_container.with_column do
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :pencil,
+ tag: :a,
+ href: edit_button_path,
+ scheme: :invisible,
+ aria: { label: I18n.t('storages.label_edit_storage_automatically_managed_folders') },
+ test_selector: 'storage-edit-automatically-managed-project-folders-button',
+ data: { turbo_stream: true }
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.rb b/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.rb
index 83e35ba0931..bd5047da5fb 100644
--- a/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.rb
+++ b/modules/storages/app/components/storages/admin/automatically_managed_project_folders_info_component.rb
@@ -31,10 +31,13 @@
module Storages::Admin
class AutomaticallyManagedProjectFoldersInfoComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
include StorageViewInformation
alias_method :storage, :model
+ def self.wrapper_key = :automatically_managed_project_folders_section
+
def edit_button_path
if storage.automatic_management_unspecified?
new_admin_settings_storage_automatically_managed_project_folders_path(storage)
diff --git a/modules/storages/app/components/storages/admin/forms/access_management_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/access_management_form_component.html.erb
index 158ea595bc5..f5601c15b73 100644
--- a/modules/storages/app/components/storages/admin/forms/access_management_form_component.html.erb
+++ b/modules/storages/app/components/storages/admin/forms/access_management_form_component.html.erb
@@ -1,34 +1,36 @@
<%=
- render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-access-management-form')) do
- primer_form_with(
- model:,
- url: admin_settings_storage_access_management_path(storage),
- method: form_method
- ) do |form|
- flex_layout do |access_management_row|
- access_management_row.with_row(mb: 3) do
- render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t(:'storages.file_storage_view.access_management.subtitle') }
- end
+ component_wrapper(tag: 'turbo-frame') do
+ render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-access-management-form')) do
+ primer_form_with(
+ model:,
+ url: admin_settings_storage_access_management_path(storage),
+ method: form_method
+ ) do |form|
+ flex_layout do |access_management_row|
+ access_management_row.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t(:'storages.file_storage_view.access_management.subtitle') }
+ end
- access_management_row.with_row(mb: 3) do
- render(Primer::Beta::Text.new(test_selector: 'storage-access-management-description')) do
- I18n.t(:'storages.file_storage_view.access_management.description')
+ access_management_row.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(test_selector: 'storage-access-management-description')) do
+ I18n.t(:'storages.file_storage_view.access_management.description')
+ end
end
- end
- access_management_row.with_row do
- render(Storages::Admin::AccessManagementForm.new(form, storage:))
- end
+ access_management_row.with_row do
+ render(Storages::Admin::AccessManagementForm.new(form, storage:))
+ end
- access_management_row.with_row do
- render(
- Storages::Admin::SubmitOrCancelForm.new(
- form,
- storage:,
- submit_button_options: {},
- cancel_button_options: { href: cancel_button_path }
+ access_management_row.with_row do
+ render(
+ Storages::Admin::SubmitOrCancelForm.new(
+ form,
+ storage:,
+ submit_button_options: {},
+ cancel_button_options: { href: cancel_button_path }
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/forms/access_management_form_component.rb b/modules/storages/app/components/storages/admin/forms/access_management_form_component.rb
index 1e7cca85a6c..649161a1bbc 100644
--- a/modules/storages/app/components/storages/admin/forms/access_management_form_component.rb
+++ b/modules/storages/app/components/storages/admin/forms/access_management_form_component.rb
@@ -31,8 +31,12 @@
module Storages::Admin::Forms
class AccessManagementFormComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
+
alias_method :storage, :model
+ def self.wrapper_key = :access_management_section
+
private
def form_method
diff --git a/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.html.erb
index dc8e9f5fa08..d7b5ef58f3f 100644
--- a/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.html.erb
+++ b/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.html.erb
@@ -1,46 +1,48 @@
<%=
- render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-automatically-managed-project-folders-form')) do
- primer_form_with(
- model:,
- url: form_url,
- method: form_method,
- data: {
- controller: "storages--automatically-managed-project-folders-form",
- 'application-target': "dynamic",
- 'storages--automatically-managed-project-folders-form-provider-type-value': storage.provider_type,
- 'storages--automatically-managed-project-folders-form-is-automatically-managed-value': storage.automatic_management_enabled?,
- 'storages--automatically-managed-project-folders-form-done-complete-label-value': I18n.t("storages.buttons.done_complete_setup"),
- 'storages--automatically-managed-project-folders-form-done-complete-without-label-value': I18n.t("storages.buttons.complete_without_setup"),
- }
- ) do |form|
- flex_layout do |project_folders_form|
- project_folders_form.with_row(mb: 3) do
- render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t(:'storages.label_managed_project_folders.automatically_managed_folders') }
- end
+ component_wrapper(tag: 'turbo-frame') do
+ render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-automatically-managed-project-folders-form')) do
+ primer_form_with(
+ model:,
+ url: form_url,
+ method: form_method,
+ data: {
+ controller: "storages--automatically-managed-project-folders-form",
+ 'application-target': "dynamic",
+ 'storages--automatically-managed-project-folders-form-provider-type-value': storage.provider_type,
+ 'storages--automatically-managed-project-folders-form-is-automatically-managed-value': storage.automatic_management_enabled?,
+ 'storages--automatically-managed-project-folders-form-done-complete-label-value': I18n.t("storages.buttons.done_complete_setup"),
+ 'storages--automatically-managed-project-folders-form-done-complete-without-label-value': I18n.t("storages.buttons.complete_without_setup"),
+ }
+ ) do |form|
+ flex_layout do |project_folders_form|
+ project_folders_form.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t(:'storages.label_managed_project_folders.automatically_managed_folders') }
+ end
- project_folders_form.with_row(mb: 3) do
- render(Primer::Beta::Text.new) { I18n.t("storages.page_titles.managed_project_folders.subtitle") }
- end
+ project_folders_form.with_row(mb: 3) do
+ render(Primer::Beta::Text.new) { I18n.t("storages.page_titles.managed_project_folders.subtitle") }
+ end
- project_folders_form.with_row(mb: 3) do
- render(Storages::Admin::ManagedProjectFolders::AutomaticManagementCheckbox.new(form, storage:))
- end
+ project_folders_form.with_row(mb: 3) do
+ render(Storages::Admin::ManagedProjectFolders::AutomaticManagementCheckbox.new(form, storage:))
+ end
- project_folders_form.with_row(mb: 3,
- data: { 'storages--automatically-managed-project-folders-form-target': "applicationPasswordInput" },
- **application_password_display_options) do
- render(Storages::Admin::ManagedProjectFolders::ApplicationPasswordInput.new(form, storage:))
- end
+ project_folders_form.with_row(mb: 3,
+ data: { 'storages--automatically-managed-project-folders-form-target': "applicationPasswordInput" },
+ **application_password_display_options) do
+ render(Storages::Admin::ManagedProjectFolders::ApplicationPasswordInput.new(form, storage:))
+ end
- project_folders_form.with_row do
- render(
- Storages::Admin::SubmitOrCancelForm.new(
- form,
- storage:,
- submit_button_options:,
- cancel_button_options:
+ project_folders_form.with_row do
+ render(
+ Storages::Admin::SubmitOrCancelForm.new(
+ form,
+ storage:,
+ submit_button_options:,
+ cancel_button_options:
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.rb b/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.rb
index d44c4d47015..ceb3803fe69 100644
--- a/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.rb
+++ b/modules/storages/app/components/storages/admin/forms/automatically_managed_project_folders_form_component.rb
@@ -31,8 +31,12 @@
module Storages::Admin::Forms
class AutomaticallyManagedProjectFoldersFormComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
+
alias_method :storage, :model
+ def self.wrapper_key = :automatically_managed_project_folders_section
+
def form_method
options[:form_method] || default_form_method
end
diff --git a/modules/storages/app/components/storages/admin/forms/general_info_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/general_info_form_component.html.erb
index ab570f4ff19..9b01d38fa0b 100644
--- a/modules/storages/app/components/storages/admin/forms/general_info_form_component.html.erb
+++ b/modules/storages/app/components/storages/admin/forms/general_info_form_component.html.erb
@@ -1,57 +1,59 @@
<%=
- render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-general-info-form')) do
- primer_form_with(
- model:,
- url: form_url,
- method: form_method,
- data: {
- controller: "storages--automatically-managed-project-folders-form",
- 'application-target': "dynamic",
- 'storages--automatically-managed-project-folders-form-provider-type-value': storage.provider_type,
- 'storages--automatically-managed-project-folders-form-is-automatically-managed-value': storage.automatic_management_enabled?,
- }
- ) do |form|
- flex_layout do |general_info_row|
- general_info_row.with_row(mb: 3) do
- concat(render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("storages.label_file_storage") })
- concat(render(Storages::Admin::ProviderTypeHiddenInputForm.new(form, storage:))) if storage.new_record?
- end
+ component_wrapper(tag: 'turbo-frame') do
+ render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-general-info-form')) do
+ primer_form_with(
+ model:,
+ url: form_url,
+ method: form_method,
+ data: {
+ controller: "storages--automatically-managed-project-folders-form",
+ 'application-target': "dynamic",
+ 'storages--automatically-managed-project-folders-form-provider-type-value': storage.provider_type,
+ 'storages--automatically-managed-project-folders-form-is-automatically-managed-value': storage.automatic_management_enabled?,
+ }
+ ) do |form|
+ flex_layout do |general_info_row|
+ general_info_row.with_row(mb: 3) do
+ concat(render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("storages.label_file_storage") })
+ concat(render(Storages::Admin::ProviderTypeHiddenInputForm.new(form, storage:))) if storage.new_record?
+ end
- general_info_row.with_row(mb: 3) do
- render(Primer::Beta::Text.new(test_selector: 'storage-provider-configuration-instructions')) { provider_configuration_instructions }
- end
+ general_info_row.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(test_selector: 'storage-provider-configuration-instructions')) { provider_configuration_instructions }
+ end
- general_info_row.with_row(mb: 3) do
- render(Storages::Admin::ProviderNameInputForm.new(form))
- end
+ general_info_row.with_row(mb: 3) do
+ render(Storages::Admin::ProviderNameInputForm.new(form))
+ end
- if storage.provider_type_nextcloud?
- general_info_row.with_row(mb: 3) do
- render(Storages::Admin::ProviderHostInputForm.new(form))
- end
- end
+ if storage.provider_type_nextcloud?
+ general_info_row.with_row(mb: 3) do
+ render(Storages::Admin::ProviderHostInputForm.new(form))
+ end
+ end
- if storage.provider_type_one_drive?
- general_info_row.with_row(mb: 3) do
- render(Storages::Admin::ProviderDriveIdInputForm.new(form))
- end
+ if storage.provider_type_one_drive?
+ general_info_row.with_row(mb: 3) do
+ render(Storages::Admin::ProviderDriveIdInputForm.new(form))
+ end
- general_info_row.with_row(mb: 3) do
- render(Storages::Admin::ProviderTenantIdInputForm.new(form))
- end
- end
+ general_info_row.with_row(mb: 3) do
+ render(Storages::Admin::ProviderTenantIdInputForm.new(form))
+ end
+ end
- general_info_row.with_row do
- render(
- Storages::Admin::SubmitOrCancelForm.new(
- form,
- storage:,
- submit_button_options:,
- cancel_button_options:
- )
- )
+ general_info_row.with_row do
+ render(
+ Storages::Admin::SubmitOrCancelForm.new(
+ form,
+ storage:,
+ submit_button_options:,
+ cancel_button_options:
+ )
+ )
+ end
+ end
end
end
- end
end
%>
diff --git a/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb b/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb
index 788c426a4c6..d66ebd9f968 100644
--- a/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb
+++ b/modules/storages/app/components/storages/admin/forms/general_info_form_component.rb
@@ -31,11 +31,15 @@
module Storages::Admin::Forms
class GeneralInfoFormComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
+
alias_method :storage, :model
options form_method: :post,
submit_button_disabled: false
+ def self.wrapper_key = :storage_general_info_section
+
def form_url
options[:form_url] || default_form_url
end
diff --git a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb
index 0ce74a15d84..0f8d107db56 100644
--- a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb
+++ b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.html.erb
@@ -1,36 +1,38 @@
<%=
- render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-oauth-client-form')) do
- primer_form_with(
- model: oauth_client,
- url: admin_settings_storage_oauth_client_path(storage),
- method: form_method
- ) do |form|
- flex_layout do |oauth_client_row|
- oauth_client_row.with_row(mb: 3) do
- render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("storages.file_storage_view.#{storage.short_provider_type}_oauth") }
- end
+ component_wrapper(tag: 'turbo-frame') do
+ render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-oauth-client-form')) do
+ primer_form_with(
+ model: oauth_client,
+ url: admin_settings_storage_oauth_client_path(storage),
+ method: form_method
+ ) do |form|
+ flex_layout do |oauth_client_row|
+ oauth_client_row.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("storages.file_storage_view.#{storage.short_provider_type}_oauth") }
+ end
- oauth_client_row.with_row(mb: 3) do
- render(Primer::Beta::Text.new(test_selector: 'storage-provider-credentials-instructions')) { storage_provider_credentials_instructions }
- end
+ oauth_client_row.with_row(mb: 3) do
+ render(Primer::Beta::Text.new(test_selector: 'storage-provider-credentials-instructions')) { storage_provider_credentials_instructions }
+ end
- oauth_client_row.with_row(mb: 3) do
- render(Storages::Admin::OAuthClientForm.new(form,storage:,))
- end
+ oauth_client_row.with_row(mb: 3) do
+ render(Storages::Admin::OAuthClientForm.new(form,storage:,))
+ end
- oauth_client_row.with_row do
- render(
- Storages::Admin::SubmitOrCancelForm.new(
- form,
- storage:,
- submit_button_options: {
- test_selector: 'storage-oauth-client-submit-button'
- },
- cancel_button_options: {
- href: cancel_button_path
- }
+ oauth_client_row.with_row do
+ render(
+ Storages::Admin::SubmitOrCancelForm.new(
+ form,
+ storage:,
+ submit_button_options: {
+ test_selector: 'storage-oauth-client-submit-button'
+ },
+ cancel_button_options: {
+ href: cancel_button_path
+ }
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb
index 02a25df14e5..40680de2c83 100644
--- a/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb
+++ b/modules/storages/app/components/storages/admin/forms/oauth_client_form_component.rb
@@ -31,6 +31,7 @@
module Storages::Admin::Forms
class OAuthClientFormComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
attr_reader :storage
alias_method :oauth_client, :model
@@ -40,6 +41,8 @@ module Storages::Admin::Forms
@storage = storage
end
+ def self.wrapper_key = :storage_oauth_client_section
+
def form_method
options[:form_method] || default_form_method
end
diff --git a/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.html.erb
index 6ae3d36d530..b039331bc9c 100644
--- a/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.html.erb
+++ b/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.html.erb
@@ -1,52 +1,54 @@
<%=
- render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-oauth-client-form')) do
- primer_form_with(
- model: oauth_client,
- url: finish_setup_admin_settings_storage_oauth_client_path(storage),
- method: :post
- ) do |form|
- flex_layout do |oauth_client_row|
- oauth_client_row.with_row(mb: 3) do
- concat(render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |input_group|
- input_group.with_text_input(
- name: :oauth_client_redirect_uri,
- label: I18n.t('storages.label_redirect_uri'),
- visually_hide_label: false,
- value: redirect_uri_or_instructions,
- required: true
- )
+ component_wrapper(tag: 'turbo-frame') do
+ render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-oauth-client-form')) do
+ primer_form_with(
+ model: oauth_client,
+ url: finish_setup_admin_settings_storage_oauth_client_path(storage),
+ method: :post
+ ) do |form|
+ flex_layout do |oauth_client_row|
+ oauth_client_row.with_row(mb: 3) do
+ concat(render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |input_group|
+ input_group.with_text_input(
+ name: :oauth_client_redirect_uri,
+ label: I18n.t('storages.label_redirect_uri'),
+ visually_hide_label: false,
+ value: redirect_uri_or_instructions,
+ required: true
+ )
- input_group.with_trailing_action_clipboard_copy_button(
- value: redirect_uri_or_instructions,
- aria: {
- label: I18n.t('button_copy_to_clipboard')
- },
- test_selector: 'storage-oauth-client-redirect-uri'
- )
- end)
+ input_group.with_trailing_action_clipboard_copy_button(
+ value: redirect_uri_or_instructions,
+ aria: {
+ label: I18n.t('button_copy_to_clipboard')
+ },
+ test_selector: 'storage-oauth-client-redirect-uri'
+ )
+ end)
- # NOTE: Hardcoded `FormControl-caption` class is used to align the text with the input field.
- # This is a workaround until Primer::OpenProject::InputGroup supports a caption.
- # See https://community.openproject.org/wp/51376
- concat(render(Primer::Beta::Text.new(classes: 'FormControl-caption')) do
- I18n.t('storages.instructions.one_drive.oauth_client_redirect_uri')
- end)
- end
+ # NOTE: Hardcoded `FormControl-caption` class is used to align the text with the input field.
+ # This is a workaround until Primer::OpenProject::InputGroup supports a caption.
+ # See https://community.openproject.org/wp/51376
+ concat(render(Primer::Beta::Text.new(classes: 'FormControl-caption')) do
+ I18n.t('storages.instructions.one_drive.oauth_client_redirect_uri')
+ end)
+ end
- oauth_client_row.with_row do
- render(Storages::Admin::SubmitOrCancelForm.new(
- form,
- storage:,
- submit_button_options: {
- disabled: submit_button_disabled? || @options[:is_complete],
- label: I18n.t('storages.buttons.done_complete_setup'),
- data: { turbo: false },
- test_selector: 'storage-oauth-client-submit-button'
- },
- cancel_button_options: {
- href: cancel_button_path
- }
- ))
+ oauth_client_row.with_row do
+ render(Storages::Admin::SubmitOrCancelForm.new(
+ form,
+ storage:,
+ submit_button_options: {
+ disabled: submit_button_disabled? || @options[:is_complete],
+ label: I18n.t('storages.buttons.done_complete_setup'),
+ data: { turbo: false },
+ test_selector: 'storage-oauth-client-submit-button'
+ },
+ cancel_button_options: {
+ href: cancel_button_path
+ }
+ ))
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.rb b/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.rb
index 8bc1430f95e..fca7001e273 100644
--- a/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.rb
+++ b/modules/storages/app/components/storages/admin/forms/redirect_uri_form_component.rb
@@ -31,6 +31,7 @@
module Storages::Admin::Forms
class RedirectUriFormComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
attr_reader :storage
alias_method :oauth_client, :model
@@ -40,6 +41,8 @@ module Storages::Admin::Forms
@storage = storage
end
+ def self.wrapper_key = :storage_redirect_uri_section
+
def cancel_button_path
storage.persisted? ? edit_admin_settings_storage_path(storage) : admin_settings_storages_path
end
diff --git a/modules/storages/app/components/storages/admin/general_info_component.html.erb b/modules/storages/app/components/storages/admin/general_info_component.html.erb
index d5edf7ab9b8..3b08347ad93 100644
--- a/modules/storages/app/components/storages/admin/general_info_component.html.erb
+++ b/modules/storages/app/components/storages/admin/general_info_component.html.erb
@@ -1,29 +1,31 @@
<%=
- grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
- grid.with_area(:item, tag: :div, mr: 3) do
- concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-provider-label')) { I18n.t('storages.file_storage_view.storage_provider') })
- concat(configuration_check_label)
- end
+ component_wrapper(tag: 'turbo-frame') do
+ grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
+ grid.with_area(:item, tag: :div, mr: 3) do
+ concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-provider-label')) { I18n.t('storages.file_storage_view.storage_provider') })
+ concat(configuration_check_label)
+ end
- grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-description') do
- render(Primer::Beta::Text.new) { storage_description }
- end
+ grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-description') do
+ render(Primer::Beta::Text.new) { storage_description }
+ end
- if editable_storage?
- grid.with_area(:"icon-button", tag: :div, color: :muted) do
- flex_layout(justify_content: :flex_end) do |icons_container|
- icons_container.with_column do
- render(
- Primer::Beta::IconButton.new(
- icon: :pencil,
- tag: :a,
- scheme: :invisible,
- href: edit_host_admin_settings_storage_path(storage),
- aria: { label: I18n.t('storages.label_edit_storage_host') } ,
- test_selector: 'storage-edit-host-button',
- data: { turbo_stream: true }
+ if editable_storage?
+ grid.with_area(:"icon-button", tag: :div, color: :muted) do
+ flex_layout(justify_content: :flex_end) do |icons_container|
+ icons_container.with_column do
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :pencil,
+ tag: :a,
+ scheme: :invisible,
+ href: edit_host_admin_settings_storage_path(storage),
+ aria: { label: I18n.t('storages.label_edit_storage_host') } ,
+ test_selector: 'storage-edit-host-button',
+ data: { turbo_stream: true }
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/general_info_component.rb b/modules/storages/app/components/storages/admin/general_info_component.rb
index 251bb08fce6..57494887956 100644
--- a/modules/storages/app/components/storages/admin/general_info_component.rb
+++ b/modules/storages/app/components/storages/admin/general_info_component.rb
@@ -31,8 +31,11 @@
module Storages::Admin
class GeneralInfoComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
include StorageViewInformation
alias_method :storage, :model
+
+ def self.wrapper_key = :storage_general_info_section
end
end
diff --git a/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb b/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb
index 867ec5ceb1d..58ba704f68f 100644
--- a/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb
+++ b/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb
@@ -1,37 +1,39 @@
<%=
- grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
- grid.with_area(:item, tag: :div, mr: 3) do
- concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-openproject-oauth-label')) { I18n.t('storages.file_storage_view.openproject_oauth') })
- concat(configuration_check_label_for(:openproject_oauth_application_configured))
- end
+ component_wrapper(tag: 'turbo-frame') do
+ grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
+ grid.with_area(:item, tag: :div, mr: 3) do
+ concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-openproject-oauth-label')) { I18n.t('storages.file_storage_view.openproject_oauth') })
+ concat(configuration_check_label_for(:openproject_oauth_application_configured))
+ end
- grid.with_area(:description,
- classes: 'wb-break-word',
- tag: :div,
- color: :subtle,
- test_selector: 'storage-openproject-oauth-application-description') do
- render(Primer::Beta::Text.new) { openproject_oauth_client_description }
- end
+ grid.with_area(:description,
+ classes: 'wb-break-word',
+ tag: :div,
+ color: :subtle,
+ test_selector: 'storage-openproject-oauth-application-description') do
+ render(Primer::Beta::Text.new) { openproject_oauth_client_description }
+ end
- if editable_storage?
- grid.with_area(:"icon-button", tag: :div, color: :muted, test_selector: 'storage-replace-openproject-oauth-application') do
- flex_layout(justify_content: :flex_end) do |icons_container|
- icons_container.with_column do
- primer_form_with(
- model: storage,
- url: replace_oauth_application_admin_settings_storage_path(storage),
- method: :delete
- ) do |_form|
- render(
- Primer::Beta::IconButton.new(
- icon: :sync,
- scheme: :invisible,
- type: :submit,
- aria: { label: I18n.t('storages.buttons.replace_oauth_application') },
- data: { confirm: I18n.t('storages.confirm_replace_oauth_application') },
- test_selector: 'storage-replace-openproject-oauth-application-button'
+ if editable_storage?
+ grid.with_area(:"icon-button", tag: :div, color: :muted, test_selector: 'storage-replace-openproject-oauth-application') do
+ flex_layout(justify_content: :flex_end) do |icons_container|
+ icons_container.with_column do
+ primer_form_with(
+ model: storage,
+ url: replace_oauth_application_admin_settings_storage_path(storage),
+ method: :delete
+ ) do |_form|
+ render(
+ Primer::Beta::IconButton.new(
+ icon: :sync,
+ scheme: :invisible,
+ type: :submit,
+ aria: { label: I18n.t('storages.buttons.replace_oauth_application') },
+ data: { confirm: I18n.t('storages.confirm_replace_oauth_application') },
+ test_selector: 'storage-replace-openproject-oauth-application-button'
+ )
)
- )
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/oauth_application_info_component.rb b/modules/storages/app/components/storages/admin/oauth_application_info_component.rb
index 3e0bd63f070..7754c0f7f9a 100644
--- a/modules/storages/app/components/storages/admin/oauth_application_info_component.rb
+++ b/modules/storages/app/components/storages/admin/oauth_application_info_component.rb
@@ -31,6 +31,7 @@
module Storages::Admin
class OAuthApplicationInfoComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
include StorageViewInformation
attr_reader :storage
@@ -40,5 +41,7 @@ module Storages::Admin
super(oauth_application, **)
@storage = storage
end
+
+ def self.wrapper_key = :storage_openproject_oauth_section
end
end
diff --git a/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.html.erb b/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.html.erb
index bc514b6ac49..392c72c6742 100644
--- a/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.html.erb
+++ b/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.html.erb
@@ -1,44 +1,46 @@
<%=
- render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-openproject-oauth-application-form')) do
- flex_layout(flex_items: :center) do |credentials_row|
- credentials_row.with_row(mb: 3, test_selector: 'storage-openproject_oauth_application_warning') do
- render(Primer::Alpha::Banner.new(icon: :alert, scheme: :warning)) do
- I18n.t('storages.instructions.oauth_application_details', oauth_application_details_link: oauth_application_details_link).html_safe
+ component_wrapper(tag: 'turbo-frame') do
+ render(Primer::Beta::Text.new(tag: :div, test_selector: 'storage-openproject-oauth-application-form')) do
+ flex_layout(flex_items: :center) do |credentials_row|
+ credentials_row.with_row(mb: 3, test_selector: 'storage-openproject_oauth_application_warning') do
+ render(Primer::Alpha::Banner.new(icon: :alert, scheme: :warning)) do
+ I18n.t('storages.instructions.oauth_application_details', oauth_application_details_link: oauth_application_details_link).html_safe
+ end
end
- end
- credentials_row.with_row(mb: 3) do
- render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |input_group|
- input_group.with_text_input(name: :openproject_oauth_application_uid,
- label: I18n.t('storages.label_openproject_oauth_application_id'),
- visually_hide_label: false,
- value: oauth_application.uid,
- required: true)
- input_group.with_trailing_action_clipboard_copy_button(
- value: oauth_application.uid,
- aria: {
- label: I18n.t('button_copy_to_clipboard')
- })
+ credentials_row.with_row(mb: 3) do
+ render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |input_group|
+ input_group.with_text_input(name: :openproject_oauth_application_uid,
+ label: I18n.t('storages.label_openproject_oauth_application_id'),
+ visually_hide_label: false,
+ value: oauth_application.uid,
+ required: true)
+ input_group.with_trailing_action_clipboard_copy_button(
+ value: oauth_application.uid,
+ aria: {
+ label: I18n.t('button_copy_to_clipboard')
+ })
+ end
end
- end
- credentials_row.with_row(mb: 3) do
- render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |input_group|
- input_group.with_text_input(name: :openproject_oauth_application_secret,
- label: I18n.t('storages.label_openproject_oauth_application_secret'),
- visually_hide_label: false,
- value: oauth_application.plaintext_secret,
- required: true)
- input_group.with_trailing_action_clipboard_copy_button(
- value: oauth_application.plaintext_secret,
- aria: {
- label: I18n.t('button_copy_to_clipboard')
- })
+ credentials_row.with_row(mb: 3) do
+ render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |input_group|
+ input_group.with_text_input(name: :openproject_oauth_application_secret,
+ label: I18n.t('storages.label_openproject_oauth_application_secret'),
+ visually_hide_label: false,
+ value: oauth_application.plaintext_secret,
+ required: true)
+ input_group.with_trailing_action_clipboard_copy_button(
+ value: oauth_application.plaintext_secret,
+ aria: {
+ label: I18n.t('button_copy_to_clipboard')
+ })
+ end
end
- end
- credentials_row.with_row do
- concat(render(Primer::Beta::Button.new(**submit_button_options)) { I18n.t('storages.buttons.done_continue') })
+ credentials_row.with_row do
+ concat(render(Primer::Beta::Button.new(**submit_button_options)) { I18n.t('storages.buttons.done_continue') })
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.rb b/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.rb
index 4be78441b2e..4454551711a 100644
--- a/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.rb
+++ b/modules/storages/app/components/storages/admin/oauth_application_info_copy_component.rb
@@ -30,6 +30,7 @@
#
module Storages::Admin
class OAuthApplicationInfoCopyComponent < ApplicationComponent
+ include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
attr_reader :storage
@@ -40,6 +41,8 @@ module Storages::Admin
@storage = storage
end
+ def self.wrapper_key = :storage_openproject_oauth_section
+
def oauth_application_details_link
render(
Primer::Beta::Link.new(
diff --git a/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb b/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb
index 1ac8f96901b..d6c7f749341 100644
--- a/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb
+++ b/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb
@@ -1,27 +1,29 @@
<%=
- grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
- grid.with_area(:item, tag: :div, mr: 3) do
- concat(
- render(
- Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-oauth-client-label')
- ) { I18n.t("storages.file_storage_view.#{storage.short_provider_type}_oauth") }
- )
- concat(configuration_check_label_for(:storage_oauth_client_configured))
- end
+ component_wrapper(tag: 'turbo-frame') do
+ grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
+ grid.with_area(:item, tag: :div, mr: 3) do
+ concat(
+ render(
+ Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-oauth-client-label')
+ ) { I18n.t("storages.file_storage_view.#{storage.short_provider_type}_oauth") }
+ )
+ concat(configuration_check_label_for(:storage_oauth_client_configured))
+ end
- grid.with_area(:description,
- classes: 'wb-break-word',
- tag: :div,
- color: :subtle,
- test_selector: 'storage-oauth-client-id-description') do
- render(Primer::Beta::Text.new) { provider_oauth_client_description }
- end
+ grid.with_area(:description,
+ classes: 'wb-break-word',
+ tag: :div,
+ color: :subtle,
+ test_selector: 'storage-oauth-client-id-description') do
+ render(Primer::Beta::Text.new) { provider_oauth_client_description }
+ end
- if editable_storage?
- grid.with_area(:"icon-button", tag: :div, color: :muted) do
- flex_layout(justify_content: :flex_end) do |icons_container|
- icons_container.with_column do
- render(Primer::Beta::IconButton.new(**edit_icon_button_options))
+ if editable_storage?
+ grid.with_area(:"icon-button", tag: :div, color: :muted) do
+ flex_layout(justify_content: :flex_end) do |icons_container|
+ icons_container.with_column do
+ render(Primer::Beta::IconButton.new(**edit_icon_button_options))
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/oauth_client_info_component.rb b/modules/storages/app/components/storages/admin/oauth_client_info_component.rb
index 75f280104c2..bc6202b6d56 100644
--- a/modules/storages/app/components/storages/admin/oauth_client_info_component.rb
+++ b/modules/storages/app/components/storages/admin/oauth_client_info_component.rb
@@ -31,6 +31,7 @@
module Storages::Admin
class OAuthClientInfoComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
include StorageViewInformation
attr_reader :storage
@@ -41,6 +42,8 @@ module Storages::Admin
@storage = storage
end
+ def self.wrapper_key = :storage_oauth_client_section
+
def edit_icon_button_options
label = I18n.t("storages.buttons.replace_oauth_client",
provider_type: I18n.t("storages.provider_types.#{storage.short_provider_type}.name"))
diff --git a/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb b/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb
index 5e6030aa75b..5b40e06c866 100644
--- a/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb
+++ b/modules/storages/app/components/storages/admin/redirect_uri_component.html.erb
@@ -1,27 +1,29 @@
<%=
- grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
- grid.with_area(:item, tag: :div, mr: 3) do
- concat(
- render(
- Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-redirect-uri-label')
- ) { I18n.t('storages.file_storage_view.redirect_uri') }
- )
- concat(configuration_check_label_for(:storage_oauth_client_configured))
- end
+ component_wrapper(tag: 'turbo-frame') do
+ grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
+ grid.with_area(:item, tag: :div, mr: 3) do
+ concat(
+ render(
+ Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-redirect-uri-label')
+ ) { I18n.t('storages.file_storage_view.redirect_uri') }
+ )
+ concat(configuration_check_label_for(:storage_oauth_client_configured))
+ end
- grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-redirect-uri-description') do
- concat(render(Primer::Beta::Text.new) { provider_redirect_uri_description })
- if storage.oauth_client.present?
- concat(render(Primer::Beta::ClipboardCopy.new('aria-label': I18n.t('storages.instructions.one_drive.copy_redirect_uri'),
- value: storage.oauth_client.redirect_uri)))
+ grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-redirect-uri-description') do
+ concat(render(Primer::Beta::Text.new) { provider_redirect_uri_description })
+ if storage.oauth_client.present?
+ concat(render(Primer::Beta::ClipboardCopy.new('aria-label': I18n.t('storages.instructions.one_drive.copy_redirect_uri'),
+ value: storage.oauth_client.redirect_uri)))
+ end
end
- end
- if editable_storage?
- grid.with_area(:"icon-button", tag: :div, color: :muted) do
- flex_layout(justify_content: :flex_end) do |icons_container|
- icons_container.with_column do
- render(Primer::Beta::IconButton.new(**show_icon_button_options))
+ if editable_storage?
+ grid.with_area(:"icon-button", tag: :div, color: :muted) do
+ flex_layout(justify_content: :flex_end) do |icons_container|
+ icons_container.with_column do
+ render(Primer::Beta::IconButton.new(**show_icon_button_options))
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/redirect_uri_component.rb b/modules/storages/app/components/storages/admin/redirect_uri_component.rb
index d5d9de4c5be..79c901ce3b3 100644
--- a/modules/storages/app/components/storages/admin/redirect_uri_component.rb
+++ b/modules/storages/app/components/storages/admin/redirect_uri_component.rb
@@ -31,6 +31,7 @@
module Storages::Admin
class RedirectUriComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
include StorageViewInformation
attr_reader :storage
@@ -41,6 +42,8 @@ module Storages::Admin
@storage = storage
end
+ def self.wrapper_key = :storage_redirect_uri_section
+
def show_icon_button_options
{
icon: :eye,
diff --git a/modules/storages/app/components/storages/admin/storage_view_component.html.erb b/modules/storages/app/components/storages/admin/storage_view_component.html.erb
index cfb600023ec..c2cdb656367 100644
--- a/modules/storages/app/components/storages/admin/storage_view_component.html.erb
+++ b/modules/storages/app/components/storages/admin/storage_view_component.html.erb
@@ -5,12 +5,10 @@
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :storage_general_info_section)) do
- if storage.new_record?
- render(Storages::Admin::Forms::GeneralInfoFormComponent.new(storage))
- else
- render(Storages::Admin::GeneralInfoComponent.new(storage))
- end
+ if storage.new_record?
+ render(Storages::Admin::Forms::GeneralInfoFormComponent.new(storage))
+ else
+ render(Storages::Admin::GeneralInfoComponent.new(storage))
end
end
@@ -24,19 +22,15 @@
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :storage_openproject_oauth_section)) do
- if storage.new_record? || openproject_oauth_application_section_closed?
- render(Storages::Admin::OAuthApplicationInfoComponent.new(oauth_application:, storage:))
- else
- render(Storages::Admin::OAuthApplicationInfoCopyComponent.new(oauth_application:, storage:))
- end
+ if storage.new_record? || openproject_oauth_application_section_closed?
+ render(Storages::Admin::OAuthApplicationInfoComponent.new(oauth_application:, storage:))
+ else
+ render(Storages::Admin::OAuthApplicationInfoCopyComponent.new(oauth_application:, storage:))
end
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :storage_oauth_client_section)) do
- render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: storage.oauth_client, storage:))
- end
+ render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: storage.oauth_client, storage:))
end
component.with_row(scheme: :neutral, color: :muted) do
@@ -48,12 +42,10 @@
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :automatically_managed_project_folders_section)) do
- if automatically_managed_project_folders_section_closed?
- render(Storages::Admin::AutomaticallyManagedProjectFoldersInfoComponent.new(storage))
- else
- render(Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(storage))
- end
+ if automatically_managed_project_folders_section_closed?
+ render(Storages::Admin::AutomaticallyManagedProjectFoldersInfoComponent.new(storage))
+ else
+ render(Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(storage))
end
end
end
@@ -68,9 +60,7 @@
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :access_management_section)) do
- render(Storages::Admin::AccessManagementComponent.new(storage))
- end
+ render(Storages::Admin::AccessManagementComponent.new(storage))
end
component.with_row(scheme: :neutral, color: :muted) do
@@ -82,15 +72,11 @@
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :storage_oauth_client_section)) do
- render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: storage.oauth_client, storage:))
- end
+ render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: storage.oauth_client, storage:))
end
component.with_row(scheme: :default) do
- render(OpTurbo::FrameComponent.new(id: :storage_redirect_uri_section)) do
- render(Storages::Admin::RedirectUriComponent.new(oauth_client: storage.oauth_client, storage:))
- end
+ render(Storages::Admin::RedirectUriComponent.new(oauth_client: storage.oauth_client, storage:))
end
end
end
diff --git a/modules/storages/app/controllers/storages/admin/access_management_controller.rb b/modules/storages/app/controllers/storages/admin/access_management_controller.rb
index 7391af563f6..ac337e1ec6c 100644
--- a/modules/storages/app/controllers/storages/admin/access_management_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/access_management_controller.rb
@@ -29,6 +29,8 @@
#++
class Storages::Admin::AccessManagementController < ApplicationController
+ include OpTurbo::ComponentStream
+
layout "admin"
before_action :require_admin
@@ -56,34 +58,36 @@ class Storages::Admin::AccessManagementController < ApplicationController
service_result = call_update_service
service_result.on_success do
- respond_to { |format| format.turbo_stream }
+ update_via_turbo_stream(component: Storages::Admin::AccessManagementComponent.new(@storage))
+ update_via_turbo_stream(component: Storages::Admin::Forms::OAuthClientFormComponent.new(
+ oauth_client: @storage.build_oauth_client, storage: @storage
+ ))
end
service_result.on_failure do
- respond_to do |format|
- format.turbo_stream { render :edit }
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::AccessManagementFormComponent.new(@storage))
end
+
+ respond_with_turbo_streams
end
def update
service_result = call_update_service
service_result.on_success do
- respond_to { |format| format.turbo_stream }
+ update_via_turbo_stream(component: Storages::Admin::AccessManagementComponent.new(@storage))
end
service_result.on_failure do
- respond_to do |format|
- format.turbo_stream { render :edit }
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::AccessManagementFormComponent.new(@storage))
end
+
+ respond_with_turbo_streams
end
def edit
- respond_to do |format|
- format.turbo_stream
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::AccessManagementFormComponent.new(@storage))
+ respond_with_turbo_streams
end
def default_breadcrumb
diff --git a/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb b/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb
index 094fd8f94c5..45f10b454f1 100644
--- a/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/automatically_managed_project_folders_controller.rb
@@ -32,6 +32,8 @@
# This is recommended as it ensures that every team member always has the correct access permissions.
#
class Storages::Admin::AutomaticallyManagedProjectFoldersController < ApplicationController
+ include OpTurbo::ComponentStream
+
# See https://guides.rubyonrails.org/layouts_and_rendering.html for reference on layout
layout "admin"
@@ -64,10 +66,7 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatio
.call
.result
- respond_to do |format|
- format.html { render "/storages/admin/storages/automatically_managed_project_folders/edit" }
- format.turbo_stream { render :edit }
- end
+ respond_with_ampf_form_turbo_stream_or_edit_html
end
def create
@@ -80,10 +79,7 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatio
}
redirect_to admin_settings_storages_path
else
- respond_to do |format|
- format.html { render "/storages/admin/storages/automatically_managed_project_folders/edit" }
- format.turbo_stream
- end
+ respond_with_ampf_form_turbo_stream_or_edit_html
end
end
@@ -91,10 +87,7 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatio
# Used by: The StoragesController#edit, when user wants to update application credentials.
# Called by: Global app/config/routes.rb to serve Web page
def edit
- respond_to do |format|
- format.html { render "/storages/admin/storages/automatically_managed_project_folders/edit" }
- format.turbo_stream
- end
+ respond_with_ampf_form_turbo_stream_or_edit_html
end
# Update is similar to create above
@@ -106,7 +99,7 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatio
if service_result.success?
redirect_to edit_admin_settings_storage_path(@storage)
else
- render "/storages/admin/storages/automatically_managed_project_folders/edit"
+ render :edit
end
end
@@ -125,6 +118,16 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatio
private
+ def respond_with_ampf_form_turbo_stream_or_edit_html
+ update_via_turbo_stream(
+ component: Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(@storage)
+ )
+
+ respond_with_turbo_streams do |format|
+ format.html { render :edit }
+ end
+ end
+
# Override default url param `:id` to `:storage` controller is a nested storage resource
# GET /admin/settings/storages/:storage_id/automatically_managed_project_folders/new
# POST /admin/settings/storages/:storage_id/automatically_managed_project_folders
diff --git a/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb b/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb
index a1a5667c80f..2b2d4f9e28e 100644
--- a/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/oauth_clients_controller.rb
@@ -29,6 +29,8 @@
#++
class Storages::Admin::OAuthClientsController < ApplicationController
+ include OpTurbo::ComponentStream
+
# See https://guides.rubyonrails.org/layouts_and_rendering.html for reference on layout
layout "admin"
@@ -52,21 +54,17 @@ class Storages::Admin::OAuthClientsController < ApplicationController
.call
.result
- respond_to do |format|
- format.turbo_stream
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @oauth_client,
+ storage: @storage))
+ respond_with_turbo_streams
end
- # Actually create a OAuthClient object.
- # Use service pattern to create a new OAuthClient
- # Called by: Global app/config/routes.rb to serve Web page
- def create
+ def create # rubocop:disable Metrics/AbcSize
call_oauth_clients_create_service
service_result.on_failure do
- respond_to do |format|
- format.turbo_stream { render :new }
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @oauth_client,
+ storage: @storage))
end
service_result.on_success do
@@ -74,26 +72,37 @@ class Storages::Admin::OAuthClientsController < ApplicationController
prepare_storage_for_automatic_management_form
end
- respond_to do |format|
- format.turbo_stream
+ update_via_turbo_stream(component: Storages::Admin::OAuthClientInfoComponent.new(oauth_client: @oauth_client,
+ storage: @storage))
+ update_via_turbo_stream(component: Storages::Admin::Forms::RedirectUriFormComponent.new(
+ oauth_client: @oauth_client, storage: @storage, is_complete: false
+ ))
+
+ if @storage.provider_type_nextcloud? && @storage.automatic_management_new_record?
+ update_via_turbo_stream(component: Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(@storage))
end
end
+
+ respond_with_turbo_streams
end
def update
call_oauth_clients_create_service
service_result.on_failure do
- respond_to do |format|
- format.turbo_stream { render :new }
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @oauth_client,
+ storage: @storage))
end
service_result.on_success do
- respond_to do |format|
- format.turbo_stream
- end
+ update_via_turbo_stream(component: Storages::Admin::OAuthClientInfoComponent.new(oauth_client: @oauth_client,
+ storage: @storage))
+ update_via_turbo_stream(component: Storages::Admin::RedirectUriComponent.new(
+ oauth_client: @oauth_client, storage: @storage
+ ))
end
+
+ respond_with_turbo_streams
end
# Used by: admin layout
diff --git a/modules/storages/app/controllers/storages/admin/storages_controller.rb b/modules/storages/app/controllers/storages/admin/storages_controller.rb
index bacb294a174..13ec7e2007b 100644
--- a/modules/storages/app/controllers/storages/admin/storages_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/storages_controller.rb
@@ -73,10 +73,9 @@ class Storages::Admin::StoragesController < ApplicationController
.call
.result
- respond_to do |format|
- format.html
- format.turbo_stream
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::GeneralInfoFormComponent.new(@storage))
+
+ respond_with_turbo_streams(&:html)
end
def upsale; end
@@ -95,7 +94,7 @@ class Storages::Admin::StoragesController < ApplicationController
end
end
- def create
+ def create # rubocop:disable Metrics/AbcSize
service_result = Storages::Storages::CreateService
.new(user: current_user)
.call(permitted_storage_params)
@@ -104,44 +103,63 @@ class Storages::Admin::StoragesController < ApplicationController
@oauth_application = oauth_application(service_result)
service_result.on_failure do
- respond_to do |format|
- format.turbo_stream { render :new }
- end
+ update_via_turbo_stream(component: Storages::Admin::Forms::GeneralInfoFormComponent.new(@storage))
end
service_result.on_success do
if @storage.provider_type_one_drive?
prepare_storage_for_access_management_form
+ update_via_turbo_stream(component: Storages::Admin::Forms::AccessManagementFormComponent.new(@storage))
end
- respond_to do |format|
- format.turbo_stream
+ update_via_turbo_stream(component: Storages::Admin::GeneralInfoComponent.new(@storage))
+
+ if @storage.provider_type_nextcloud?
+ update_via_turbo_stream(
+ component: Storages::Admin::OAuthApplicationInfoCopyComponent.new(
+ oauth_application: @oauth_application,
+ storage: @storage,
+ submit_button_options: { data: { turbo_stream: true } }
+ )
+ )
end
end
+
+ respond_with_turbo_streams
end
def show_oauth_application
@oauth_application = @storage.oauth_application
- respond_to do |format|
- format.turbo_stream
+ update_via_turbo_stream(
+ component: Storages::Admin::OAuthApplicationInfoComponent.new(oauth_application: @oauth_application,
+ storage: @storage)
+ )
+
+ if @storage.oauth_client.blank?
+ update_via_turbo_stream(
+ component: Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @storage.build_oauth_client,
+ storage: @storage)
+ )
end
+
+ respond_with_turbo_streams
end
- # Edit page is very similar to new page, except that we don't need to set
- # default attribute values because the object already exists;
- # Called by: Global app/config/routes.rb to serve Web page
def edit; end
def edit_host
- respond_to do |format|
- format.turbo_stream
- end
+ update_via_turbo_stream(
+ component: Storages::Admin::Forms::GeneralInfoFormComponent.new(
+ @storage,
+ form_method: :patch,
+ cancel_button_path: edit_admin_settings_storage_path(@storage)
+ )
+ )
+
+ respond_with_turbo_streams
end
- # Update is similar to create above
- # See also: create above
- # Called by: Global app/config/routes.rb to serve Web page
def update
service_result = ::Storages::Storages::UpdateService
.new(user: current_user, model: @storage)
@@ -149,13 +167,19 @@ class Storages::Admin::StoragesController < ApplicationController
@storage = service_result.result
if service_result.success?
- respond_to do |format|
- format.turbo_stream
- end
+ respond_to { |format| format.turbo_stream }
else
- respond_to do |format|
+ update_via_turbo_stream(
+ component: Storages::Admin::Forms::GeneralInfoFormComponent.new(
+ @storage,
+ form_method: :patch,
+ cancel_button_path: edit_admin_settings_storage_path(@storage)
+ )
+ )
+
+ respond_with_turbo_streams do |format|
+ # FIXME: This should be a partial stream update
format.html { render :edit }
- format.turbo_stream { render :edit_host }
end
end
end
@@ -202,8 +226,21 @@ class Storages::Admin::StoragesController < ApplicationController
@oauth_application = service_result.result
if service_result.success?
- render :replace_oauth_application
+ update_via_turbo_stream(component: Storages::Admin::GeneralInfoComponent.new(@storage))
+
+ update_via_turbo_stream(
+ component: Storages::Admin::OAuthApplicationInfoCopyComponent.new(
+ oauth_application: @oauth_application,
+ storage: @storage,
+ submit_button_options: {
+ data: { turbo_stream: true }
+ }
+ )
+ )
+
+ respond_with_turbo_streams
else
+ # FIXME: This should be a partial stream update
render :edit
end
end
diff --git a/modules/storages/app/views/storages/admin/access_management/create.turbo_stream.erb b/modules/storages/app/views/storages/admin/access_management/create.turbo_stream.erb
deleted file mode 100644
index af2284c56a1..00000000000
--- a/modules/storages/app/views/storages/admin/access_management/create.turbo_stream.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :access_management_section do %>
- <%= render(Storages::Admin::AccessManagementComponent.new(@storage)) %>
-<% end %>
-
-<%= turbo_stream.update :storage_oauth_client_section do %>
- <%= render(Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @storage.build_oauth_client, storage: @storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/access_management/edit.turbo_stream.erb b/modules/storages/app/views/storages/admin/access_management/edit.turbo_stream.erb
deleted file mode 100644
index 95959714723..00000000000
--- a/modules/storages/app/views/storages/admin/access_management/edit.turbo_stream.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :access_management_section do %>
- <%= render(Storages::Admin::Forms::AccessManagementFormComponent.new(@storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/access_management/update.turbo_stream.erb b/modules/storages/app/views/storages/admin/access_management/update.turbo_stream.erb
deleted file mode 100644
index 557a02a53c1..00000000000
--- a/modules/storages/app/views/storages/admin/access_management/update.turbo_stream.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :access_management_section do %>
- <%= render(Storages::Admin::AccessManagementComponent.new(@storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/automatically_managed_project_folders/create.turbo_stream.erb b/modules/storages/app/views/storages/admin/automatically_managed_project_folders/create.turbo_stream.erb
deleted file mode 100644
index 19fcdaa04d3..00000000000
--- a/modules/storages/app/views/storages/admin/automatically_managed_project_folders/create.turbo_stream.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :automatically_managed_project_folders_section do %>
- <%= render(Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(@storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/automatically_managed_project_folders/edit.html.erb b/modules/storages/app/views/storages/admin/automatically_managed_project_folders/edit.html.erb
similarity index 100%
rename from modules/storages/app/views/storages/admin/storages/automatically_managed_project_folders/edit.html.erb
rename to modules/storages/app/views/storages/admin/automatically_managed_project_folders/edit.html.erb
diff --git a/modules/storages/app/views/storages/admin/automatically_managed_project_folders/edit.turbo_stream.erb b/modules/storages/app/views/storages/admin/automatically_managed_project_folders/edit.turbo_stream.erb
deleted file mode 100644
index 19fcdaa04d3..00000000000
--- a/modules/storages/app/views/storages/admin/automatically_managed_project_folders/edit.turbo_stream.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :automatically_managed_project_folders_section do %>
- <%= render(Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(@storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/oauth_clients/create.turbo_stream.erb b/modules/storages/app/views/storages/admin/oauth_clients/create.turbo_stream.erb
deleted file mode 100644
index ae0615db4a1..00000000000
--- a/modules/storages/app/views/storages/admin/oauth_clients/create.turbo_stream.erb
+++ /dev/null
@@ -1,42 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_oauth_client_section do %>
- <%= render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: @oauth_client, storage: @storage)) %>
-<% end %>
-
-<%= turbo_stream.update :storage_redirect_uri_section do %>
- <%= render(Storages::Admin::Forms::RedirectUriFormComponent.new(oauth_client: @oauth_client, storage: @storage, is_complete: false)) %>
-<% end %>
-
-<% if @storage.provider_type_nextcloud? && @storage.automatic_management_new_record? %>
- <%= turbo_stream.update :automatically_managed_project_folders_section do %>
- <%= render(Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(@storage)) %>
- <% end %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/oauth_clients/new.turbo_stream.erb b/modules/storages/app/views/storages/admin/oauth_clients/new.turbo_stream.erb
deleted file mode 100644
index 1763cad95ee..00000000000
--- a/modules/storages/app/views/storages/admin/oauth_clients/new.turbo_stream.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_oauth_client_section do %>
- <%= render(Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @oauth_client, storage: @storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/oauth_clients/show_redirect_uri.html.erb b/modules/storages/app/views/storages/admin/oauth_clients/show_redirect_uri.html.erb
index 8ac6b133910..e4ea56f0460 100644
--- a/modules/storages/app/views/storages/admin/oauth_clients/show_redirect_uri.html.erb
+++ b/modules/storages/app/views/storages/admin/oauth_clients/show_redirect_uri.html.erb
@@ -27,6 +27,4 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= render(OpTurbo::FrameComponent.new(id: :storage_redirect_uri_section)) do %>
- <%= render(Storages::Admin::Forms::RedirectUriFormComponent.new(oauth_client: @storage.oauth_client, storage: @storage, is_complete: true)) %>
-<% end %>
+<%= render(Storages::Admin::Forms::RedirectUriFormComponent.new(oauth_client: @storage.oauth_client, storage: @storage, is_complete: true)) %>
diff --git a/modules/storages/app/views/storages/admin/oauth_clients/update.turbo_stream.erb b/modules/storages/app/views/storages/admin/oauth_clients/update.turbo_stream.erb
deleted file mode 100644
index d8a52966591..00000000000
--- a/modules/storages/app/views/storages/admin/oauth_clients/update.turbo_stream.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_oauth_client_section do %>
- <%= render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: @oauth_client, storage: @storage)) %>
-<% end %>
-
-<%= turbo_stream.update :storage_redirect_uri_section do %>
- <%= render(Storages::Admin::RedirectUriComponent.new(oauth_client: @oauth_client, storage: @storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/create.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/create.turbo_stream.erb
deleted file mode 100644
index 96000a151d5..00000000000
--- a/modules/storages/app/views/storages/admin/storages/create.turbo_stream.erb
+++ /dev/null
@@ -1,54 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_general_info_section do %>
- <%= render(Storages::Admin::GeneralInfoComponent.new(@storage)) %>
-<% end %>
-
-<% if @storage.provider_type_nextcloud? %>
- <%= turbo_stream.update :storage_openproject_oauth_section do %>
- <%=
- render(
- Storages::Admin::OAuthApplicationInfoCopyComponent.new(
- oauth_application: @oauth_application,
- storage: @storage,
- submit_button_options: {
- data: { turbo_stream: true }
- }
- )
- )
- %>
- <% end %>
-<% end %>
-
-<% if @storage.provider_type_one_drive? %>
- <%= turbo_stream.update :access_management_section do %>
- <%= render(Storages::Admin::Forms::AccessManagementFormComponent.new(@storage)) %>
- <% end %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/edit_host.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/edit_host.turbo_stream.erb
deleted file mode 100644
index e7513bf4890..00000000000
--- a/modules/storages/app/views/storages/admin/storages/edit_host.turbo_stream.erb
+++ /dev/null
@@ -1,40 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_general_info_section do %>
- <%=
- render(
- Storages::Admin::Forms::GeneralInfoFormComponent.new(
- @storage,
- form_method: :patch,
- cancel_button_path: edit_admin_settings_storage_path(@storage)
- )
- )
- %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/new.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/new.turbo_stream.erb
deleted file mode 100644
index dcf450dbca8..00000000000
--- a/modules/storages/app/views/storages/admin/storages/new.turbo_stream.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_general_info_section do %>
- <%= render(Storages::Admin::Forms::GeneralInfoFormComponent.new(@storage)) %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/replace_oauth_application.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/replace_oauth_application.turbo_stream.erb
deleted file mode 100644
index a2ea7cde290..00000000000
--- a/modules/storages/app/views/storages/admin/storages/replace_oauth_application.turbo_stream.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_general_info_section do %>
- <%= render(Storages::Admin::GeneralInfoComponent.new(@storage)) %>
-<% end %>
-
-<%= turbo_stream.update :storage_openproject_oauth_section do %>
- <%=
- render(
- Storages::Admin::OAuthApplicationInfoCopyComponent.new(
- oauth_application: @oauth_application,
- storage: @storage,
- submit_button_options: {
- data: { turbo_stream: true }
- }
- )
- )
- %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/show_oauth_application.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/show_oauth_application.turbo_stream.erb
deleted file mode 100644
index da70f8546b3..00000000000
--- a/modules/storages/app/views/storages/admin/storages/show_oauth_application.turbo_stream.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<%#-- copyright
-OpenProject is an open source project management software.
-Copyright (C) 2012-2024 the OpenProject GmbH
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License version 3.
-
-OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-Copyright (C) 2006-2013 Jean-Philippe Lang
-Copyright (C) 2010-2013 the ChiliProject Team
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-See COPYRIGHT and LICENSE files for more details.
-
-++#%>
-
-<%= turbo_stream.update :storage_openproject_oauth_section do %>
- <%= render(Storages::Admin::OAuthApplicationInfoComponent.new(oauth_application: @oauth_application, storage: @storage)) %>
-<% end %>
-
-<% if @storage.oauth_client.blank? %>
- <%= turbo_stream.update :storage_oauth_client_section do %>
- <%= render(Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @storage.build_oauth_client, storage: @storage)) %>
- <% end %>
-<% end %>
diff --git a/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb
index 4fd99029951..e2ca4d7006e 100644
--- a/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb
+++ b/modules/storages/app/views/storages/admin/storages/update.turbo_stream.erb
@@ -20,6 +20,6 @@
<%= full_breadcrumbs %>
<% end %>
-<%= turbo_stream.update :storage_general_info_section do %>
+<%= turbo_stream.update ::Storages::Admin::GeneralInfoComponent.wrapper_key do %>
<%= render(::Storages::Admin::GeneralInfoComponent.new(@storage)) %>
<% end %>