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

[62510] Change text of child items in relations tab menu

Christophe Bliard4ab8e1155dd1
diff --git a/app/components/work_package_relations_tab/index_component.rb b/app/components/work_package_relations_tab/index_component.rb
index 2187bf67755..0eddf687529 100644
--- a/app/components/work_package_relations_tab/index_component.rb
+++ b/app/components/work_package_relations_tab/index_component.rb
@@ -117,7 +117,7 @@ class WorkPackageRelationsTab::IndexComponent < ApplicationComponent
end
menu.with_item(
- label: t("work_package_relations_tab.relations.existing_child"),
+ label: t("work_package_relations_tab.relations.child"),
href: new_work_package_children_relation_path(work_package),
content_arguments: {
data: { turbo_stream: true }
diff --git a/config/locales/en.yml b/config/locales/en.yml
index bdb051f8c84..41cc20610f8 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -832,9 +832,9 @@ en:
follows_description: "The related work package necessarily needs to finish before this one can start"
label_child_singular: "child"
label_child_plural: "children"
- new_child: "New child"
+ new_child: "Create new child"
new_child_text: "Creates a related work package as a sub-item of the current (parent) work package"
- existing_child: "Existing child"
+ child: "Child"
child_description: "Makes the related work package a sub-item of the current (parent) work package"
label_closest: "Closest"
label_blocks_singular: "blocks"
diff --git a/docs/user-guide/work-packages/work-package-relations-hierarchies/README.md b/docs/user-guide/work-packages/work-package-relations-hierarchies/README.md
index a64754ee438..a9feab3ad5c 100644
--- a/docs/user-guide/work-packages/work-package-relations-hierarchies/README.md
+++ b/docs/user-guide/work-packages/work-package-relations-hierarchies/README.md
@@ -37,9 +37,9 @@ Work package relations indicate that work packages address a similar topic or cr
You can select one of the following relations:
-- **New child** - This option lets you create a new package and automatically adds it as a child to the current (parent) work package.
+- **Create new child** - This option lets you create a new package and automatically adds it as a child to the current (parent) work package.
-- **Existing child** - This option allows you to add an existing work package as a child to the current (parent) work package.
+- **Child** - This option allows you to add an existing work package as a child to the current (parent) work package.
- **Related to** - This option adds a link from the work package A to work package B, so that project members can immediately see the connection, even if the work packages are not members of the same hierarchy.
@@ -115,7 +115,7 @@ There are **four ways to add or create a child work package**:
### Add a child in the *Relations* tab in a work package's details view
-Open a work package and select the tab *Relations*. Here you can click on *+ Relation* button, and select either *New child* or *Existing child* option to add a new or an existing work package as a child to the current one.
+Open a work package and select the tab *Relations*. Here you can click on *+ Relation* button, and select either *Create new child* or *Child* option to add a new or an existing work package as a child to the current one.
![Add a child to a work package in OpenProject](openproject_user_guide_wp_add_child.png)
diff --git a/spec/features/work_packages/details/relations/hierarchy_milestone_spec.rb b/spec/features/work_packages/details/relations/hierarchy_milestone_spec.rb
index 5b51a86be25..c84056480f6 100644
--- a/spec/features/work_packages/details/relations/hierarchy_milestone_spec.rb
+++ b/spec/features/work_packages/details/relations/hierarchy_milestone_spec.rb
@@ -49,15 +49,15 @@ RSpec.describe "work package hierarchies for milestones", :js do
loading_indicator_saveguard
end
- it "does not provide links to add children or existing children (Regression #28745 and #60512)" do
+ it "does not provide links to create new child or add existing work package as child (Regression #28745 and #60512)" do
# A work package has a menu entry to link or create a child
visit_relations_tab_for(task_work_package)
- relations.expect_new_relation_type("New child")
- relations.expect_new_relation_type("Existing child")
+ relations.expect_new_relation_type("Create new child")
+ relations.expect_new_relation_type("Child")
# A milestone work package does NOT have a menu entry to link or create a child
visit_relations_tab_for(milestone_work_package)
- relations.expect_no_new_relation_type("New child")
- relations.expect_no_new_relation_type("Existing child")
+ relations.expect_no_new_relation_type("Create new child")
+ relations.expect_no_new_relation_type("Child")
end
end
diff --git a/spec/features/work_packages/details/relations/primerized_relations_spec.rb b/spec/features/work_packages/details/relations/primerized_relations_spec.rb
index d6457ae85a5..5e640f7d860 100644
--- a/spec/features/work_packages/details/relations/primerized_relations_spec.rb
+++ b/spec/features/work_packages/details/relations/primerized_relations_spec.rb
@@ -405,7 +405,7 @@ RSpec.describe "Primerized work package relations tab",
end
it "doesn't autocomplete parent, children, and WP itself" do
- relations_tab.select_relation_type "Existing child"
+ relations_tab.select_relation_type "Child"
wait_for_reload
diff --git a/spec/features/work_packages/tabs/relations_children_spec.rb b/spec/features/work_packages/tabs/relations_children_spec.rb
index 9794de839a0..28128971dcb 100644
--- a/spec/features/work_packages/tabs/relations_children_spec.rb
+++ b/spec/features/work_packages/tabs/relations_children_spec.rb
@@ -37,10 +37,10 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
it "can add a new child" do
wp_page.visit_tab!("relations")
relations_tab.expect_add_relation_button
- relations_tab.expect_new_relation_type("New child")
- relations_tab.expect_new_relation_type("Existing child")
+ relations_tab.expect_new_relation_type("Create new child")
+ relations_tab.expect_new_relation_type("Child")
- relations_tab.select_relation_type "New child"
+ relations_tab.select_relation_type "Create new child"
create_dialog.select_type "Task"
create_dialog.set_subject "Hello there"
@@ -70,10 +70,10 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
it "can render the page correctly after creation (regression #60629)" do
wp_split_page.visit_tab!("relations")
relations_tab.expect_add_relation_button
- relations_tab.expect_new_relation_type("New child")
- relations_tab.expect_new_relation_type("Existing child")
+ relations_tab.expect_new_relation_type("Create new child")
+ relations_tab.expect_new_relation_type("Child")
- relations_tab.select_relation_type "New child"
+ relations_tab.select_relation_type "Create new child"
create_dialog.select_type "Risk"
create_dialog.set_subject "Hello there"
@@ -114,8 +114,8 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
wp_page.visit_tab!("relations")
relations_tab.expect_add_relation_button
relations_tab.expect_new_relation_type("Related to")
- relations_tab.expect_no_new_relation_type("Existing child")
- relations_tab.expect_no_new_relation_type("New child")
+ relations_tab.expect_no_new_relation_type("Child")
+ relations_tab.expect_no_new_relation_type("Create new child")
end
end
@@ -123,7 +123,7 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
with_settings: { work_package_done_ratio: "status" } do
it "can add a new child" do
wp_page.visit_tab!("relations")
- relations_tab.select_relation_type "New child"
+ relations_tab.select_relation_type "Create new child"
create_dialog.select_type "Task"
create_dialog.set_subject "Hello there"
@@ -155,11 +155,11 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
create(:user, member_with_permissions: { project => %i[view_work_packages manage_subtasks] })
end
- it "shows an action to add 'Existing child', but not to add 'New child'" do
+ it "shows an action to add 'Child', but not to 'Create new child'" do
wp_page.visit_tab!("relations")
relations_tab.expect_add_relation_button
- relations_tab.expect_new_relation_type("Existing child")
- relations_tab.expect_no_new_relation_type("New child")
+ relations_tab.expect_new_relation_type("Child")
+ relations_tab.expect_no_new_relation_type("Create new child")
end
end
@@ -182,7 +182,7 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
it "displays a field for each required custom field" do
wp_page.visit_tab!("relations")
- relations_tab.select_relation_type "New child"
+ relations_tab.select_relation_type "Create new child"
all_possible_custom_fields.each do |cf|
create_dialog.in_dialog do
@@ -198,7 +198,7 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
it "focuses the subject input field" do
wp_page.visit_tab!("relations")
- relations_tab.select_relation_type "New child"
+ relations_tab.select_relation_type "Create new child"
create_dialog.expect_subject_field_focused
end
diff --git a/spec/support/components/work_packages/relations.rb b/spec/support/components/work_packages/relations.rb
index 3a5808ad501..c0a2b1681c7 100644
--- a/spec/support/components/work_packages/relations.rb
+++ b/spec/support/components/work_packages/relations.rb
@@ -311,19 +311,6 @@ module Components
find(".wp-relation--parent-remove").click
end
- def open_children_autocompleter
- retry_block do
- next if page.has_selector?(".wp-relations--children .ng-input input")
-
- SeleniumHubWaiter.wait
- page.find_test_selector("op-wp-inline-create-reference",
- text: I18n.t("js.relation_buttons.add_existing_child")).click
-
- # Security check to be sure that the autocompleter has finished loading
- page.find ".wp-relations--children .ng-input input"
- end
- end
-
def children_table
page.find_test_selector("op-relation-group-children")
end
@@ -332,7 +319,7 @@ module Components
SeleniumHubWaiter.wait
retry_block do
- select_relation_type "Existing child"
+ select_relation_type "Child"
end
within "##{WorkPackageRelationsTab::AddWorkPackageChildFormComponent::DIALOG_ID}" do