https://community.openproject.org/wp/58011
This makes it possible to have a follower starting the same day a
predecessor ends, or at the same time as a predecessor starts.
Updated allowed lag range to be within -2000 to 2000 days.
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
https://community.openproject.org/wp/62891
For an automatically scheduled successor, when "Working days only" is
turned off and the day before the start date is a non-working day, the
start will shift to an earlier date. Multiple things need to work
correctly:
- The start date must be recalculated and displayed in the date picker.
- The mini calendar of the date picker need to have enabled dates
updated, as the start date has changed.
- If the due date was not set manually, duration must be kept and due
date will be recalculated.
- If the due date was set manually, it must not be changed and duration
will be recalculated.
- If the due date was unset manually, it must remain unset and duration
must be unset too.
Also the lag calculation was partly incorrect: it was adding non-working
days when "Working days only" was on, and days when "Working days only"
was off. This has been fixed: lag is always about working days
regardless of the successor "Working days only" setting.
https://community.openproject.org/wp/63152
When the browser timezone offset is negative, the enabled dates in the
date picker for an automatically scheduled successor were not correct:
the date before the start date was enabled.
This is now fixed.
Most notable is that computation of closest relation has been moved to
the ClosestRelation class.
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
https://community.openproject.org/wp/62607
The order of the relation groups was not consistent from one work
package to another. It's because the relations are returned in any order
from the database.
Instead of getting relations from database and then grouping them by
type as they come up in the array, get the types in the order we want
and build up the relation groups from there.
There are no differences between rendering a `RelationGroup` of type
child and a `RelationGroup` of type relation anymore. For this to
happen, the "children" type had to be renamed "child", which is in line
with the Relation::TYPE_CHILD constant.
https://community.openproject.org/wp/61535
A work package can have ancestors having predecessors. These
predecessors are indirect predecessors of the work package and are
involved in the scheduling if all the ancestors up to the predecessor
are automatically scheduled.
When such an indirect predecessor is present, the work package can be
switched to manual scheduling, even if it has no direct predecessors or
children.
It uses the scope `Relation#used_for_scheduling_of(work_package)` to
find all predecessors involved in scheduling. This encompass both direct
and indirect predecessors.
From the deleted work package, its parent, its successors, and the
successors of its descendants are rescheduled and switched to manual
scheduling if appropriate.
When a work package becomes a successor of another work package, its
scheduling mode is switched to automatic if it has no children so that
it can be scheduled as soon as possible automatically.
Similarly, when a work package is no longer a successor of any other
work package, its scheduling mode is switched to manual if it has no
children and no dates so that it can keep its current dates.
When a follows relation has a delay, and this delay covers some
non-working days, the soonest start date must be computed by having the
delay spanning only on working days, not on non-working days.
In the former implementation, the partial index was not used leading to timouts when fetching the count on all visible relations. On the same database, the join
based approach leads to the sql statement taking 500ms which is not yet ideal but bearable.
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.
Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
* allow free scheduling children of manualy scheduled parents
If a parent has a follows relations with another work package, that relationship also limites children of the work package. But if the work package is scheduled manually, this creates a scheduling barrier. Children of a manually scheduled work package are not hampered by the follows relationships of the parent or other ancestors.
* simplify soonest_start query
* eager load
* extract to scope
Uses FactoryBot to keep and maintain specific records in a special transaction that does not get removed after each spec.
They automatically are created whenever first hitting them.
This makes an excellent time saver for items that are commonly used, such as an admin user account
By restructuring the `or` to be within the subselect, the query engine is able to filter down on the relations way more efficient than before.
As this query is used within WP scheduling, changes to the dates are more performant now. On my setup with about 500k relations on MySql, the change saved about 500ms