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

[#64347] fix unused code and wrong edit path

Tobias Dillmann06ebbd09cc13
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 58673930538..028629bf860 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
@@ -8,7 +8,7 @@
content_container.with_column(mr: 2) do
render(
Primer::Beta::Link.new(
- href: edit_path,
+ href: edit_admin_settings_project_custom_field_path(@project_custom_field),
underline: false,
font_weight: :bold,
data: { turbo: "false" }
diff --git a/app/components/settings/project_custom_field_sections/custom_field_row_component.rb b/app/components/settings/project_custom_field_sections/custom_field_row_component.rb
index 4195f72e4ba..74cade38187 100644
--- a/app/components/settings/project_custom_field_sections/custom_field_row_component.rb
+++ b/app/components/settings/project_custom_field_sections/custom_field_row_component.rb
@@ -42,13 +42,9 @@ module Settings
private
- def edit_path
- edit_admin_settings_project_custom_field_path(@project_custom_field)
- end
-
def edit_action_item(menu)
menu.with_item(label: t("label_edit"),
- href: edit_path,
+ href: edit_admin_settings_project_custom_field_path(@project_custom_field),
data: { turbo: "false", test_selector: "project-custom-field-edit" }) do |item|
item.with_leading_visual_icon(icon: :pencil)
end
diff --git a/app/controllers/concerns/custom_fields/shared_actions.rb b/app/controllers/concerns/custom_fields/shared_actions.rb
index cedc24046d9..d02ad148891 100644
--- a/app/controllers/concerns/custom_fields/shared_actions.rb
+++ b/app/controllers/concerns/custom_fields/shared_actions.rb
@@ -41,7 +41,7 @@ module CustomFields
def edit_path(custom_field, params = {})
if custom_field.type == "ProjectCustomField"
- admin_settings_project_custom_fields_path(**params)
+ admin_settings_project_custom_field_path(**params)
else
edit_custom_field_path(**params)
end