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

[chore] add container for admin settings form

Eric Schubert4a33a167a05a
diff --git a/app/components/_index.sass b/app/components/_index.sass
index 802d5ae8e6b..b943ce7ea8b 100644
--- a/app/components/_index.sass
+++ b/app/components/_index.sass
@@ -1,3 +1,4 @@
+@import "admin_settings_form_component"
@import "work_packages/activities_tab/index_component"
@import "work_packages/activities_tab/journals/new_component"
@import "work_packages/activities_tab/journals/index_component"
diff --git a/app/components/admin_settings_form_component.rb b/app/components/admin_settings_form_component.rb
new file mode 100644
index 00000000000..cd77878032c
--- /dev/null
+++ b/app/components/admin_settings_form_component.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+#-- 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.
+#++
+
+class AdminSettingsFormComponent < ApplicationComponent
+ def render_in(view_context, &)
+ tag.div(class: "op-admin-settings-form-wrapper") do
+ super
+ end
+ end
+end
diff --git a/app/components/admin_settings_form_component.sass b/app/components/admin_settings_form_component.sass
new file mode 100644
index 00000000000..c310c783ebd
--- /dev/null
+++ b/app/components/admin_settings_form_component.sass
@@ -0,0 +1,3 @@
+.op-admin-settings-form-wrapper
+ max-width: 480px
+ margin: 0 auto 0 0
diff --git a/app/components/work_packages/types/settings_component.rb b/app/components/work_packages/types/settings_component.rb
index 97699f45cf6..039f1fc5be8 100644
--- a/app/components/work_packages/types/settings_component.rb
+++ b/app/components/work_packages/types/settings_component.rb
@@ -30,7 +30,7 @@
module WorkPackages
module Types
- class SettingsComponent < ApplicationComponent
+ class SettingsComponent < AdminSettingsFormComponent
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable
diff --git a/app/components/work_packages/types/subject_configuration_component.rb b/app/components/work_packages/types/subject_configuration_component.rb
index 4df87d4e9b7..142b8877240 100644
--- a/app/components/work_packages/types/subject_configuration_component.rb
+++ b/app/components/work_packages/types/subject_configuration_component.rb
@@ -30,7 +30,7 @@
module WorkPackages
module Types
- class SubjectConfigurationComponent < ApplicationComponent
+ class SubjectConfigurationComponent < AdminSettingsFormComponent
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable
diff --git a/app/forms/work_packages/types/settings_form.rb b/app/forms/work_packages/types/settings_form.rb
index dca2d61dce3..96cb81c4988 100644
--- a/app/forms/work_packages/types/settings_form.rb
+++ b/app/forms/work_packages/types/settings_form.rb
@@ -36,7 +36,6 @@ module WorkPackages
name: :name,
label: label(:name),
placeholder: I18n.t(:label_name),
- input_width: :large,
required: true,
disabled: model.is_standard?
)
@@ -44,16 +43,14 @@ module WorkPackages
settings_form.color_select_list(
name: :color_id,
label: Color.model_name.human,
- caption: I18n.t("types.edit.settings.type_color_text"),
- input_width: :large
+ caption: I18n.t("types.edit.settings.type_color_text")
)
if show_work_flow_copy?
settings_form.select_list(
name: :copy_workflow_from,
label: I18n.t(:label_copy_workflow_from),
- include_blank: true,
- input_width: :large
+ include_blank: true
) do |other_types|
work_package_types.each do |type|
other_types.option(
@@ -68,7 +65,6 @@ module WorkPackages
settings_form.rich_text_area(
name: :description,
label: label(:description),
- input_width: :large,
rich_text_options: { showAttachments: false }
)