-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#57529] Add options for sum totals calculation mode in hierarchies #16649
[#57529] Add options for sum totals calculation mode in hierarchies #16649
Conversation
329b1ac
to
a630784
Compare
677ecbb
to
dfddcbb
Compare
0bd1e6d
to
bc12c60
Compare
* Adds the settings to the definitions file. * Sets the default and allowed values.
* Adds setting into derivation code. * Adds specs for the simple average mode calculation.
Now the settings can be changed from the UI.
* Fixes cuprite flag to enable cuprite in this spec file.
* Missing to add journal entries
Calculation of % Complete hierarchy totals should be the second setting on the form
* Triggers job * Adds journal entries with specs and translations
36ae30b
to
27e5d87
Compare
* Adds temporary depth table - Could be cleaned up down thie line with the `work_package_hierarchies` table.
27e5d87
to
1f12393
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work so far 👏
I only looked at code so far. I need to play a bit with it now.
In `WorkPackages::UpdateAncestors::Loader`, the returned elements are not always `WorkPackageLikeStruct` instances: whenever possible the loader reuses knows instances of `WorkPackage` when looking for ancestors or descendants.
In this case, there is no calculated simple average: the ∑ % Complete should be cleared.
I'm not sure why it fails now while it did not before. Maybe it's when switching to cuprite. Anyway this test is not worth enough to bother fixing it.
Just to be extra-sure this case is handled correctly in jobs as well.
Reuse and duplicate a lot of logic from the other job. It needs to be reworked, but it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. I think it's good to go now.
@@ -188,7 +188,6 @@ def update_totals | |||
if Setting.total_percent_complete_mode == "work_weighted_average" | |||
update_total_percent_complete_in_work_weighted_average_mode | |||
elsif Setting.total_percent_complete_mode == "simple_average" | |||
update_total_percent_complete_in_work_weighted_average_mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Ticket
https://community.openproject.org/work_packages/57529
What are you trying to accomplish?
Adding a new setting in order to allow users to determine the way in which they'd like sum totals of percent complete in work package hierarchies to be calculated.
Screenshots
Not yet
What approach did you choose and why?
UpdateAncestorsService
to calculate the total % complete based on the current Setting value.Merge checklist