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

Rename WorkPackageChildrenController as WorkPackageChildrenRelationsController

Christophe Bliarddf060cdaaebb
diff --git a/app/components/work_package_relations_tab/add_work_package_child_form_component.rb b/app/components/work_package_relations_tab/add_work_package_child_form_component.rb
index f9f4d6863b1..8ad85664a9c 100644
--- a/app/components/work_package_relations_tab/add_work_package_child_form_component.rb
+++ b/app/components/work_package_relations_tab/add_work_package_child_form_component.rb
@@ -47,6 +47,6 @@ class WorkPackageRelationsTab::AddWorkPackageChildFormComponent < ApplicationCom
def submit_url_options
{ method: :post,
- url: work_package_children_path(@work_package) }
+ url: work_package_children_relations_path(@work_package) }
end
end
diff --git a/app/components/work_package_relations_tab/index_component.html.erb b/app/components/work_package_relations_tab/index_component.html.erb
index e78e21510bb..c12694bc30e 100644
--- a/app/components/work_package_relations_tab/index_component.html.erb
+++ b/app/components/work_package_relations_tab/index_component.html.erb
@@ -37,7 +37,7 @@
if should_render_add_child?
menu.with_item(
label: t("#{I18N_NAMESPACE}.relations.label_child_singular").capitalize,
- href: new_work_package_child_path(@work_package),
+ href: new_work_package_children_relation_path(@work_package),
test_selector: new_button_test_selector(relation_type: :child),
content_arguments: {
data: { turbo_stream: true }
diff --git a/app/components/work_package_relations_tab/relation_component.rb b/app/components/work_package_relations_tab/relation_component.rb
index efed86f893f..c3d210607bc 100644
--- a/app/components/work_package_relations_tab/relation_component.rb
+++ b/app/components/work_package_relations_tab/relation_component.rb
@@ -85,7 +85,7 @@ class WorkPackageRelationsTab::RelationComponent < ApplicationComponent
def destroy_path
if parent_child_relationship?
- work_package_child_path(@work_package, @child)
+ work_package_children_relation_path(@work_package, @child)
else
work_package_relation_path(@work_package, @relation)
end
diff --git a/app/controllers/work_package_children_controller.rb b/app/controllers/work_package_children_relations_controller.rb
similarity index 97%
rename from app/controllers/work_package_children_controller.rb
rename to app/controllers/work_package_children_relations_controller.rb
index d4eac1a084f..2f1fb1574e5 100644
--- a/app/controllers/work_package_children_controller.rb
+++ b/app/controllers/work_package_children_relations_controller.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class WorkPackageChildrenController < ApplicationController
+class WorkPackageChildrenRelationsController < ApplicationController
include OpTurbo::ComponentStream
include OpTurbo::DialogStreamHelper
diff --git a/config/initializers/permissions.rb b/config/initializers/permissions.rb
index 87f571f46a9..762f8dc862f 100644
--- a/config/initializers/permissions.rb
+++ b/config/initializers/permissions.rb
@@ -326,7 +326,7 @@ Rails.application.reloader.to_prepare do
wpt.permission :manage_subtasks,
{
- work_package_children: %i[new create destroy]
+ work_package_children_relations: %i[new create destroy]
},
permissible_on: :project,
dependencies: :view_work_packages
diff --git a/config/routes.rb b/config/routes.rb
index de4c3eeb1cf..397a8e3180d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -598,7 +598,7 @@ Rails.application.routes.draw do
end
end
- resources :children, only: %i[new create destroy], controller: "work_package_children"
+ resources :children_relations, only: %i[new create destroy], controller: "work_package_children_relations"
resource :progress, only: %i[new edit update], controller: "work_packages/progress"
collection do
diff --git a/spec/controllers/work_package_children_controller_spec.rb b/spec/controllers/work_package_children_relations_controller_spec.rb
similarity index 98%
rename from spec/controllers/work_package_children_controller_spec.rb
rename to spec/controllers/work_package_children_relations_controller_spec.rb
index 0f71b58d3b5..e4e0388beea 100644
--- a/spec/controllers/work_package_children_controller_spec.rb
+++ b/spec/controllers/work_package_children_relations_controller_spec.rb
@@ -30,7 +30,7 @@
require "spec_helper"
-RSpec.describe WorkPackageChildrenController do
+RSpec.describe WorkPackageChildrenRelationsController do
shared_let(:user) { create(:admin) }
shared_let(:task_type) { create(:type_task) }
shared_let(:milestone_type) { create(:type_milestone) }