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#55966]: add project folder mode form
Kabiru Mwenjac22a6f55123a
diff --git a/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.html.erb b/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.html.erbindex 58a556c658e..f3d35aef095 100644--- a/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.html.erb+++ b/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.html.erb@@ -39,10 +39,14 @@ See COPYRIGHT and LICENSE files for more details.concat(render(Primer::Alpha::Dialog::Body.new(id: dialog_body_id,test_selector: dialog_body_id,- aria: { label: title },- style: "min-height: 300px"+ aria: { label: title })) do- render(Storages::Admin::Storages::AddProjectsForm.new(form, project_storage: @project_storage))+ render(+ Primer::Forms::FormList.new(+ Storages::Admin::Storages::AddProjectsAutocompleterForm.new(form, project_storage:),+ Storages::Admin::ProjectStorages::ProjectFolderModeForm.new(form, project_storage:)+ )+ )end)concat(render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) dodiff --git a/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.rb b/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.rbindex 3c9b08e4ec5..fe74c8e47cc 100644--- a/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.rb+++ b/modules/storages/app/components/storages/admin/storages/add_projects_form_modal_component.rb@@ -40,6 +40,8 @@ module Storagesprivate+ attr_reader :project_storage, :storage+def dialog_id = Storages::AddProjectsModalComponent::DIALOG_IDdef dialog_body_id = Storages::AddProjectsModalComponent::DIALOG_BODY_IDdiff --git a/modules/storages/app/forms/storages/admin/project_storages/project_folder_mode_form.rb b/modules/storages/app/forms/storages/admin/project_storages/project_folder_mode_form.rbnew file mode 100644index 00000000000..b7bb3eb5a01--- /dev/null+++ b/modules/storages/app/forms/storages/admin/project_storages/project_folder_mode_form.rb@@ -0,0 +1,59 @@+#-- 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.+#++++module Storages+ module Admin+ module ProjectStorages+ class ProjectFolderModeForm < ApplicationForm+ form do |radio_form|+ radio_form.radio_button_group(+ name: :project_folder_mode,+ label: I18n.t(:"storages.label_project_folder"),+ caption: I18n.t(:"storages.help_texts.project_folder")+ ) do |radio_group|+ radio_group.radio_button(value: "inactive", label: I18n.t(:"storages.label_no_specific_folder"),+ caption: I18n.t(:"storages.instructions.no_specific_folder"))++ if @project_storage.automatic_management_possible?+ radio_group.radio_button(value: "automatic", label: I18n.t(:"storages.label_automatic_folder"),+ caption: I18n.t(:"storages.instructions.automatic_folder"))+ end++ radio_group.radio_button(value: "manual", label: I18n.t(:"storages.label_existing_manual_folder"),+ caption: I18n.t(:"storages.instructions.existing_manual_folder"))+ end+ end++ def initialize(project_storage:)+ super()+ @project_storage = project_storage+ end+ end+ end+ end+enddiff --git a/modules/storages/app/forms/storages/admin/storages/add_projects_form.rb b/modules/storages/app/forms/storages/admin/storages/add_projects_autocompleter_form.rbsimilarity index 96%rename from modules/storages/app/forms/storages/admin/storages/add_projects_form.rbrename to modules/storages/app/forms/storages/admin/storages/add_projects_autocompleter_form.rbindex 389b498865c..8bd0ab3a9a5 100644--- a/modules/storages/app/forms/storages/admin/storages/add_projects_form.rb+++ b/modules/storages/app/forms/storages/admin/storages/add_projects_autocompleter_form.rb@@ -29,9 +29,7 @@module Storagesmodule Adminmodule Storages- class AddProjectsForm < ApplicationForm- include OpPrimer::ComponentHelpers-+ class AddProjectsAutocompleterForm < ApplicationFormform do |form|form.group(layout: :vertical) do |group|group.project_autocompleter(