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

Updates other affected specs

Marcello Rocha76d4d800d1bf
diff --git a/modules/backlogs/lib/open_project/backlogs/patches/api/work_package_representer.rb b/modules/backlogs/lib/open_project/backlogs/patches/api/work_package_representer.rb
index d84b6df632e..799b98fc41b 100644
--- a/modules/backlogs/lib/open_project/backlogs/patches/api/work_package_representer.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/api/work_package_representer.rb
@@ -37,13 +37,15 @@ module OpenProject::Backlogs
->(*) do
property :position,
render_nil: true,
- skip_render: ->(*) { !(backlogs_enabled? && type && type.passes_attribute_constraint?(:position)) }
+ skip_render: ->(*) do
+ !(backlogs_enabled? && type && type.passes_attribute_constraint?(:position))
+ end
property :story_points,
render_nil: true,
- skip_render: ->(*) {
- !(backlogs_enabled? && type && type.passes_attribute_constraint?(:story_points))
- }
+ skip_render: ->(*) do
+ !(backlogs_enabled? && type && type.passes_attribute_constraint?(:story_points))
+ end
property :remaining_time,
exec_context: :decorator,
@@ -64,7 +66,7 @@ module OpenProject::Backlogs
# cannot use def here as it wouldn't define the method on the representer
define_method :remaining_time= do |value|
represented.remaining_hours = datetime_formatter
- .parse_duration_to_hours(value, 'remainingTime', allow_nil: true)
+ .parse_duration_to_hours(value, 'remainingTime', allow_nil: true)
end
define_method :derived_remaining_time= do |value|
diff --git a/modules/backlogs/lib/open_project/backlogs/patches/work_packages/update_ancestors/loader_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/work_packages/update_ancestors/loader_patch.rb
index 8a0f5b9e628..989c27d9c9c 100644
--- a/modules/backlogs/lib/open_project/backlogs/patches/work_packages/update_ancestors/loader_patch.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/work_packages/update_ancestors/loader_patch.rb
@@ -33,11 +33,11 @@ module OpenProject::Backlogs::Patches::WorkPackages::UpdateAncestors::LoaderPatc
private
def selected_descendants_attributes
- super + %i(remaining_hours derived_remaining_hours)
+ super + %i(remaining_hours)
end
def selected_leaves_attributes
- super + [:remaining_hours]
+ super + %i[remaining_hours derived_remaining_hours]
end
end
end
diff --git a/spec/services/work_packages/update_ancestors/loader_spec.rb b/spec/services/work_packages/update_ancestors/loader_spec.rb
index b44931568a6..be6daaa28fa 100644
--- a/spec/services/work_packages/update_ancestors/loader_spec.rb
+++ b/spec/services/work_packages/update_ancestors/loader_spec.rb
@@ -209,6 +209,7 @@ RSpec.describe WorkPackages::UpdateAncestors::Loader, type: :model do
"id" => hashed_work_package.id,
"ignore_non_working_days" => false,
"parent_id" => hashed_work_package.parent_id,
+ "remaining_hours" => nil,
"schedule_manually" => false }
end
@@ -257,6 +258,7 @@ RSpec.describe WorkPackages::UpdateAncestors::Loader, type: :model do
"id" => hashed_work_package.id,
"ignore_non_working_days" => false,
"parent_id" => hashed_work_package.parent_id,
+ "remaining_hours" => nil,
"schedule_manually" => false }
end