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

[#67328] change routes to get better path helpers

Eric Schubert6a6fecdb7565
diff --git a/app/components/admin/custom_fields/hierarchy/item_component.rb b/app/components/admin/custom_fields/hierarchy/item_component.rb
index f759ea50398..0b0e9a84123 100644
--- a/app/components/admin/custom_fields/hierarchy/item_component.rb
+++ b/app/components/admin/custom_fields/hierarchy/item_component.rb
@@ -143,7 +143,7 @@ module Admin
label: I18n.t(:label_change_parent),
tag: :a,
content_arguments: { data: { controller: "async-dialog" } },
- href: change_parent_dialog_custom_field_item_path(custom_field_id: @root.custom_field_id, id: model.id)
+ href: change_parent_custom_field_item_path(custom_field_id: @root.custom_field_id, id: model.id)
) { it.with_leading_visual_icon(icon: "arrow-switch") }
end
@@ -199,7 +199,7 @@ module Admin
menu.with_item(label: I18n.t(:button_delete),
scheme: :danger,
tag: :a,
- href: deletion_dialog_custom_field_item_path(custom_field_id: @root.custom_field_id, id: model.id),
+ href: delete_custom_field_item_path(custom_field_id: @root.custom_field_id, id: model.id),
content_arguments: { data: { controller: "async-dialog" } }) do |item|
item.with_leading_visual_icon(icon: :trash)
end
diff --git a/config/routes.rb b/config/routes.rb
index 451b9b66165..1347fc5b5e5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -208,12 +208,12 @@ Rails.application.routes.draw do
resource :project, controller: "/admin/custom_fields/custom_field_projects", only: :destroy
resources :items, controller: "/admin/custom_fields/hierarchy/items" do
member do
- get :deletion_dialog
- get :change_parent_dialog
+ get :change_parent, action: :change_parent_dialog
+ post :change_parent, action: :change_parent
+ get :delete, action: :deletion_dialog
+ post :move
get :new_child, action: :new
post :new_child, action: :create
- post :move
- post :change_parent
end
end
end