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
rename key/label to estimates_and_progress
ulfertsb3998d3ddee5
diff --git a/app/models/type/attribute_groups.rb b/app/models/type/attribute_groups.rbindex 13315a7fd2f..235baa21427 100644--- a/app/models/type/attribute_groups.rb+++ b/app/models/type/attribute_groups.rb@@ -43,10 +43,10 @@ module Type::AttributeGroups{assignee: :people,responsible: :people,- estimated_time: :estimates_and_time,- remaining_time: :estimates_and_time,- percentage_done: :estimates_and_time,- spent_time: :estimates_and_time,+ estimated_time: :estimates_and_progress,+ remaining_time: :estimates_and_progress,+ percentage_done: :estimates_and_progress,+ spent_time: :estimates_and_progress,priority: :details}end@@ -55,7 +55,7 @@ module Type::AttributeGroupsmattr_accessor :default_groups do{people: :label_people,- estimates_and_time: :label_estimates_and_time,+ estimates_and_progress: :label_estimates_and_progress,details: :label_details,other: :label_other,children: :"activerecord.attributes.work_package.children"@@ -117,7 +117,7 @@ module Type::AttributeGroups# the default group map.def default_attribute_groupsvalues = work_package_attributes_by_default_group_key- values.reject! { |k, _| k == :estimates_and_time } if is_milestone?+ values.reject! { |k, _| k == :estimates_and_progress } if is_milestone?default_groups.keys.each_with_object([]) do |groupkey, array|members = values[groupkey]diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erbindex 345bad49aa1..3ede750a304 100644--- a/app/views/versions/show.html.erb+++ b/app/views/versions/show.html.erb@@ -69,7 +69,7 @@ See COPYRIGHT and LICENSE files for more details.<% if @version.estimated_hours > 0 || User.current.allowed_in_project?(:view_time_entries, @project) %><div class="widget-box -thin"><fieldset class="form--fieldset">- <legend class="form--fieldset-legend"><%= t(:label_estimates_and_time) %></legend>+ <legend class="form--fieldset-legend"><%= t(:label_estimates_and_progress) %></legend><table><tr><td width="130px" align="right"><%= Version.human_attribute_name(:estimated_hours) %></td>diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 0d669e7c74a..8a7351f6ebc 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -2041,7 +2041,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}label_enterprise_support: "Enterprise support"label_enterprise_addon: "Enterprise add-on"label_environment: "Environment"- label_estimates_and_time: "Estimates and progress"+ label_estimates_and_progress: "Estimates and progress"label_equals: "is"label_everywhere: "everywhere"label_example: "Example"diff --git a/db/migrate/20240422141623_rename_estimate_and_time_attribute_group.rb b/db/migrate/20240422141623_rename_estimate_and_time_attribute_group.rbnew file mode 100644index 00000000000..fbc4a01debc--- /dev/null+++ b/db/migrate/20240422141623_rename_estimate_and_time_attribute_group.rb@@ -0,0 +1,15 @@+class RenameEstimateAndTimeAttributeGroup < ActiveRecord::Migration[7.1]+ def up+ execute <<~SQL.squish+ UPDATE types+ SET attribute_groups = REPLACE(attribute_groups, '- - :estimates_and_time', '- - :estimates_and_progress')+ SQL+ end++ def down+ execute <<~SQL.squish+ UPDATE types+ SET attribute_groups = REPLACE(attribute_groups, '- - :estimates_and_progress', '- - :estimates_and_time')+ SQL+ end+enddiff --git a/modules/backlogs/lib/open_project/backlogs/engine.rb b/modules/backlogs/lib/open_project/backlogs/engine.rbindex b4d870efeac..50f1d865d86 100644--- a/modules/backlogs/lib/open_project/backlogs/engine.rb+++ b/modules/backlogs/lib/open_project/backlogs/engine.rb@@ -200,7 +200,7 @@ module OpenProject::Backlogsendend- ::Type.add_default_mapping(:estimates_and_time, :story_points)+ ::Type.add_default_mapping(:estimates_and_progress, :story_points)::Type.add_default_mapping(:other, :position)::Queries::Register.register(::Query) dodiff --git a/spec/features/types/form_configuration_spec.rb b/spec/features/types/form_configuration_spec.rbindex b407d3a5400..2b8c93a0a32 100644--- a/spec/features/types/form_configuration_spec.rb+++ b/spec/features/types/form_configuration_spec.rb@@ -128,7 +128,7 @@ RSpec.describe "form configuration", :js do{ key: :assignee, translation: "Assignee" },{ key: :responsible, translation: "Accountable" }- form.expect_group "estimates_and_time",+ form.expect_group "estimates_and_progress","Estimates and progress",{ key: :estimated_time, translation: "Work" },{ key: :remaining_time, translation: "Remaining work" },@@ -180,7 +180,7 @@ RSpec.describe "form configuration", :js do"Cool Stuff",{ key: :responsible, translation: "Accountable" }- form.expect_group "estimates_and_time",+ form.expect_group "estimates_and_progress","Estimates and progress",{ key: :estimated_time, translation: "Work" },{ key: :remaining_time, translation: "Remaining work" },@@ -200,7 +200,7 @@ RSpec.describe "form configuration", :js do# Test the actual type backendtype.reloadexpect(type.attribute_groups.map(&:key))- .to include("Cool Stuff", :estimates_and_time, "Whatever", "New Group")+ .to include("Cool Stuff", :estimates_and_progress, "Whatever", "New Group")# Visit work package with that typewp_page.visit!diff --git a/spec/services/create_type_service_spec.rb b/spec/services/create_type_service_spec.rbindex f0ebd9f9349..a08ecde824b 100644--- a/spec/services/create_type_service_spec.rb+++ b/spec/services/create_type_service_spec.rb@@ -52,7 +52,7 @@ RSpec.describe CreateTypeService doit "does include the progress attribute group" doexpect(service_call.result.attribute_groups.map(&:key))- .to eql %i[people estimates_and_time details costs]+ .to eql %i[people estimates_and_progress details costs]endendend