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
Render start and end dates for successor relationships
Aaron Contrerasaf9200a8b54c
diff --git a/app/components/work_package_relations_tab/relation_component.html.erb b/app/components/work_package_relations_tab/relation_component.html.erbindex 13c8366e386..fba5021d583 100644--- a/app/components/work_package_relations_tab/relation_component.html.erb+++ b/app/components/work_package_relations_tab/relation_component.html.erb@@ -59,16 +59,23 @@endend- if parent_child_relationship? && child.description.present?+ if should_display_description?flex.with_row(flex_layout: true, justify_content: :flex_start) do |description_row|description_row.with_column do- render(Primer::Beta::Text.new(font_size: :small, color: :muted)) { format_text(child, :description) }+ render(Primer::Beta::Text.new(font_size: :small, color: :muted)) { format_text(relation, :description) }endend- elsif !parent_child_relationship? && relation.description.present?- flex.with_row(flex_layout: true, justify_content: :flex_start) do |description_row|- description_row.with_column do- render(Primer::Beta::Text.new(font_size: :small, color: :muted)) { format_text(relation, :description) }+ end++ if should_display_start_and_end_dates?+ flex.with_row(flex_layout: true, justify_content: :flex_start, align_items: :center, style: "gap: 0.25rem;") do |start_and_end_dates_row|+ start_and_end_dates_row.with_column do+ render(Primer::Beta::Octicon.new(icon: :calendar, color: :muted))+ end+ start_and_end_dates_row.with_column do+ render(Primer::Beta::Text.new(color: :muted)) do+ format_date(related_work_package.start_date) + " - " + format_date(related_work_package.due_date)+ endendendenddiff --git a/app/components/work_package_relations_tab/relation_component.rb b/app/components/work_package_relations_tab/relation_component.rbindex 6d80d2a4b5c..19bf080a096 100644--- a/app/components/work_package_relations_tab/relation_component.rb+++ b/app/components/work_package_relations_tab/relation_component.rb@@ -34,6 +34,18 @@ class WorkPackageRelationsTab::RelationComponent < ApplicationComponentendend+ def should_display_description?+ return false if parent_child_relationship?++ relation.description.present?+ end++ def should_display_start_and_end_dates?+ return false if parent_child_relationship?++ relation.follows? || relation.precedes?+ end+def edit_pathif parent_child_relationship?raise NotImplementedError, "Children relationships are not editable"