Project wizard name

This commit is contained in:
Oliver Günther
2025-11-20 16:23:08 +01:00
parent f08532afe9
commit f6f84f5a3d
8 changed files with 16 additions and 16 deletions
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { I18n.t("label_project_initiation_request") }
header.with_title { I18n.t("settings.project_initiation_request.name.options.project_initiation_request") }
header.with_breadcrumbs(
[{ href: project_overview_path(@project.id), text: @project.name },
{ href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
@@ -9,7 +9,7 @@
<%=
layout.with_page_header do
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { I18n.t("projects.wizard.title") }
header.with_title { @project.project_creation_wizard_name }
header.with_breadcrumbs(nil)
header.with_action_icon_button(
@@ -132,7 +132,7 @@ class Projects::Settings::CreationWizardController < Projects::SettingsControlle
def name_settings_params
params.expect(
project: %i[name_artefact_name]
project: %i[project_creation_wizard_artifact_name]
)
end
@@ -34,17 +34,17 @@ module Projects
class NameForm < ApplicationForm
form do |f|
f.select_list(
name: :name_artefact_name,
name: :project_creation_wizard_artifact_name,
label: I18n.t("settings.project_initiation_request.name.artefact_name"),
caption: I18n.t("settings.project_initiation_request.name.artefact_name_caption"),
required: true,
input_width: :large
) do |list|
options.each do |id|
::Projects::CreationWizard::ARTIFACT_NAME_OPTIONS.each do |id|
list.option(
value: id,
label: I18n.t("settings.project_initiation_request.name.options.#{id}"),
selected: id == model.name_artefact_name
selected: id == model.project_creation_wizard_artifact_name
)
end
end
@@ -55,12 +55,6 @@ module Projects
scheme: :primary
)
end
private
def options
%i[project_initiation_request project_creation_wizard project_mandate]
end
end
end
end
+8 -1
View File
@@ -29,11 +29,13 @@
#++
module Projects::CreationWizard
ARTIFACT_NAME_OPTIONS = %w[project_creation_wizard project_initiation_request project_mandate].freeze
extend ActiveSupport::Concern
included do
store_attribute :settings, :project_creation_wizard_enabled, :boolean
store_attribute :settings, :name_artefact_name, :string
store_attribute :settings, :project_creation_wizard_artifact_name, :string
store_attribute :settings, :project_creation_wizard_work_package_type_id, :integer
store_attribute :settings, :project_creation_wizard_status_when_submitted_id, :integer
store_attribute :settings, :project_creation_wizard_send_confirmation_email, :boolean
@@ -43,4 +45,9 @@ module Projects::CreationWizard
store_attribute :settings, :project_creation_wizard_artifact_export_type, :string, default: "attachment"
store_attribute :settings, :project_creation_wizard_artifact_export_storage, :string
end
def project_creation_wizard_name
name = project_creation_wizard_artifact_name || "project_creation_wizard"
I18n.t("settings.project_initiation_request.name.options.#{name}")
end
end
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title I18n.t("projects.wizard.title") %>
<% html_title @project.project_creation_wizard_name %>
<%= render(
Projects::Wizard::PageComponent.new(
-1
View File
@@ -630,7 +630,6 @@ en:
wizard:
sidebar_content_title: "Content"
sections: "Sections"
title: "Project initiation request"
no_help_text: "This attribute has no help text defined."
success: "Project attributes have been saved successfully."
progress_label: "%{current} of %{total}"
@@ -52,7 +52,7 @@ RSpec.describe "Project creation wizard name settings", :js,
expect_and_dismiss_flash(message: "Successful update.")
project.reload
expect(project.name_artefact_name).to eq("project_initiation_request")
expect(project.project_creation_wizard_artifact_name).to eq("project_initiation_request")
end
end
end