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

minor cleanup

Jonas Jabari358e77eeb731
diff --git a/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb b/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb
index dbc4685be72..8c474e943ea 100644
--- a/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb
+++ b/app/components/settings/project_custom_field_sections/custom_field_row_component.html.erb
@@ -5,9 +5,14 @@
content_container.with_column(mr: 2) do
render(Primer::OpenProject::DragHandle.new(classes: 'handle'))
end
- content_container.with_column do
+ content_container.with_column(mr: 2) do
render(Primer::Beta::Text.new(font_weight: :bold)) do
- "#{@project_custom_field.position_in_custom_field_section} #{@project_custom_field.name}"
+ @project_custom_field.name
+ end
+ end
+ content_container.with_column do
+ render(Primer::Beta::Text.new(font_size: :small, color: :subtle)) do
+ @project_custom_field.field_format.capitalize
end
end
end
diff --git a/app/components/settings/project_attributes/section/dialog_body_form_component.html.erb b/app/components/settings/project_custom_field_sections/dialog_body_form_component.html.erb
similarity index 100%
rename from app/components/settings/project_attributes/section/dialog_body_form_component.html.erb
rename to app/components/settings/project_custom_field_sections/dialog_body_form_component.html.erb
diff --git a/app/components/settings/project_attributes/section/dialog_body_form_component.rb b/app/components/settings/project_custom_field_sections/dialog_body_form_component.rb
similarity index 58%
rename from app/components/settings/project_attributes/section/dialog_body_form_component.rb
rename to app/components/settings/project_custom_field_sections/dialog_body_form_component.rb
index b358be6d90d..1e4243574b4 100644
--- a/app/components/settings/project_attributes/section/dialog_body_form_component.rb
+++ b/app/components/settings/project_custom_field_sections/dialog_body_form_component.rb
@@ -27,32 +27,30 @@
#++
module Settings
- module ProjectAttributes
- module Section
- class DialogBodyFormComponent < ApplicationComponent
- include ApplicationHelper
- include OpPrimer::ComponentHelpers
- include OpTurbo::Streamable
+ module ProjectCustomFieldSections
+ class DialogBodyFormComponent < ApplicationComponent
+ include ApplicationHelper
+ include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
- def initialize(project_custom_field_section: ProjectCustomFieldSection.new)
- super
+ def initialize(project_custom_field_section: ProjectCustomFieldSection.new)
+ super
- @project_custom_field_section = project_custom_field_section
- end
+ @project_custom_field_section = project_custom_field_section
+ end
- private
+ private
- def wrapper_uniq_by
- @project_custom_field_section.id
- end
+ def wrapper_uniq_by
+ @project_custom_field_section.id
+ end
- def form_config
- {
- model: @project_custom_field_section,
- method: @project_custom_field_section.persisted? ? :put : :post,
- url: @project_custom_field_section.persisted? ? admin_settings_project_custom_field_section_path(@project_custom_field_section) : admin_settings_project_custom_field_sections_path
- }
- end
+ def form_config
+ {
+ model: @project_custom_field_section,
+ method: @project_custom_field_section.persisted? ? :put : :post,
+ url: @project_custom_field_section.persisted? ? admin_settings_project_custom_field_section_path(@project_custom_field_section) : admin_settings_project_custom_field_sections_path
+ }
end
end
end
diff --git a/app/components/settings/project_custom_field_sections/show_component.html.erb b/app/components/settings/project_custom_field_sections/show_component.html.erb
index fca775745c3..e87bee27605 100644
--- a/app/components/settings/project_custom_field_sections/show_component.html.erb
+++ b/app/components/settings/project_custom_field_sections/show_component.html.erb
@@ -1,8 +1,6 @@
<%=
component_wrapper do
- render(Primer::Beta::BorderBox.new(mt: 3, data: {
- id: @project_custom_field_section.id, 'allowed-drop-type': 'custom-field'
- }.merge(drag_and_drop_target_config))) do |component|
+ render(Primer::Beta::BorderBox.new(mt: 3, data: drag_and_drop_target_config)) do |component|
component.with_header(font_weight: :bold) do
flex_layout(justify_content: :space_between, align_items: :center) do |section_header_container|
section_header_container.with_column(flex_layout: true, align_items: :center) do |content_container|
@@ -11,7 +9,7 @@
end
content_container.with_column do
render(Primer::Beta::Text.new(font_weight: :bold)) do
- "#{@project_custom_field_section.position} #{@project_custom_field_section.name}"
+ @project_custom_field_section.name
end
end
end
@@ -33,7 +31,7 @@
id: "project-custom-field-section-dialog#{@project_custom_field_section.id}", title: t('settings.project_attributes.label_new_section'),
size: :medium_portrait
)) do |dialog|
- render(Settings::ProjectAttributes::Section::DialogBodyFormComponent.new(project_custom_field_section: @project_custom_field_section))
+ render(Settings::ProjectCustomFieldSections::DialogBodyFormComponent.new(project_custom_field_section: @project_custom_field_section))
end
end
end
diff --git a/app/components/settings/project_custom_fields/header_component.html.erb b/app/components/settings/project_custom_fields/header_component.html.erb
index 8a590d5411f..5bbe2bdcf67 100644
--- a/app/components/settings/project_custom_fields/header_component.html.erb
+++ b/app/components/settings/project_custom_fields/header_component.html.erb
@@ -32,7 +32,7 @@
button.with_leading_visual_icon(icon: :plus)
t('settings.project_attributes.label_new_section')
end
- render(Settings::ProjectAttributes::Section::DialogBodyFormComponent.new())
+ render(Settings::ProjectCustomFieldSections::DialogBodyFormComponent.new())
end
end
diff --git a/app/controllers/concerns/admin/settings/project_custom_fields/component_streams.rb b/app/controllers/concerns/admin/settings/project_custom_fields/component_streams.rb
index e393a6a9162..a9b35de02cf 100644
--- a/app/controllers/concerns/admin/settings/project_custom_fields/component_streams.rb
+++ b/app/controllers/concerns/admin/settings/project_custom_fields/component_streams.rb
@@ -49,7 +49,7 @@ module Admin
def update_section_dialog_body_form_via_turbo_stream(project_custom_field_section:)
update_via_turbo_stream(
- component: ::Settings::ProjectAttributes::Section::DialogBodyFormComponent.new(
+ component: ::Settings::ProjectCustomFieldSections::DialogBodyFormComponent.new(
project_custom_field_section:
)
)