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

[#58160] project list: show life cycle name in column for now

Tobias Dillmann3796f8f33a5a
diff --git a/app/components/projects/row_component.rb b/app/components/projects/row_component.rb
index 3f540eac0ec..cc8ad40c0da 100644
--- a/app/components/projects/row_component.rb
+++ b/app/components/projects/row_component.rb
@@ -69,6 +69,8 @@ module Projects
def column_value(column)
if custom_field_column?(column)
custom_field_column(column)
+ elsif life_cycle_step_column?(column)
+ life_cycle_step_column(column)
else
send(column.attribute)
end
@@ -94,6 +96,15 @@ module Projects
end
end
+ def life_cycle_step_column(column)
+ return nil unless user_can_view_project?
+
+ # FIXME: make this efficient
+ ls = Project::LifeCycleStep.find_by(id: column.life_cycle_step.id, project:)
+ # FIXME: we are interested in the start/end date to display values here instead of the name
+ ls&.definition&.name
+ end
+
def created_at
helpers.format_date(project.created_at)
end
@@ -374,6 +385,10 @@ module Projects
column.is_a?(::Queries::Projects::Selects::CustomField)
end
+ def life_cycle_step_column?(column)
+ column.is_a?(::Queries::Projects::Selects::LifeCycleStep)
+ end
+
def current_page
table.model.current_page.to_s
end