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
feat[Op#50737]: Decompose the StorageViewComponent
Kabiru Mwenja7d447e5ba376
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.erbindex fed831a65d9..3a0d97e4172 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@@ -9,19 +9,21 @@render(Primer::Beta::Truncate.new(font_weight: :light)) { storage_description }end- grid.with_area(:"icon-button", tag: :div, color: :subtle) 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'+ if editable_storage?+ grid.with_area(:"icon-button", tag: :div, color: :subtle) 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'+ ))- )+ endendendenddiff --git a/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.html.erb b/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.html.erbindex a30a2f73e5c..b49ea02251a 100644--- a/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.html.erb+++ b/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.html.erb@@ -32,8 +32,8 @@endcredentials_row.with_row do- concat(render(Primer::Beta::Button.new(scheme: :primary, tag: :a, href: edit_admin_settings_storage_path(storage))) { I18n.t('storages.buttons.done_continue') })- concat(render(Primer::Beta::Button.new(scheme: :default, tag: :a, href: edit_admin_settings_storage_path(storage))) { I18n.t('button_cancel') })+ concat(render(Primer::Beta::Button.new(scheme: :primary, tag: :a, href: submit_button_path)) { I18n.t('storages.buttons.done_continue') })+ concat(render(Primer::Beta::Button.new(scheme: :default, tag: :a, href: cancel_button_path)) { I18n.t('button_cancel') })endendenddiff --git a/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.rb b/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.rbindex 8f5a9a93293..8f79a52b456 100644--- a/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.rb+++ b/modules/storages/app/components/storages/admin/oauth_application_credentials_copy_component.rb@@ -49,5 +49,13 @@ module Storages::Admin)) { I18n.t('storages.instructions.oauth_application_details_link_text') }end++ def submit_button_path+ options[:submit_button_path] || edit_admin_settings_storage_path(storage)+ end++ def cancel_button_path+ options[:cancel_button_path] || edit_admin_settings_storage_path(storage)+ endendenddiff --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.erbnew file mode 100644index 00000000000..3112f3eae9c--- /dev/null+++ b/modules/storages/app/components/storages/admin/oauth_application_info_component.html.erb@@ -0,0 +1,40 @@+<%=+ 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: :semibold, 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, tag: :div, color: :subtle, test_selector: 'storage-openproject-oauth-application-description') do+ render(Primer::Beta::Truncate.new(font_weight: :light)) { openproject_oauth_client_description }+ end++ if editable_storage?+ grid.with_area(:"icon-button", tag: :div, color: :subtle, 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_provider_type_oauth",+ provider_type: I18n.t("storages.provider_types.#{storage.short_provider_type}.name"))+ },+ data: { confirm: I18n.t("storages.confirm_replace_oauth_application") },+ test_selector: 'storage-replace-openproject-oauth-application-button'+ )+ )+ end+ end+ 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.rbnew file mode 100644index 00000000000..13caa32fb21--- /dev/null+++ b/modules/storages/app/components/storages/admin/oauth_application_info_component.rb@@ -0,0 +1,44 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2023 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.+#+++#+module Storages::Admin+ class OAuthApplicationInfoComponent < ApplicationComponent+ include OpPrimer::ComponentHelpers+ include StorageViewInformation++ attr_reader :storage+ alias_method :oauth_application, :model++ def initialize(oauth_application:, storage:, **options)+ super(oauth_application, **options)+ @storage = storage+ end+ end+enddiff --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.erbnew file mode 100644index 00000000000..37fa98e4e8d--- /dev/null+++ b/modules/storages/app/components/storages/admin/oauth_client_info_component.html.erb@@ -0,0 +1,32 @@+<%=+ 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: :semibold, mr: 1, test_selector: 'storage-oauth-client-label')) { I18n.t('storages.file_storage_view.nextcloud_oauth') })+ concat(configuration_check_label_for(:storage_oauth_client_configured))+ end++ grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-oauth-client-id-description') do+ render(Primer::Beta::Truncate.new(font_weight: :light)) { provider_oauth_client_description }+ end++ if editable_storage?+ grid.with_area(:"icon-button", tag: :div, color: :subtle) do+ flex_layout(justify_content: :flex_end) do |icons_container|+ icons_container.with_column do+ render(+ Primer::Beta::IconButton.new(+ icon: :sync,+ tag: :a,+ href: new_admin_settings_storage_oauth_client_path(storage),+ scheme: :invisible,+ aria: { label: I18n.t("storages.label_edit_storage_oauth_client") },+ data: { confirm: I18n.t("storages.confirm_replace_oauth_client") },+ test_selector: 'storage-edit-oauth-client-button'+ )+ )+ end+ 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.rbnew file mode 100644index 00000000000..27f358d5e56--- /dev/null+++ b/modules/storages/app/components/storages/admin/oauth_client_info_component.rb@@ -0,0 +1,44 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2023 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.+#+++#+module Storages::Admin+ class OAuthClientInfoComponent < ApplicationComponent+ include OpPrimer::ComponentHelpers+ include StorageViewInformation++ attr_reader :storage+ alias_method :oauth_client, :model++ def initialize(oauth_client:, storage:, **options)+ super(oauth_client, **options)+ @storage = storage+ end+ end+enddiff --git a/modules/storages/app/components/storages/admin/storage_view_component.html.erb b/modules/storages/app/components/storages/admin/storage_view_component.html.erbindex 5e633236fc0..6607adf752f 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,8 +5,17 @@endcomponent.with_row(scheme: :default) do- render(OpTurbo::FrameComponent.new(storage, context: :storage_view_general_info)) do- render(Storages::Admin::StorageGeneralInfoComponent.new(storage))+ render(OpTurbo::FrameComponent.new(id: :storage_general_info_section)) do+ if storage.new_record?+ render(+ Storages::Admin::Forms::GeneralInfoFormComponent.new(+ storage,+ cancel_button_should_break_from_frame: true # Return to index page on Cancel+ )+ )+ else+ render(Storages::Admin::GeneralInfoComponent.new(storage))+ endendend@@ -19,76 +28,25 @@endcomponent.with_row(scheme: :default) do- render(OpTurbo::FrameComponent.new(storage, context: :openproject_oauth)) 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: :semibold, 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, tag: :div, color: :subtle, test_selector: 'storage-openproject-oauth-application-description') do- render(Primer::Beta::Truncate.new(font_weight: :light)) { openproject_oauth_client_description }- end-- grid.with_area(:"icon-button", tag: :div, color: :subtle, 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_provider_type_oauth",- provider_type: I18n.t("storages.provider_types.#{storage.short_provider_type}.name"))- },- data: { confirm: I18n.t("storages.confirm_replace_oauth_application") },- test_selector: 'storage-replace-openproject-oauth-application-button'- )- )- end- end- end- end+ 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::OAuthApplicationCredentialsCopyComponent.new(+ oauth_application:,+ storage:,+ submit_button_path: show_oauth_application_admin_settings_storage_path(storage),+ cancel_button_path: admin_settings_storages_path+ )+ )endendendcomponent.with_row(scheme: :default) do- render(OpTurbo::FrameComponent.new(storage, context: :oauth_client)) 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: :semibold, mr: 1, test_selector: 'storage-oauth-client-label')) { I18n.t('storages.file_storage_view.nextcloud_oauth') })- concat(configuration_check_label_for(:storage_oauth_client_configured))- end-- grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-oauth-client-id-description') do- render(Primer::Beta::Truncate.new(font_weight: :light)) { provider_oauth_client_description }- end-- grid.with_area(:"icon-button", tag: :div, color: :subtle) do- flex_layout(justify_content: :flex_end) do |icons_container|- icons_container.with_column do- render(- Primer::Beta::IconButton.new(- icon: :sync,- tag: :a,- href: new_admin_settings_storage_oauth_client_path(storage),- scheme: :invisible,- aria: { label: I18n.t("storages.label_edit_storage_oauth_client") },- data: { confirm: I18n.t("storages.confirm_replace_oauth_client") },- test_selector: 'storage-edit-oauth-client-button'- )- )- end- end- end- end+ render(OpTurbo::FrameComponent.new(id: :storage_oauth_client_section)) do+ render(Storages::Admin::OAuthClientInfoComponent.new(oauth_client: storage.oauth_client, storage:))endend@@ -101,7 +59,7 @@endcomponent.with_row(scheme: :default) do- render(OpTurbo::FrameComponent.new(storage, context: :automatically_managed_project_folders)) do+ render(OpTurbo::FrameComponent.new(id: :automatically_managed_project_folders_section)) dogrid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|grid.with_area(:item, tag: :div, mr: 3) doconcat(render(Primer::Beta::Text.new(font_weight: :semibold, mr: 1, test_selector: 'storage-managed-project-folders-label')) { I18n.t('storages.file_storage_view.automatically_managed_folders') })@@ -112,19 +70,21 @@render(Primer::Beta::Truncate.new(font_weight: :light)) { I18n.t('storages.page_titles.managed_project_folders.subtitle_short') }end- grid.with_area(:"icon-button", tag: :div, color: :subtle) 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: new_admin_settings_storage_automatically_managed_project_folders_path(storage),- scheme: :invisible,- aria: { label: I18n.t('storages.label_edit_storage_automatically_managed_folders') },- test_selector: 'storage-edit-automatically-managed-project-folders-button'+ if editable_storage?+ grid.with_area(:"icon-button", tag: :div, color: :subtle) 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: new_admin_settings_storage_automatically_managed_project_folders_path(storage),+ scheme: :invisible,+ aria: { label: I18n.t('storages.label_edit_storage_automatically_managed_folders') },+ test_selector: 'storage-edit-automatically-managed-project-folders-button'+ ))- )+ endendendenddiff --git a/modules/storages/app/components/storages/admin/storage_view_component.rb b/modules/storages/app/components/storages/admin/storage_view_component.rbindex af50ab1c83e..ba01ef49f06 100644--- a/modules/storages/app/components/storages/admin/storage_view_component.rb+++ b/modules/storages/app/components/storages/admin/storage_view_component.rb@@ -31,7 +31,17 @@module Storages::Adminclass StorageViewComponent < ApplicationComponentinclude OpPrimer::ComponentHelpers- alias_method :storage, :modelinclude StorageViewInformation++ options openproject_oauth_application_section_open: false++ alias_method :storage, :model+ alias_method :openproject_oauth_application_section_open?, :openproject_oauth_application_section_open++ delegate :oauth_application, to: :model++ def openproject_oauth_application_section_closed?+ !openproject_oauth_application_section_open?+ endendenddiff --git a/modules/storages/app/components/storages/admin/storage_view_information.rb b/modules/storages/app/components/storages/admin/storage_view_information.rbindex 4fd088acdb6..109b89a8155 100644--- a/modules/storages/app/components/storages/admin/storage_view_information.rb+++ b/modules/storages/app/components/storages/admin/storage_view_information.rb@@ -4,6 +4,10 @@ module Storages::Adminmodule StorageViewInformationprivate+ def editable_storage?+ storage.persisted?+ end+def storage_description[storage.short_provider_type.capitalize,storage.name,diff --git a/modules/storages/app/controllers/storages/admin/storages_controller.rb b/modules/storages/app/controllers/storages/admin/storages_controller.rbindex 42f22d15516..a7cbc239889 100644--- a/modules/storages/app/controllers/storages/admin/storages_controller.rb+++ b/modules/storages/app/controllers/storages/admin/storages_controller.rb@@ -41,7 +41,8 @@ class Storages::Admin::StoragesController < ApplicationController# Before executing any action below: Make sure the current user is an admin# and set the @<controller_name> variable to the object referenced in the URL.before_action :require_admin- before_action :find_model_object, only: %i[show destroy edit edit_host update replace_oauth_application]+ before_action :find_model_object,+ only: %i[show show_oauth_application destroy edit edit_host update replace_oauth_application]before_action :prepare_update_params, only: %i[update]# menu_item is defined in the Redmine::MenuManager::MenuController@@ -91,34 +92,51 @@ class Storages::Admin::StoragesController < ApplicationControllerendend- # rubocop:disable Metrics/AbcSize- def create- service_result = Storages::Storages::CreateService.new(user: current_user).call(permitted_storage_params)+ def create # rubocop:disable Metrics/AbcSize+ service_result = Storages::Storages::CreateService+ .new(user: current_user)+ .call(permitted_storage_params)@storage = service_result.result@oauth_application = oauth_application(service_result)service_result.on_failure do- render :new+ if OpenProject::FeatureDecisions.storage_primer_design_active?+ respond_to do |format|+ format.turbo_stream { render :select_provider }+ end+ else+ render :new+ endendservice_result.on_success do- case @storage.provider_type- when ::Storages::Storage::PROVIDER_TYPE_ONE_DRIVE- flash[:notice] = I18n.t(:notice_successful_create)- render '/storages/admin/storages/one_drive/edit'- when ::Storages::Storage::PROVIDER_TYPE_NEXTCLOUD- if @oauth_application.present?- flash.now[:notice] = I18n.t(:notice_successful_create)- render :show_oauth_application+ if OpenProject::FeatureDecisions.storage_primer_design_active?+ respond_to do |format|+ format.turbo_stream { render :show_oauth_application }endelse- raise "Unknown provider type: #{storage_params['provider_type']}"+ case @storage.provider_type+ when ::Storages::Storage::PROVIDER_TYPE_ONE_DRIVE+ flash.now[:notice] = I18n.t(:notice_successful_create)+ render '/storages/admin/storages/one_drive/edit'+ when ::Storages::Storage::PROVIDER_TYPE_NEXTCLOUD+ if @oauth_application.present?+ flash.now[:notice] = I18n.t(:notice_successful_create)+ render :show_oauth_application+ end+ else+ raise "Unknown provider type: #{storage_params['provider_type']}"+ endendendend- # rubocop:enable Metrics/AbcSize+ def show_oauth_application+ @oauth_application = @storage.oauth_application++ respond_to { |format| format.turbo_stream }+ 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;diff --git a/modules/storages/app/views/storages/admin/oauth_clients/edit.html.erb b/modules/storages/app/views/storages/admin/oauth_clients/edit.html.erbindex 5c5f1cd484a..77001bf54a8 100644--- a/modules/storages/app/views/storages/admin/oauth_clients/edit.html.erb+++ b/modules/storages/app/views/storages/admin/oauth_clients/edit.html.erb@@ -1,5 +1,5 @@<%=- render(OpTurbo::FrameComponent.new(@storage, context: :oauth_client)) do+ render(OpTurbo::FrameComponent.new(id: :storage_oauth_client_section)) dorender(Storages::Admin::Forms::OAuthClientFormComponent.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/storages/automatically_managed_project_folders/edit.html.erbindex 5efe03a9cbf..f23b463f7d5 100644--- a/modules/storages/app/views/storages/admin/storages/automatically_managed_project_folders/edit.html.erb+++ b/modules/storages/app/views/storages/admin/storages/automatically_managed_project_folders/edit.html.erb@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.<% if OpenProject::FeatureDecisions.storage_primer_design_active? %><%=- render(OpTurbo::FrameComponent.new(@storage, context: :automatically_managed_project_folders)) do+ render(OpTurbo::FrameComponent.new(id: :automatically_managed_project_folders_section)) dorender(Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent.new(@storage))end%>diff --git a/modules/storages/app/views/storages/admin/storages/edit_host.html.erb b/modules/storages/app/views/storages/admin/storages/edit_host.html.erbindex 26ed8b6a282..84ca93a5740 100644--- a/modules/storages/app/views/storages/admin/storages/edit_host.html.erb+++ b/modules/storages/app/views/storages/admin/storages/edit_host.html.erb@@ -1,5 +1,5 @@<%=- render(OpTurbo::FrameComponent.new(@storage, context: :general_info)) do+ render(OpTurbo::FrameComponent.new(id: :storage_general_info_section)) dorender(Storages::Admin::Forms::GeneralInfoFormComponent.new(@storage,diff --git a/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb b/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erbindex a01eb5eeac3..2d2513fabe9 100644--- a/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb+++ b/modules/storages/app/views/storages/admin/storages/new_oauth_client.html.erb@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.<% if OpenProject::FeatureDecisions.storage_primer_design_active? %><%=- render(OpTurbo::FrameComponent.new(@storage, context: :oauth_client)) do+ render(OpTurbo::FrameComponent.new(id: :storage_oauth_client_section)) dorender(Storages::Admin::Forms::OAuthClientFormComponent.new(oauth_client: @oauth_client, storage: @storage))end%>diff --git a/modules/storages/app/views/storages/admin/storages/select_provider.turbo_stream.erb b/modules/storages/app/views/storages/admin/storages/select_provider.turbo_stream.erbindex 19efd61e332..c55a5080886 100644--- a/modules/storages/app/views/storages/admin/storages/select_provider.turbo_stream.erb+++ b/modules/storages/app/views/storages/admin/storages/select_provider.turbo_stream.erb@@ -28,5 +28,7 @@ See COPYRIGHT and LICENSE files for more details.++#%><%= turbo_stream.update :select_storage_provider do %>- <%= render(Storages::Admin::StorageViewComponent.new(@storage)) %>+ <%=+ render(Storages::Admin::StorageViewComponent.new(@storage))+ %><% end %>diff --git a/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb b/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erbindex 3d546019ee1..c7dcc2ba3a7 100644--- a/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb+++ b/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb@@ -1,5 +1,5 @@<% if OpenProject::FeatureDecisions.storage_primer_design_active? %>- <%= render(OpTurbo::FrameComponent.new(@storage, context: :openproject_oauth)) do %>+ <%= render(OpTurbo::FrameComponent.new(id: :storage_openproject_oauth_section)) do %><%= render(Storages::Admin::OAuthApplicationCredentialsCopyComponent.new(oauth_application: @oauth_application, storage: @storage)) %><% end %><% else %>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.erbnew file mode 100644index 00000000000..787e4cea8d4--- /dev/null+++ b/modules/storages/app/views/storages/admin/storages/show_oauth_application.turbo_stream.erb@@ -0,0 +1,56 @@+<%#-- copyright+OpenProject is an open source project management software.+Copyright (C) 2012-2023 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::OAuthApplicationInfoComponent.new(+ oauth_application: @oauth_application,+ storage: @storage,+ )+ )+ %>+<% end %>++<% if @storage.provider_type_nextcloud? %>+ <%= 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/config/routes.rb b/modules/storages/config/routes.rbindex ac2a2e71d66..0909bd8e9a6 100644--- a/modules/storages/config/routes.rb+++ b/modules/storages/config/routes.rb@@ -39,8 +39,9 @@ OpenProject::Application.routes.draw dopost :select_provider, on: :collectionmember do- get '/edit_host' => '/storages/admin/storages#edit_host'- delete '/replace_oauth_application' => '/storages/admin/storages#replace_oauth_application'+ get :show_oauth_application+ get :edit_host+ delete :replace_oauth_applicationendendend