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
Update variable names
Dombi Attila479b9c892845
diff --git a/app/models/project/life_cycle_step.rb b/app/models/project/life_cycle_step.rbindex abccc560a70..c4e6cc58876 100644--- a/app/models/project/life_cycle_step.rb+++ b/app/models/project/life_cycle_step.rb@@ -33,12 +33,14 @@ class Project::LifeCycleStep < ApplicationRecordclass_name: "Project::LifeCycleStepDefinition"has_many :work_packages, inverse_of: :project_life_cycle_step, dependent: :nullify- delegate :name, to: :life_cycle+ delegate :name, to: :definitionattr_readonly :definition_id, :typevalidates :type, inclusion: { in: %w[Project::Stage Project::Gate], message: :must_be_a_stage_or_gate }+ scope :active, -> { where(active: true) }+def initialize(*args)if instance_of? Project::LifeCycleStep# Do not allow directly instantiating this classdiff --git a/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.html.erb b/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.html.erbindex ac45e374d7d..00e6527f89f 100644--- a/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.html.erb+++ b/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.html.erb@@ -3,12 +3,12 @@justify_content: :space_between,classes: 'op-project-life-cycle-container',data: {- test_selector: "project-life-cycle-#{@project_life_cycle.id}"- }) do |life_cycle_value_container|+ test_selector: "project-life-cycle-#{@life_cycle_step.id}"+ }) do |life_cycle_container|# temporarily using inline styles in order to align the content as desiredlife_cycle_container.with_row(mb: 1) dorender(Primer::Beta::Text.new(font_weight: :bold)) do- concat @project_life_cycle.name+ concat @life_cycle_step.nameendenddiff --git a/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.rb b/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.rbindex 9f54f071385..3687f4b162f 100644--- a/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.rb+++ b/modules/overviews/app/components/project_life_cycles/sections/project_life_cycles/show_component.rb@@ -33,27 +33,27 @@ module ProjectLifeCyclesinclude ApplicationHelperinclude OpPrimer::ComponentHelpers- def initialize(project_life_cycle:)+ def initialize(life_cycle_step:)super- @project_life_cycle = project_life_cycle+ @life_cycle_step = life_cycle_stependprivatedef not_set?- @project_life_cycle.not_set?+ @life_cycle_step.not_set?enddef render_value- case @project_life_cycle+ case @life_cycle_stepwhen Project::Gaterender(Primer::Beta::Text.new) do- concat @project_life_cycle.date+ concat @life_cycle_step.dateendwhen Project::Stagerender(Primer::Beta::Text.new) do- concat [@project_life_cycle.start_date, " - ", @project_life_cycle.end_date].join+ concat [@life_cycle_step.start_date, " - ", @life_cycle_step.end_date].joinendendenddiff --git a/modules/overviews/app/components/project_life_cycles/sections/show_component.html.erb b/modules/overviews/app/components/project_life_cycles/sections/show_component.html.erbindex 4a0c5187d9c..611ddbba64d 100644--- a/modules/overviews/app/components/project_life_cycles/sections/show_component.html.erb+++ b/modules/overviews/app/components/project_life_cycles/sections/show_component.html.erb@@ -6,13 +6,12 @@)) do |section|section.with_title { "Life Cycles" }-flex_layout do |details_container|- @project_life_cycles.each_with_index do |project_life_cycle, i|- margin = i == @project_life_cycles.size - 1 ? 0 : 3+ @life_cycle_steps.each_with_index do |life_cycle_step, i|+ margin = i == @life_cycle_steps.size - 1 ? 0 : 3details_container.with_row(mb: margin) dorender(ProjectLifeCycles::Sections::ProjectLifeCycles::ShowComponent.new(- project_life_cycle:+ life_cycle_step:))endenddiff --git a/modules/overviews/app/components/project_life_cycles/sections/show_component.rb b/modules/overviews/app/components/project_life_cycles/sections/show_component.rbindex a2788ed9a98..22335c8562c 100644--- a/modules/overviews/app/components/project_life_cycles/sections/show_component.rb+++ b/modules/overviews/app/components/project_life_cycles/sections/show_component.rb@@ -37,7 +37,7 @@ module ProjectLifeCyclessuper@project = project- @project_life_cycles = @project.project_life_cycles.includes(:life_cycle)+ @life_cycle_steps = @project.life_cycle_steps.active.includes(:definition)endprivate