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

merge dev into branch

Behrokh Satarnejad228485c54168
diff --cc app/components/work_package_relations_tab/index_component.html.erb
index afd0a4f0f49,1fecfe2f24a..0e461ca6f65
--- a/app/components/work_package_relations_tab/index_component.html.erb
+++ b/app/components/work_package_relations_tab/index_component.html.erb
@@@ -56,38 -52,29 +56,38 @@@
flex.with_row(mb: 4) do
render_relation_group(
- title: t("#{base_key}_plural").capitalize,
+ title: t("#{base_key}_plural").upcase_first,
- relation_type:,
- items: relations_of_type
- ) do |relation|
- render(WorkPackageRelationsTab::RelationComponent.new(work_package:,
- relation:))
+ relation_type: relation_group.type,
+ items: all_relations
+ ) do |relation, visibility|
+ # Render each relation with its visibility
+ render(WorkPackageRelationsTab::RelationComponent.new(
+ work_package: work_package,
+ relation: relation,
+ visibility: visibility
+ ))
end
end
end
# Children
- if children.any?
+ if any_children?
base_key = "#{key_namespace}.label_child"
+ # Combine visible and invisible children into a single list
+ all_children = visible_children.map { |r| [r, :visible] } +
+ invisible_children.map { |r| [r, :ghost] }
+
flex.with_row do
render_relation_group(
- title: t("#{base_key}_plural").capitalize,
+ title: t("#{base_key}_plural").upcase_first,
relation_type: :children,
- items: children
- ) do |child|
+ items: all_children
+ ) do |child, visibility|
render(WorkPackageRelationsTab::RelationComponent.new(work_package:,
relation: nil,
- child:))
+ child:,
+ visibility: visibility))
end
end
end
diff --cc app/components/work_package_relations_tab/relation_component.html.erb
index 6f02b0912f8,9f6f59e9d4e..795bb7d0d40
--- a/app/components/work_package_relations_tab/relation_component.html.erb
+++ b/app/components/work_package_relations_tab/relation_component.html.erb
@@@ -1,45 -1,42 +1,45 @@@
<%=
-flex_layout do |flex|
- flex.with_row(flex_layout: true, justify_content: :space_between, align_items: :center) do |row|
- row.with_column do
- render(WorkPackages::InfoLineComponent.new(work_package: related_work_package))
- end
+ flex_layout do |flex|
+ if visible?
+ flex.with_row(flex_layout: true, justify_content: :space_between, align_items: :center) do |row|
+ row.with_column do
+ render(WorkPackages::InfoLineComponent.new(work_package: related_work_package))
+ end
- if should_render_action_menu?
- row.with_column do
- render(Primer::Alpha::ActionMenu.new(test_selector: action_menu_test_selector)) do |menu|
- menu.with_show_button(icon: "kebab-horizontal",
- "aria-label": I18n.t(:label_relation_actions),
- scheme: :invisible,
- ml: 2)
+ if should_render_action_menu?
+ row.with_column do
+ render(Primer::Alpha::ActionMenu.new(test_selector: action_menu_test_selector)) do |menu|
+ menu.with_show_button(icon: "kebab-horizontal",
+ "aria-label": I18n.t(:label_relation_actions),
+ scheme: :invisible,
+ ml: 2)
- if should_render_edit_option?
- menu.with_item(label: I18n.t(:label_relation_edit),
- href: edit_path,
- test_selector: edit_button_test_selector,
- content_arguments: {
- data: { turbo_stream: true }
- }) do |item|
- item.with_leading_visual_icon(icon: :pencil)
- end
- end
+ if should_render_edit_option?
- menu.with_item(label: "Edit relation",
++ menu.with_item(label: I18n.t(:label_relation_edit),
+ href: edit_path,
+ test_selector: edit_button_test_selector,
+ content_arguments: {
+ data: { turbo_stream: true }
+ }) do |item|
+ item.with_leading_visual_icon(icon: :pencil)
+ end
+ end
- menu.with_item(label: "Delete relation",
- menu.with_item(label: I18n.t(:label_relation_delete),
- scheme: :danger,
- href: destroy_path,
- form_arguments: {
- method: :delete,
- data: {
- confirm: t("text_are_you_sure"),
- turbo_stream: true,
- update_work_package: true
- }
- },
- test_selector: delete_button_test_selector) do |item|
- item.with_leading_visual_icon(icon: :trash)
++ menu.with_item(label: I18n.t(:label_relation_delete),
+ scheme: :danger,
+ href: destroy_path,
+ form_arguments: {
+ method: :delete,
+ data: {
+ confirm: t("text_are_you_sure"),
+ turbo_stream: true,
+ update_work_package: true
+ }
+ },
+ test_selector: delete_button_test_selector) do |item|
+ item.with_leading_visual_icon(icon: :trash)
+ end
+ end
end
end
end