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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
show invisible children
Behrokh Satarnejad937b52fbb4b0
diff --git a/app/components/work_package_relations_tab/index_component.html.erb b/app/components/work_package_relations_tab/index_component.html.erbindex ad2cddb2127..855f2840999 100644--- a/app/components/work_package_relations_tab/index_component.html.erb+++ b/app/components/work_package_relations_tab/index_component.html.erb@@ -82,19 +82,23 @@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 dorender_relation_group(title: t("#{base_key}_plural").capitalize,relation_type: :children,- items: children- ) do |child|+ items: all_children+ ) do |child, visibility|render(WorkPackageRelationsTab::RelationComponent.new(work_package:,relation: nil,child:,- visibility: :visible))+ visibility: visibility))endendenddiff --git a/app/components/work_package_relations_tab/index_component.rb b/app/components/work_package_relations_tab/index_component.rbindex 6a3b37d6bd3..5a053a75d2f 100644--- a/app/components/work_package_relations_tab/index_component.rb+++ b/app/components/work_package_relations_tab/index_component.rb@@ -18,10 +18,11 @@ class WorkPackageRelationsTab::IndexComponent < ApplicationComponentattr_reader :relations_mediator, :relation_to_scroll_todelegate :work_package,- :visible_relations,- :children,+ :visible_children,+ :invisible_children,:directionally_aware_grouped_relations,:any_relations?,+ :any_children?,to: :relations_mediator# Initialize the component with required data#diff --git a/app/components/work_package_relations_tab/relations_mediator.rb b/app/components/work_package_relations_tab/relations_mediator.rbindex d8032b2d959..54924791802 100644--- a/app/components/work_package_relations_tab/relations_mediator.rb+++ b/app/components/work_package_relations_tab/relations_mediator.rb@@ -41,14 +41,18 @@ class WorkPackageRelationsTab::RelationsMediator@visible_relations ||= work_package.relations.includes(:to, :from).visibleend- def children- @children ||= work_package.children.visible+ def visible_children+ @visible_children ||= work_package.children.visibleenddef invisible_relations@invisible_relations = work_package.relations.includes(:to, :from).where.not(id: @visible_relations.select(:id))end+ def invisible_children+ @invisible_children ||= work_package.children.where.not(id: @visible_children.select(:id))+ end+def directionally_aware_grouped_relations# Collect all unique relation typesall_relation_types = collect_all_relation_types@@ -67,6 +71,10 @@ class WorkPackageRelationsTab::RelationsMediatorvisible_relations.any? || invisible_relations.any? || children.any?end+ def any_children?+ visible_children.any? || invisible_children.any?+ end+privatedef collect_all_relation_types