Rename LifeCycleTypeComponent to LifeCycleComponent, update previews and heading description

This commit is contained in:
Dombi Attila
2025-03-28 11:13:22 +02:00
parent f63e36a23d
commit 27f2dc850f
9 changed files with 49 additions and 25 deletions
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
# ++
module Projects
class LifeCycleTypeComponent < ApplicationComponent
class LifeCycleComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
def text
@@ -44,6 +44,7 @@ module Projects
end
def icon
# TODO: Update icon as per mockups.
:"git-commit"
end
@@ -8,7 +8,7 @@
render(Primer::Beta::Text.new(classes: "filter-target-visible-text")) { definition.name }
end
title_container.with_column(pt: 1, classes: "no-wrap") do
render(Projects::LifeCycleTypeComponent.new(definition))
render(Projects::LifeCycleComponent.new(definition))
end
end
# py: 1 quick fix: prevents the row from bouncing as the toggle switch currently changes height while toggling
@@ -57,7 +57,7 @@ See COPYRIGHT and LICENSE files for more details.
end
end
title_container.with_column do
render(Projects::LifeCycleTypeComponent.new(definition))
render(Projects::LifeCycleComponent.new(definition))
end
title_container.with_column(classes: "no-wrap") do
render(Primer::Beta::Text.new) { t("project.count", count: definition.project_count) }
+1 -1
View File
@@ -3963,7 +3963,7 @@ en:
description: "Changes to this project attribute will be reflected in all projects where it is enabled. Required attributes cannot be disabled on a per-project basis."
project_phase_definitions:
heading: "Project life cycle"
heading_description: "The project life cycles consists of stages and gates that structure your projects. They will appear in the overview page of a project and be available in the projects list. Individual stages and gates can be selected to customize a project but reordering is not possible on a project level."
heading_description: "Project lifecycle define the project phases that can be used for your project planning and will appear in the overview page of each project. These attributes can be enabled or disabled but not re-ordered at a project level."
label_add: "Add"
label_add_description: "Add lifecycle definition"
filter:
@@ -0,0 +1,43 @@
# frozen_string_literal: true
# -- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2010-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
# ++
module OpenProject
module Projects
# @logical_path OpenProject/Projects
class LifeCycleComponentPreview < Lookbook::Preview
# @param start_gate [boolean]
# @param end_gate [boolean]
def phase(start_gate: false, end_gate: false)
model = Project::PhaseDefinition.new(id: 1, name: "The first phase", start_gate:, end_gate:)
render_with_template(locals: { model: })
end
end
end
end
@@ -3,4 +3,4 @@
.__hl_inline_life_cycle_step_definition_1 { color: red; }
</style>
<%= render(::Projects::LifeCycleTypeComponent.new(model)) %>
<%= render(::Projects::LifeCycleComponent.new(model)) %>
@@ -1,14 +0,0 @@
module OpenProject
module Projects
# @logical_path OpenProject/Projects
class LifeCycleTypeComponentPreview < Lookbook::Preview
def gate
render_with_template(locals: { model: Project::GateDefinition.new(id: 1, name: "The first gate") })
end
def stage
render_with_template(locals: { model: Project::StageDefinition.new(id: 1, name: "The first stage") })
end
end
end
end
@@ -1,6 +0,0 @@
<!-- Depends on having the color defined in the highlighting/styles.css.erb file. -->
<style>
.__hl_inline_life_cycle_step_definition_1 { color: red; }
</style>
<%= render(::Projects::LifeCycleTypeComponent.new(model)) %>