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
Translate hint about auto-generated subjects
Jan Sandbrink70b75eac95e3
diff --git a/app/services/work_packages/set_attributes_service.rb b/app/services/work_packages/set_attributes_service.rbindex 5a312bc2f72..b7fe5d9312f 100644--- a/app/services/work_packages/set_attributes_service.rb+++ b/app/services/work_packages/set_attributes_service.rb@@ -50,7 +50,7 @@ class WorkPackages::SetAttributesService < BaseServices::SetAttributesdef mark_templated_subjectif work_package.type&.replacement_pattern_defined_for?(:subject)- work_package.subject = "Templated by #{work_package.type.name}"+ work_package.subject = I18n.t("work_packages.templated_subject_hint", type: work_package.type.name)endenddiff --git a/config/locales/en.yml b/config/locales/en.ymlindex b45324340e5..4d696f53286 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -717,6 +717,7 @@ en:title: "Workflow missing for work package sharing"message: "No workflow is configured for the 'Work package editor' role. Without a workflow, the shared with user cannot alter the status of the work package. Workflows can be copied. Select a source type (e.g. 'Task') and source role (e.g. 'Member'). Then select the target types. To start with, you could select all the types as targets. Finally, select the 'Work package editor' role as the target and press 'Copy'. After having thus created the defaults, fine tune the workflows as you do for every other role."link_message: "Configure the workflows in the administration."+ templated_subject_hint: Automatically generated through type %{type}summary:reports:diff --git a/spec/services/work_packages/set_attributes_service_spec.rb b/spec/services/work_packages/set_attributes_service_spec.rbindex bfdbc1b9273..71e4c6ebd75 100644--- a/spec/services/work_packages/set_attributes_service_spec.rb+++ b/spec/services/work_packages/set_attributes_service_spec.rb@@ -1969,16 +1969,16 @@ RSpec.describe WorkPackages::SetAttributesService,let(:type) { build_stubbed(:type, patterns: { subject: { blueprint: "{{type}} {{project_name}}", enabled: true } }) }let(:work_package) { WorkPackage.new(type:) }- it "assigns a to be updated value to the field" do+ it "assigns a placeholder value to the field" doinstance.call({})- expect(work_package.subject).to eq("Templated by #{type.name}")+ expect(work_package.subject).to eq(I18n.t("work_packages.templated_subject_hint", type: type.name))endit "overrides even a passed subject" doinstance.call(subject: "I will be overwritten")- expect(work_package.subject).to eq("Templated by #{type.name}")+ expect(work_package.subject).to eq(I18n.t("work_packages.templated_subject_hint", type: type.name))endcontext "when the pattern is disabled" do