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
Rename NextcloudAudience* components to StorageAudience*
Jan Sandbrink9e8ec5734107
diff --git a/modules/storages/app/common/storages/peripherals/nextcloud_registry.rb b/modules/storages/app/common/storages/peripherals/nextcloud_registry.rbindex 5b82883415c..b03004d6b96 100644--- a/modules/storages/app/common/storages/peripherals/nextcloud_registry.rb+++ b/modules/storages/app/common/storages/peripherals/nextcloud_registry.rb@@ -61,7 +61,7 @@ module Storagesnamespace("forms") doregister(:automatically_managed_folders, ::Storages::Admin::Forms::AutomaticallyManagedProjectFoldersFormComponent)register(:general_information, ::Storages::Admin::Forms::GeneralInfoFormComponent)- register(:storage_audience, ::Storages::Admin::Forms::NextcloudAudienceFormComponent)+ register(:storage_audience, ::Storages::Admin::Forms::StorageAudienceFormComponent)register(:oauth_application, ::Storages::Admin::OAuthApplicationInfoCopyComponent)register(:oauth_client, ::Storages::Admin::Forms::OAuthClientFormComponent)end@@ -70,7 +70,7 @@ module Storagesregister(:automatically_managed_folders, ::Storages::Admin::AutomaticallyManagedProjectFoldersInfoComponent)register(:general_information, ::Storages::Admin::GeneralInfoComponent)- register(:storage_audience, ::Storages::Admin::NextcloudAudienceInfoComponent)+ register(:storage_audience, ::Storages::Admin::StorageAudienceInfoComponent)register(:oauth_application, ::Storages::Admin::OAuthApplicationInfoComponent)register(:oauth_client, ::Storages::Admin::OAuthClientInfoComponent)enddiff --git a/modules/storages/app/components/storages/admin/forms/nextcloud_audience_form_component.html.erb b/modules/storages/app/components/storages/admin/forms/storage_audience_form_component.html.erbsimilarity index 96%rename from modules/storages/app/components/storages/admin/forms/nextcloud_audience_form_component.html.erbrename to modules/storages/app/components/storages/admin/forms/storage_audience_form_component.html.erbindex 45b9345723c..b2d8307d4bf 100644--- a/modules/storages/app/components/storages/admin/forms/nextcloud_audience_form_component.html.erb+++ b/modules/storages/app/components/storages/admin/forms/storage_audience_form_component.html.erb@@ -42,7 +42,7 @@ See COPYRIGHT and LICENSE files for more details.) do |form|flex_layout do |general_info_row|general_info_row.with_row(mb: 3) do- render(Storages::Admin::NextcloudAudienceInputForm.new(form))+ render(Storages::Admin::StorageAudienceInputForm.new(form))endgeneral_info_row.with_row dodiff --git a/modules/storages/app/components/storages/admin/forms/nextcloud_audience_form_component.rb b/modules/storages/app/components/storages/admin/forms/storage_audience_form_component.rbsimilarity index 96%rename from modules/storages/app/components/storages/admin/forms/nextcloud_audience_form_component.rbrename to modules/storages/app/components/storages/admin/forms/storage_audience_form_component.rbindex c4aa2a3be7e..e6c13ef0178 100644--- a/modules/storages/app/components/storages/admin/forms/nextcloud_audience_form_component.rb+++ b/modules/storages/app/components/storages/admin/forms/storage_audience_form_component.rb@@ -29,7 +29,7 @@#++#module Storages::Admin::Forms- class NextcloudAudienceFormComponent < StorageFormComponent+ class StorageAudienceFormComponent < StorageFormComponentdef self.wrapper_key = :storage_audience_sectionoptions submit_button_disabled: falsediff --git a/modules/storages/app/components/storages/admin/nextcloud_audience_info_component.erb b/modules/storages/app/components/storages/admin/storage_audience_info_component.erbsimilarity index 100%rename from modules/storages/app/components/storages/admin/nextcloud_audience_info_component.erbrename to modules/storages/app/components/storages/admin/storage_audience_info_component.erbdiff --git a/modules/storages/app/components/storages/admin/nextcloud_audience_info_component.rb b/modules/storages/app/components/storages/admin/storage_audience_info_component.rbsimilarity index 96%rename from modules/storages/app/components/storages/admin/nextcloud_audience_info_component.rbrename to modules/storages/app/components/storages/admin/storage_audience_info_component.rbindex 70a49123e33..2571cd4c091 100644--- a/modules/storages/app/components/storages/admin/nextcloud_audience_info_component.rb+++ b/modules/storages/app/components/storages/admin/storage_audience_info_component.rb@@ -30,7 +30,7 @@module Storagesmodule Admin- class NextcloudAudienceInfoComponent < StorageInfoComponent+ class StorageAudienceInfoComponent < StorageInfoComponentdef self.wrapper_key = :storage_audience_sectiondef audience_summarydiff --git a/modules/storages/app/controllers/storages/admin/storages_controller.rb b/modules/storages/app/controllers/storages/admin/storages_controller.rbindex c23db058f91..1c4069f76f9 100644--- a/modules/storages/app/controllers/storages/admin/storages_controller.rb+++ b/modules/storages/app/controllers/storages/admin/storages_controller.rb@@ -124,7 +124,7 @@ class Storages::Admin::StoragesController < ApplicationControllerenddef edit_storage_audience- update_via_turbo_stream(component: Storages::Admin::Forms::NextcloudAudienceFormComponent.new(@storage))+ update_via_turbo_stream(component: Storages::Admin::Forms::StorageAudienceFormComponent.new(@storage))respond_with_turbo_streamsenddiff --git a/modules/storages/app/forms/storages/admin/nextcloud_audience_input_form.rb b/modules/storages/app/forms/storages/admin/storage_audience_input_form.rbsimilarity index 98%rename from modules/storages/app/forms/storages/admin/nextcloud_audience_input_form.rbrename to modules/storages/app/forms/storages/admin/storage_audience_input_form.rbindex 3823c2fc7fc..73e9555e71b 100644--- a/modules/storages/app/forms/storages/admin/nextcloud_audience_input_form.rb+++ b/modules/storages/app/forms/storages/admin/storage_audience_input_form.rb@@ -29,7 +29,7 @@#++module Storages::Admin- class NextcloudAudienceInputForm < ApplicationForm+ class StorageAudienceInputForm < ApplicationFormform do |storage_form|storage_form.radio_button_group(name: :audience_configuration) do |group|group.radio_button(diff --git a/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rb b/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rbnew file mode 100644index 00000000000..72e39108781--- /dev/null+++ b/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rb@@ -0,0 +1,60 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 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.+#+++#+require "spec_helper"+require_module_spec_helper++RSpec.describe Storages::Admin::OAuthClientInfoComponent, type: :component do # rubocop:disable RSpec/SpecFilePathFormat+ describe "#edit_icon_button_options" do+ context "with oauth client configured" do+ it "returns false, does not render view component" do+ storage = build_stubbed(:nextcloud_storage,+ oauth_client: build_stubbed(:oauth_client))+ component = described_class.new(storage)+ expect(component.edit_icon_button_options)+ .to include(icon: :sync,+ data: { turbo_confirm:+ "This action will reset the current OAuth credentials. After confirming you will " \+ "have to enter new credentials from the storage provider and all users will have " \+ "to authorize against Nextcloud again. Are you sure you want to proceed?",+ turbo_stream: true })+ end+ end++ context "without oauth client" do+ it "returns true, renders view component" do+ storage = build_stubbed(:nextcloud_storage)+ component = described_class.new(storage)++ edit_icon_button_data_options = component.edit_icon_button_options+ expect(edit_icon_button_data_options).to include(icon: :pencil, data: { turbo_stream: true })+ expect(edit_icon_button_data_options[:data]).not_to include(:confirm)+ end+ end+ end+end