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

broad rename to phase

ulfertse3ee5bb55294
diff --git a/app/forms/projects/life_cycles/form.rb b/app/forms/projects/life_cycles/form.rb
index c0e1f93dfbc..0d86e332e4c 100644
--- a/app/forms/projects/life_cycles/form.rb
+++ b/app/forms/projects/life_cycles/form.rb
@@ -74,7 +74,7 @@ module Projects::LifeCycles
input_attributes = { name: :date_range, value: }
if model.working_days_count
input_attributes[:caption] =
- I18n.t("project_stage.working_days_count", count: model.working_days_count)
+ I18n.t("project_phase.working_days_count", count: model.working_days_count)
end
form.range_date_picker **base_input_attributes, **input_attributes
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 22478e5b314..93f3b59c205 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -100,7 +100,7 @@ class Journal < ApplicationRecord
has_many :agenda_item_journals, class_name: "Journal::MeetingAgendaItemJournal", dependent: :delete_all
has_many :attachable_journals, class_name: "Journal::AttachableJournal", dependent: :delete_all
has_many :customizable_journals, class_name: "Journal::CustomizableJournal", dependent: :delete_all
- has_many :project_life_cycle_step_journals, class_name: "Journal::ProjectLifeCycleStepJournal", dependent: :delete_all
+ has_many :project_phase_journals, class_name: "Journal::ProjectPhaseJournal", dependent: :delete_all
has_many :storable_journals, class_name: "Journal::StorableJournal", dependent: :delete_all
has_many :notifications, dependent: :destroy
diff --git a/app/models/journal/project_life_cycle_step_journal.rb b/app/models/journal/project_phase_journal.rb
similarity index 87%
rename from app/models/journal/project_life_cycle_step_journal.rb
rename to app/models/journal/project_phase_journal.rb
index 6409a3bf2ce..e06515c8f54 100644
--- a/app/models/journal/project_life_cycle_step_journal.rb
+++ b/app/models/journal/project_phase_journal.rb
@@ -28,10 +28,10 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-class Journal::ProjectLifeCycleStepJournal < Journal::AssociatedJournal
- self.table_name = "project_life_cycle_step_journals"
+class Journal::ProjectPhaseJournal < Journal::AssociatedJournal
+ self.table_name = "project_phase_journals"
- belongs_to :phase, class_name: "Project::LifeCycleStep"
+ belongs_to :phase, class_name: "Project::Phase"
alias_attribute :date, :start_date
diff --git a/app/services/journals/create_service/association.rb b/app/services/journals/create_service/association.rb
index 6ec984e71ba..7242109d183 100644
--- a/app/services/journals/create_service/association.rb
+++ b/app/services/journals/create_service/association.rb
@@ -36,7 +36,7 @@ class Journals::CreateService
AgendaItemable
Attachable
Customizable
- ProjectLifeCycleStep
+ ProjectPhase
Storable
].freeze
diff --git a/app/services/journals/create_service/project_life_cycle_step.rb b/app/services/journals/create_service/project_phase.rb
similarity index 98%
rename from app/services/journals/create_service/project_life_cycle_step.rb
rename to app/services/journals/create_service/project_phase.rb
index 8a69d1366c6..afede868e41 100644
--- a/app/services/journals/create_service/project_life_cycle_step.rb
+++ b/app/services/journals/create_service/project_phase.rb
@@ -29,7 +29,7 @@
#++
class Journals::CreateService
- class ProjectLifeCycleStep < Association
+ class ProjectPhase < Association
def associated?
journable.respond_to?(:phases)
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 63bfb0db249..04d87f5bb09 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -437,7 +437,7 @@ en:
no_results_title_text: There is no additional recorded disk space consumed by this project.
work_package_priorities:
new_label: "New priority"
- project_stage:
+ project_phase:
working_days_count:
one: "Duration: %{count} working day"
other: "Duration: %{count} working days"
@@ -1340,42 +1340,12 @@ en:
attributes:
project_ids:
blank: "Please select a project."
- project/life_cycle_step_definition:
- attributes:
- type:
- must_be_a_stage_or_gate: "must be either Project::StageDefinition or Project::GateDefinition"
- type_and_class_name_mismatch: "must match the instantiated class name"
- project/gate_definition:
- attributes:
- type:
- type_and_class_name_mismatch: "must be a Project::GateDefinition"
- project/stage_definition:
- attributes:
- type:
- type_and_class_name_mismatch: "must be a Project::StageDefinition"
- project/life_cycle_step:
- attributes:
- type:
- must_be_a_stage_or_gate: "must be either Project::Stage or Project::Gate"
- must_be_a_stage: "must be a Project::Stage"
- must_be_a_gate: "must be a Project::Gate"
- type_and_class_name_mismatch: "must match the instantiated class name"
- project/gate:
- attributes:
- base:
- end_date_not_allowed: "Cannot assign end date to a Project::Gate"
- type:
- type_and_class_name_mismatch: "must be a Project::Gate"
- date:
- non_continuous_dates: "can't be earlier than the previous %{step}'s end date."
- project/stage:
+ project/phase:
attributes:
date_range:
start_date_must_be_before_end_date: "start date must be before the end date."
- non_continuous_dates: "can't be earlier than the previous %{step}'s end date."
+ non_continuous_dates: "can't be earlier than the previous phase's end date."
incomplete: "is incomplete."
- type:
- type_and_class_name_mismatch: "must be a Project::Stage"
query:
attributes:
project:
diff --git a/spec/contracts/project_life_cycle_steps/base_contract_spec.rb b/spec/contracts/project_life_cycle_steps/base_contract_spec.rb
index 56288136616..8e433feb39c 100644
--- a/spec/contracts/project_life_cycle_steps/base_contract_spec.rb
+++ b/spec/contracts/project_life_cycle_steps/base_contract_spec.rb
@@ -54,7 +54,7 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
describe "validations" do
describe "#consecutive_steps_have_increasing_dates" do
let(:gate1) { build_stubbed(:project_gate, start_date: Date.new(2024, 1, 1)) }
- let(:stage2) { build_stubbed(:project_stage, start_date: Date.new(2024, 2, 1), end_date: Date.new(2024, 2, 28)) }
+ let(:stage2) { build_stubbed(:project_phase, start_date: Date.new(2024, 2, 1), end_date: Date.new(2024, 2, 28)) }
let(:gate3) { build_stubbed(:project_gate, start_date: Date.new(2024, 3, 1), end_date: Date.new(2024, 3, 15)) }
let(:steps) { [gate1, stage2, gate3] }
@@ -112,14 +112,14 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
context "when steps have touching start and end dates" do
context "when 2 Stages are touching" do
- let(:stage4) { build_stubbed(:project_stage, start_date: Date.new(2024, 2, 28), end_date: Date.new(2024, 3, 1)) }
+ let(:stage4) { build_stubbed(:project_phase, start_date: Date.new(2024, 2, 28), end_date: Date.new(2024, 3, 1)) }
let(:steps) { [stage2, stage4] }
it_behaves_like "contract is invalid",
"available_phases.date_range": :non_continuous_dates
context "when having an empty step in between" do
- let(:step_missing_dates) { build_stubbed(:project_stage, start_date: nil, end_date: nil) }
+ let(:step_missing_dates) { build_stubbed(:project_phase, start_date: nil, end_date: nil) }
let(:steps) { [stage2, step_missing_dates, stage4] }
it_behaves_like "contract is invalid",
@@ -135,7 +135,7 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
"available_phases.date": :non_continuous_dates
context "when having an empty step in between" do
- let(:step_missing_dates) { build_stubbed(:project_stage, start_date: nil, end_date: nil) }
+ let(:step_missing_dates) { build_stubbed(:project_phase, start_date: nil, end_date: nil) }
let(:steps) { [gate1, step_missing_dates, gate4] }
it_behaves_like "contract is invalid",
@@ -150,7 +150,7 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
it_behaves_like "contract is valid"
context "when having an empty step in between" do
- let(:step_missing_dates) { build_stubbed(:project_stage, start_date: nil, end_date: nil) }
+ let(:step_missing_dates) { build_stubbed(:project_phase, start_date: nil, end_date: nil) }
let(:steps) { [stage2, step_missing_dates, gate4] }
it_behaves_like "contract is valid"
@@ -158,13 +158,13 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
end
context "when a Stage and a Gate are touching on the end date" do
- let(:stage4) { build_stubbed(:project_stage, start_date: Date.new(2023, 12, 30), end_date: Date.new(2024, 1, 1)) }
+ let(:stage4) { build_stubbed(:project_phase, start_date: Date.new(2023, 12, 30), end_date: Date.new(2024, 1, 1)) }
let(:steps) { [stage4, gate1] }
it_behaves_like "contract is valid"
context "when having an empty step in between" do
- let(:step_missing_dates) { build_stubbed(:project_stage, start_date: nil, end_date: nil) }
+ let(:step_missing_dates) { build_stubbed(:project_phase, start_date: nil, end_date: nil) }
let(:steps) { [stage4, step_missing_dates, gate1] }
it_behaves_like "contract is valid"
@@ -173,13 +173,13 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
context "when a Stage, a Gate, and anothe Stage are touching" do
let(:gate4) { build_stubbed(:project_gate, start_date: Date.new(2024, 2, 28)) }
- let(:stage5) { build_stubbed(:project_stage, start_date: Date.new(2024, 2, 28), end_date: Date.new(2024, 3, 1)) }
+ let(:stage5) { build_stubbed(:project_phase, start_date: Date.new(2024, 2, 28), end_date: Date.new(2024, 3, 1)) }
let(:steps) { [stage2, gate4, stage5] }
it_behaves_like "contract is valid"
context "when having an empty step in between" do
- let(:step_missing_dates) { build_stubbed(:project_stage, start_date: nil, end_date: nil) }
+ let(:step_missing_dates) { build_stubbed(:project_phase, start_date: nil, end_date: nil) }
let(:steps) { [stage2, gate4, step_missing_dates, stage5] }
it_behaves_like "contract is valid"
@@ -188,7 +188,7 @@ RSpec.describe ProjectLifeCycleSteps::BaseContract do
end
context "when a step has missing start dates" do
- let(:step_missing_dates) { build_stubbed(:project_stage, start_date: nil, end_date: nil) }
+ let(:step_missing_dates) { build_stubbed(:project_phase, start_date: nil, end_date: nil) }
context "and the other steps have increasing dates" do
let(:steps) { [gate1, step_missing_dates, stage2] }
diff --git a/spec/factories/journal/project_life_cycle_step_journal_factory.rb b/spec/factories/journal/project_phase_journal_factory.rb
similarity index 93%
rename from spec/factories/journal/project_life_cycle_step_journal_factory.rb
rename to spec/factories/journal/project_phase_journal_factory.rb
index a4449db3b10..37fd74fe07d 100644
--- a/spec/factories/journal/project_life_cycle_step_journal_factory.rb
+++ b/spec/factories/journal/project_phase_journal_factory.rb
@@ -29,5 +29,5 @@
#++
FactoryBot.define do
- factory :project_life_cycle_step_journal, class: "Journal::ProjectLifeCycleStepJournal"
+ factory :project_phase_journal, class: "Journal::ProjectPhaseJournal"
end
diff --git a/spec/features/admin/project_life_cycle_step_definitions_spec.rb b/spec/features/admin/project_life_cycle_step_definitions_spec.rb
index 6f8fefb7c93..4cf9bb98a86 100644
--- a/spec/features/admin/project_life_cycle_step_definitions_spec.rb
+++ b/spec/features/admin/project_life_cycle_step_definitions_spec.rb
@@ -31,9 +31,9 @@
require "spec_helper"
RSpec.describe "Projects life cycle settings", :js, with_flag: { stages_and_gates: true } do
- shared_let(:initiating_stage) { create(:project_stage_definition, name: "Initiating") }
- shared_let(:ready_to_execute_gate) { create(:project_gate_definition, name: "Ready to Execute") }
- shared_let(:executing_stage) { create(:project_stage_definition, name: "Executing") }
+ shared_let(:initiating_stage) { create(:project_phase_definition, name: "Initiating") }
+ shared_let(:ready_to_execute_gate) { create(:project_phase_definition, name: "Ready to Execute") }
+ shared_let(:executing_stage) { create(:project_phase_definition, name: "Executing") }
let(:definitions_page) { Pages::Admin::Settings::ProjectLifeCycleStepDefinitions.new }
diff --git a/spec/features/projects/life_cycle/active_in_project_spec.rb b/spec/features/projects/life_cycle/active_in_project_spec.rb
index ba8a2d4ab6e..2e019e27719 100644
--- a/spec/features/projects/life_cycle/active_in_project_spec.rb
+++ b/spec/features/projects/life_cycle/active_in_project_spec.rb
@@ -48,11 +48,11 @@ RSpec.describe "Projects life cycle settings", :js, with_flag: { stages_and_gate
})
end
- shared_let(:initiating_stage) { create(:project_stage_definition, name: "Initiating") }
- shared_let(:ready_to_execute_gate) { create(:project_gate_definition, name: "Ready to Execute") }
- shared_let(:executing_stage) { create(:project_stage_definition, name: "Executing") }
- shared_let(:ready_to_close_gate) { create(:project_gate_definition, name: "Ready to Close") }
- shared_let(:closing_stage) { create(:project_stage_definition, name: "Closing") }
+ shared_let(:initiating_stage) { create(:project_phase_definition, name: "Initiating") }
+ shared_let(:ready_to_execute_gate) { create(:project_phase_definition, name: "Ready to Execute") }
+ shared_let(:executing_stage) { create(:project_phase_definition, name: "Executing") }
+ shared_let(:ready_to_close_gate) { create(:project_phase_definition, name: "Ready to Close") }
+ shared_let(:closing_stage) { create(:project_phase_definition, name: "Closing") }
let(:project_life_cycle_page) { Pages::Projects::Settings::LifeCycle.new(project) }
diff --git a/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb b/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb
index 3b03cdd8ae3..cf153532269 100644
--- a/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb
+++ b/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb
@@ -50,7 +50,7 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
Project::Phase.update_all(start_date: nil, end_date: nil)
end
- it "shows all the Project::LifeCycleSteps without a value" do
+ it "shows all the Project::Phases without a value" do
dialog = overview_page.open_edit_dialog_for_life_cycles
dialog.expect_input("Initiating", value: "", type: :stage, position: 1)
@@ -75,7 +75,7 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
end
context "when all LifeCycleSteps have a value" do
- it "shows all the Project::LifeCycleSteps and updates them correctly" do
+ it "shows all the Project::Phases and updates them correctly" do
dialog = overview_page.open_edit_dialog_for_life_cycles
expect_angular_frontend_initialized
diff --git a/spec/features/projects/life_cycle/overview_page/shared_context.rb b/spec/features/projects/life_cycle/overview_page/shared_context.rb
index 1d3677e89e6..27ef257d556 100644
--- a/spec/features/projects/life_cycle/overview_page/shared_context.rb
+++ b/spec/features/projects/life_cycle/overview_page/shared_context.rb
@@ -32,31 +32,31 @@ RSpec.shared_context "with seeded projects and stages and gates" do
shared_let(:admin) { create(:admin) }
shared_let(:life_cycle_initiating_definition) do
- create :project_stage_definition, name: "Initiating"
+ create :project_phase_definition, name: "Initiating"
end
shared_let(:life_cycle_ready_for_planning_definition) do
- create :project_gate_definition, name: "Ready for Planning"
+ create :project_phase_definition, name: "Ready for Planning"
end
shared_let(:life_cycle_planning_definition) do
- create :project_stage_definition, name: "Planning"
+ create :project_phase_definition, name: "Planning"
end
shared_let(:life_cycle_ready_for_executing_definition) do
- create :project_gate_definition, name: "Ready for Executing"
+ create :project_phase_definition, name: "Ready for Executing"
end
shared_let(:life_cycle_executing_definition) do
- create :project_stage_definition, name: "Executing"
+ create :project_phase_definition, name: "Executing"
end
shared_let(:life_cycle_ready_for_closing_definition) do
- create :project_gate_definition, name: "Ready for Closing"
+ create :project_phase_definition, name: "Ready for Closing"
end
shared_let(:life_cycle_closing_definition) do
- create :project_stage_definition, name: "Closing"
+ create :project_phase_definition, name: "Closing"
end
let(:start_date) { Time.zone.today.next_week }
let(:life_cycle_initiating) do
- create :project_stage,
+ create :project_phase,
definition: life_cycle_initiating_definition,
start_date:,
end_date: start_date + 1.day,
@@ -69,7 +69,7 @@ RSpec.shared_context "with seeded projects and stages and gates" do
project:
end
let(:life_cycle_planning) do
- create :project_stage,
+ create :project_phase,
definition: life_cycle_planning_definition,
start_date: start_date + 4.days,
end_date: start_date + 7.days,
@@ -82,7 +82,7 @@ RSpec.shared_context "with seeded projects and stages and gates" do
project:
end
let(:life_cycle_executing) do
- create :project_stage,
+ create :project_phase,
definition: life_cycle_executing_definition,
start_date: start_date + 9.days,
end_date: start_date + 10.days,
@@ -95,7 +95,7 @@ RSpec.shared_context "with seeded projects and stages and gates" do
project:
end
let(:life_cycle_closing) do
- create :project_stage,
+ create :project_phase,
definition: life_cycle_closing_definition,
start_date: start_date + 14.days,
end_date: start_date + 18.days,
diff --git a/spec/features/projects/lists/columns_spec.rb b/spec/features/projects/lists/columns_spec.rb
index 600e6397b7c..19609680a1a 100644
--- a/spec/features/projects/lists/columns_spec.rb
+++ b/spec/features/projects/lists/columns_spec.rb
@@ -253,13 +253,13 @@ RSpec.describe "Projects lists columns", :js, with_settings: { login_required?:
context "with life cycle columns" do
shared_let(:life_cycle_gate) { create(:project_gate, project:, date: Date.new(2024, 12, 13)) }
shared_let(:life_cycle_stage) do
- create(:project_stage,
+ create(:project_phase,
project: development_project,
start_date: Date.new(2024, 12, 1),
end_date: Date.new(2024, 12, 13))
end
shared_let(:inactive_life_cycle_gate) { create(:project_gate, project:, active: false) }
- shared_let(:inactive_life_cycle_stage) { create(:project_stage, project: development_project, active: false) }
+ shared_let(:inactive_life_cycle_stage) { create(:project_phase, project: development_project, active: false) }
context "with the feature flag disabled", with_flag: { stages_and_gates: false } do
specify "life cycle columns cannot be configured to show up" do
diff --git a/spec/features/projects/lists/filters_spec.rb b/spec/features/projects/lists/filters_spec.rb
index 40df4b8527e..bcd4b47f6b5 100644
--- a/spec/features/projects/lists/filters_spec.rb
+++ b/spec/features/projects/lists/filters_spec.rb
@@ -54,7 +54,7 @@ RSpec.describe "Projects list filters", :js, with_settings: { login_required?: f
})
end
shared_let(:stage) do
- create(:project_stage, project:, start_date: Time.zone.today - 5.days, end_date: Time.zone.today + 10.days)
+ create(:project_phase, project:, start_date: Time.zone.today - 5.days, end_date: Time.zone.today + 10.days)
end
shared_let(:gate) { create(:project_gate, project: public_project, date: Time.zone.today) }
diff --git a/spec/features/projects/lists/order_spec.rb b/spec/features/projects/lists/order_spec.rb
index 4cedb232209..c4a7e20c255 100644
--- a/spec/features/projects/lists/order_spec.rb
+++ b/spec/features/projects/lists/order_spec.rb
@@ -274,37 +274,37 @@ RSpec.describe "Projects lists ordering", :js, with_settings: { login_required?:
end
context "when sorting by life cycle", with_flag: { stages_and_gates: true } do
- let(:stage_def) { create(:project_stage_definition) }
+ let(:stage_def) { create(:project_phase_definition) }
let(:stage) do
- create(:project_stage,
+ create(:project_phase,
project:,
definition: stage_def,
start_date: Date.new(2025, 1, 1),
end_date: Date.new(2025, 1, 13))
end
let!(:public_stage) do
- create(:project_stage,
+ create(:project_phase,
project: public_project,
definition: stage_def,
start_date: Date.new(2025, 2, 12),
end_date: Date.new(2025, 2, 20))
end
let!(:child_stage) do
- create(:project_stage,
+ create(:project_phase,
project: child_project_m,
definition: stage_def,
start_date: public_stage.start_date,
end_date: public_stage.end_date + 1.day)
end
let!(:last_stage) do
- create(:project_stage,
+ create(:project_phase,
project: development_project,
definition: stage_def,
start_date: public_stage.start_date,
end_date: public_stage.end_date + 2.days)
end
- let(:gate_def) { create(:project_gate_definition) }
+ let(:gate_def) { create(:project_phase_definition) }
let(:gate) do
create(:project_gate,
project:,
diff --git a/spec/helpers/sort_helper_spec.rb b/spec/helpers/sort_helper_spec.rb
index 149da1f15ba..3638dcba007 100644
--- a/spec/helpers/sort_helper_spec.rb
+++ b/spec/helpers/sort_helper_spec.rb
@@ -429,7 +429,7 @@ RSpec.describe SortHelper do
end
context "with a life cycle gate column" do
- let(:life_cycle_step) { create(:project_gate_definition) }
+ let(:life_cycle_step) { create(:project_phase_definition) }
let(:life_cycle_column) { Queries::Projects::Selects::LifeCycleStep.new("lcsd_#{life_cycle_step.id}") }
let(:options) { { caption: life_cycle_step.name } }
@@ -455,7 +455,7 @@ RSpec.describe SortHelper do
end
context "with a life cycle stage column" do
- let(:life_cycle_step) { create(:project_stage_definition) }
+ let(:life_cycle_step) { create(:project_phase_definition) }
it "shows a commit icon in the header for gates" do
icon = action_menu.at_css(".generic-table--action-menu-button .Button-leadingVisual .octicon-git-commit")
diff --git a/spec/lib/open_project/journal_formatter/project_life_cycle_step_active_spec.rb b/spec/lib/open_project/journal_formatter/project_life_cycle_step_active_spec.rb
index cf6e5fef469..cfc8f1446eb 100644
--- a/spec/lib/open_project/journal_formatter/project_life_cycle_step_active_spec.rb
+++ b/spec/lib/open_project/journal_formatter/project_life_cycle_step_active_spec.rb
@@ -58,7 +58,7 @@ RSpec.describe OpenProject::JournalFormatter::ProjectLifeCycleStepActive do
describe "for gate changes" do
let(:step) { build_stubbed(:project_gate, definition:) }
- let(:definition) { build_stubbed(:project_gate_definition, name: "The Gate") }
+ let(:definition) { build_stubbed(:project_phase_definition, name: "The Gate") }
context "when activated" do
let(:values) { [false, true] }
@@ -94,8 +94,8 @@ RSpec.describe OpenProject::JournalFormatter::ProjectLifeCycleStepActive do
end
describe "for stage changes" do
- let(:step) { build_stubbed(:project_stage, definition:) }
- let(:definition) { build_stubbed(:project_stage_definition, name: "The Stage") }
+ let(:step) { build_stubbed(:project_phase, definition:) }
+ let(:definition) { build_stubbed(:project_phase_definition, name: "The Stage") }
context "when activated" do
let(:values) { [false, true] }
diff --git a/spec/lib/open_project/journal_formatter/project_life_cycle_step_dates_spec.rb b/spec/lib/open_project/journal_formatter/project_life_cycle_step_dates_spec.rb
index 92b7429beeb..586e40e635b 100644
--- a/spec/lib/open_project/journal_formatter/project_life_cycle_step_dates_spec.rb
+++ b/spec/lib/open_project/journal_formatter/project_life_cycle_step_dates_spec.rb
@@ -58,7 +58,7 @@ RSpec.describe OpenProject::JournalFormatter::ProjectLifeCycleStepDates do
describe "for gate changes" do
let(:step) { build_stubbed(:project_gate, definition:) }
- let(:definition) { build_stubbed(:project_gate_definition, name: "The Gate") }
+ let(:definition) { build_stubbed(:project_phase_definition, name: "The Gate") }
context "when date added" do
let(:values) { [nil, date(28)..] }
@@ -94,8 +94,8 @@ RSpec.describe OpenProject::JournalFormatter::ProjectLifeCycleStepDates do
end
describe "for stage changes" do
- let(:step) { build_stubbed(:project_stage, definition:) }
- let(:definition) { build_stubbed(:project_stage_definition, name: "The Stage") }
+ let(:step) { build_stubbed(:project_phase, definition:) }
+ let(:definition) { build_stubbed(:project_phase_definition, name: "The Stage") }
context "when date range added" do
let(:values) { [nil, date(28)..date(29)] }
diff --git a/spec/models/project/phase_definitions/scopes/with_project_count_spec.rb b/spec/models/project/phase_definitions/scopes/with_project_count_spec.rb
index 777be1831d3..68d5cb616be 100644
--- a/spec/models/project/phase_definitions/scopes/with_project_count_spec.rb
+++ b/spec/models/project/phase_definitions/scopes/with_project_count_spec.rb
@@ -31,19 +31,19 @@
require "spec_helper"
RSpec.describe Project::PhaseDefinitions::Scopes::WithProjectCount do
- let!(:definition_a) { create(:project_stage_definition, name: "foo") }
- let!(:definition_b) { create(:project_gate_definition, name: "bar") }
- let!(:definition_c) { create(:project_stage_definition, name: "baz") }
+ let!(:definition_a) { create(:project_phase_definition, name: "foo") }
+ let!(:definition_b) { create(:project_phase_definition, name: "bar") }
+ let!(:definition_c) { create(:project_phase_definition, name: "baz") }
before do
create(:project).tap do |project|
- create(:project_stage, project:, definition: definition_a)
- create(:project_stage, project:, definition: definition_b)
+ create(:project_phase, project:, definition: definition_a)
+ create(:project_phase, project:, definition: definition_b)
end
create(:project).tap do |project|
- create(:project_stage, project:, definition: definition_a)
- create(:project_stage, project:, definition: definition_b, active: false)
+ create(:project_phase, project:, definition: definition_a)
+ create(:project_phase, project:, definition: definition_b, active: false)
end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index cbbbac40a38..5230dc27d77 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -381,11 +381,11 @@ RSpec.describe Project do
end
describe "life_cycles" do
- it { is_expected.to have_many(:life_cycle_steps).class_name("Project::LifeCycleStep").dependent(:destroy) }
+ it { is_expected.to have_many(:life_cycle_steps).class_name("Project::Phase").dependent(:destroy) }
it "has many available_phases" do
expect(subject).to have_many(:available_phases)
- .class_name("Project::LifeCycleStep")
+ .class_name("Project::Phase")
.inverse_of(:project)
.dependent(:destroy)
.order(position: :asc)
@@ -411,7 +411,7 @@ RSpec.describe Project do
let(:user) do
create(:user, member_with_permissions: { project => %i(view_project view_project_phases) })
end
- let!(:project_stage) { create :project_stage, :skip_validate, project:, start_date: nil }
+ let!(:project_phase) { create :project_phase, :skip_validate, project:, start_date: nil }
before { allow(User).to receive(:current).and_return user }
diff --git a/spec/models/projects/project_acts_as_journalized_spec.rb b/spec/models/projects/project_acts_as_journalized_spec.rb
index aac0a4455f2..f2cdf2fdbb2 100644
--- a/spec/models/projects/project_acts_as_journalized_spec.rb
+++ b/spec/models/projects/project_acts_as_journalized_spec.rb
@@ -204,7 +204,7 @@ RSpec.describe Project, "acts_as_journalized" do
describe "life cycle steps", with_settings: { journal_aggregation_time_minutes: 0 } do
describe "activation/deactivation" do
- let!(:stage) { build(:project_stage, project:, active: true, start_date: nil, end_date: nil) }
+ let!(:stage) { build(:project_phase, project:, active: true, start_date: nil, end_date: nil) }
let!(:gate) { build(:project_gate, project:, active: true, date: nil) }
context "when adding activated" do
@@ -241,7 +241,7 @@ RSpec.describe Project, "acts_as_journalized" do
end
describe "modifying dates" do
- let!(:stage) { create(:project_stage, project:, start_date: original_stage_start, end_date: original_stage_end) }
+ let!(:stage) { create(:project_phase, project:, start_date: original_stage_start, end_date: original_stage_end) }
let!(:gate) { create(:project_gate, project:, date: original_gate_date) }
before do
@@ -326,7 +326,7 @@ RSpec.describe Project, "acts_as_journalized" do
describe "combined" do
let!(:stage) do
- build(:project_stage, project:, active: true, start_date: Date.new(2025, 1, 30), end_date: Date.new(2025, 1, 31))
+ build(:project_phase, project:, active: true, start_date: Date.new(2025, 1, 30), end_date: Date.new(2025, 1, 31))
end
let!(:gate) { build(:project_gate, project:, active: true, date: Date.new(2025, 2, 1)) }
diff --git a/spec/models/queries/projects/filters/life_cycle_gate_filter_spec.rb b/spec/models/queries/projects/filters/life_cycle_gate_filter_spec.rb
index 782248b7855..ba206ba3b85 100644
--- a/spec/models/queries/projects/filters/life_cycle_gate_filter_spec.rb
+++ b/spec/models/queries/projects/filters/life_cycle_gate_filter_spec.rb
@@ -31,9 +31,9 @@
require "spec_helper"
RSpec.describe Queries::Projects::Filters::LifeCycleGateFilter do
- let(:gate) { build_stubbed(:project_gate_definition) }
+ let(:gate) { build_stubbed(:project_phase_definition) }
# Defined here and in the .all to check that the filter only works on gates
- let(:stage) { build_stubbed(:project_stage_definition) }
+ let(:stage) { build_stubbed(:project_phase_definition) }
let(:query) { build_stubbed(:project_query) }
let(:instance) do
diff --git a/spec/models/queries/projects/filters/life_cycle_stage_filter_spec.rb b/spec/models/queries/projects/filters/life_cycle_stage_filter_spec.rb
index 331f3340713..a903b0e1dc4 100644
--- a/spec/models/queries/projects/filters/life_cycle_stage_filter_spec.rb
+++ b/spec/models/queries/projects/filters/life_cycle_stage_filter_spec.rb
@@ -31,9 +31,9 @@
require "spec_helper"
RSpec.describe Queries::Projects::Filters::LifeCycleStageFilter do
- let(:stage) { build_stubbed(:project_stage_definition) }
+ let(:stage) { build_stubbed(:project_phase_definition) }
# Defined here and in the .all to check that the filter only works on gates
- let(:gate) { build_stubbed(:project_gate_definition) }
+ let(:gate) { build_stubbed(:project_phase_definition) }
let(:query) { build_stubbed(:project_query) }
let(:instance) do
diff --git a/spec/models/queries/projects/orders/life_cycle_step_order_spec.rb b/spec/models/queries/projects/orders/life_cycle_step_order_spec.rb
index 8c740f5154a..fe5382439fd 100644
--- a/spec/models/queries/projects/orders/life_cycle_step_order_spec.rb
+++ b/spec/models/queries/projects/orders/life_cycle_step_order_spec.rb
@@ -63,7 +63,7 @@ RSpec.describe Queries::Projects::Orders::LifeCycleStepOrder do
current_user { user }
context "without feature flag set" do
- let!(:life_cycle_def) { create(:project_stage_definition) }
+ let!(:life_cycle_def) { create(:project_phase_definition) }
it "does not allow to sort by it" do
expect(instance).not_to be_available
@@ -72,7 +72,7 @@ RSpec.describe Queries::Projects::Orders::LifeCycleStepOrder do
context "with feature flag set", with_flag: { stages_and_gates: true } do
context "for a stage definition" do
- let!(:life_cycle_def) { create(:project_stage_definition) }
+ let!(:life_cycle_def) { create(:project_phase_definition) }
it "allows to sort by it" do
expect(instance).to be_available
@@ -80,7 +80,7 @@ RSpec.describe Queries::Projects::Orders::LifeCycleStepOrder do
end
context "for a gate definition" do
- let!(:life_cycle_def) { create(:project_gate_definition) }
+ let!(:life_cycle_def) { create(:project_phase_definition) }
it "allows to sort by it" do
expect(instance).to be_available
@@ -88,7 +88,7 @@ RSpec.describe Queries::Projects::Orders::LifeCycleStepOrder do
end
context "without permission in any project" do
- let!(:life_cycle_def) { create(:project_gate_definition) }
+ let!(:life_cycle_def) { create(:project_phase_definition) }
let(:permissions) { [] }
it "is not available" do
diff --git a/spec/models/queries/projects/project_query_results_life_cycle_any_spec.rb b/spec/models/queries/projects/project_query_results_life_cycle_any_spec.rb
index 9572146ef3e..b98f6d336b8 100644
--- a/spec/models/queries/projects/project_query_results_life_cycle_any_spec.rb
+++ b/spec/models/queries/projects/project_query_results_life_cycle_any_spec.rb
@@ -39,7 +39,7 @@ RSpec.describe ProjectQuery, "results of 'Any stage or gate' filter" do
shared_let(:stage_end_date) { Date.parse("2025-02-17") }
shared_let(:project_with_stage) { create(:project, name: "Project with stage") }
shared_let(:stage) do
- create(:project_stage, project: project_with_stage, start_date: stage_start_date, end_date: stage_end_date)
+ create(:project_phase, project: project_with_stage, start_date: stage_start_date, end_date: stage_end_date)
end
shared_let(:gate_date) { Date.parse("2025-03-06") }
diff --git a/spec/models/queries/projects/project_query_results_life_cycle_gate_spec.rb b/spec/models/queries/projects/project_query_results_life_cycle_gate_spec.rb
index db4943071da..b9e917db627 100644
--- a/spec/models/queries/projects/project_query_results_life_cycle_gate_spec.rb
+++ b/spec/models/queries/projects/project_query_results_life_cycle_gate_spec.rb
@@ -40,7 +40,7 @@ RSpec.describe ProjectQuery, "results of a life cycle gate filter" do
shared_let(:stage_end_date) { Date.parse("2025-02-17") }
shared_let(:project_with_stage) { create(:project, name: "Project with stage") }
shared_let(:stage) do
- create(:project_stage, project: project_with_stage, start_date: stage_start_date, end_date: stage_end_date)
+ create(:project_phase, project: project_with_stage, start_date: stage_start_date, end_date: stage_end_date)
end
shared_let(:gate_date) { Date.parse("2025-03-06") }
diff --git a/spec/models/queries/projects/project_query_results_life_cycle_stage_spec.rb b/spec/models/queries/projects/project_query_results_life_cycle_stage_spec.rb
index 3ea0491f7af..db2056d94bd 100644
--- a/spec/models/queries/projects/project_query_results_life_cycle_stage_spec.rb
+++ b/spec/models/queries/projects/project_query_results_life_cycle_stage_spec.rb
@@ -40,13 +40,13 @@ RSpec.describe ProjectQuery, "results of a life cycle stage filter" do
shared_let(:stage_end_date) { Date.parse("2025-02-17") }
shared_let(:project_with_stage) { create(:project, name: "Project with stage") }
shared_let(:stage) do
- create(:project_stage, project: project_with_stage, start_date: stage_start_date, end_date: stage_end_date)
+ create(:project_phase, project: project_with_stage, start_date: stage_start_date, end_date: stage_end_date)
end
# This is added to ensure that the filter only works on the stage provided.
shared_let(:project_with_rival_stage) { create(:project, name: "Project with rival stage") }
shared_let(:rival_stage) do
- create(:project_stage, project: project_with_rival_stage, start_date: stage_start_date, end_date: stage_end_date)
+ create(:project_phase, project: project_with_rival_stage, start_date: stage_start_date, end_date: stage_end_date)
end
shared_let(:gate_date) { Date.parse("2025-03-06") }
diff --git a/spec/models/work_package_spec.rb b/spec/models/work_package_spec.rb
index bda8a4caefe..9a7e18772eb 100644
--- a/spec/models/work_package_spec.rb
+++ b/spec/models/work_package_spec.rb
@@ -70,7 +70,7 @@ RSpec.describe WorkPackage do
it { is_expected.to belong_to(:assigned_to).class_name("Principal").optional }
it { is_expected.to belong_to(:responsible).class_name("Principal").optional }
it { is_expected.to belong_to(:version).optional }
- it { is_expected.to belong_to(:project_life_cycle_step).class_name("Project::LifeCycleStep").optional }
+ it { is_expected.to belong_to(:project_life_cycle_step).class_name("Project::Phase").optional }
it { is_expected.to belong_to(:priority).class_name("IssuePriority") }
it { is_expected.to belong_to(:category).optional }
it { is_expected.to have_many(:time_entries).dependent(:delete_all) }