29 Commits

Author SHA1 Message Date
Christophe Bliard f1ea26c381 refactor: make tests more expressive and explicit
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
2025-05-28 09:52:06 +02:00
Christophe Bliard 4797465986 [58011] Allow negative lag for predecessor/successor relations
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>
2025-05-28 09:28:32 +02:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Christophe Bliard 7661671465 [62891][63152] Recalculate start date when toggling "Working days only"
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.
2025-04-09 11:45:03 -04:00
Christophe Bliard efb443af6e [59539] Update seeding data to be compatible with new automatic scheduling mode 2025-02-25 09:12:25 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Ivan Kuchin fa5d03eae0 rubocop safe autocorrect all except Rails/WhereRange 2024-05-30 19:54:08 +02:00
Oliver Günther e3e8d78972 Rename delay to lag
https://community.openproject.org/work_packages/44054
2024-04-08 19:31:38 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Dombi Attila 3f07c7d110 [#45450] Implement the api/v3/days/non_working endpoint
https://community.openproject.org/work_packages/45450
2022-12-15 22:04:15 +02:00
Christophe Bliard bb0b02e0db Fix scheduling bug with followers with delay
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.
2022-09-21 16:46:51 +02:00
Christophe Bliard 46987a557f Do not move followers backwards when rescheduling
See https://community.openproject.org/wp/44053

When moving work packages, we try not to move followers except if forced
to satisfy follows relations. In this case the followers are moved
forward.

The work packages in precedes/follows relations can never be moved to an
earlier date automatically. Only the user can move backwards.
2022-09-15 18:21:23 +02:00
Dombi Attila bb107a7223 [#43819] Basic administration for non working days (excluding danger zone)
https://community.openproject.org/work_packages/43819

WorkingDays as Setting
2022-09-12 21:10:10 +02:00
Christophe Bliard 9ac8cd6112 fixup! Refactor: rename factory week_days 2022-09-05 14:31:34 +02:00
Christophe Bliard 4e2dd77892 Refactor: rename factory week_days 2022-09-05 14:31:33 +02:00
Oliver Günther a6b7bee822 Cleanup code for duration / non working days (#11222)
* Remove work_packages_duration_field_active feature flag

  Duration is now globally active for 12.3.0.

* Remove `ignore_non_working_days: false` in tests

  Not needed anymore as it is now the default value. Keep it where the test explicitly refers to it, for clarity.

Co-authored-by: Christophe Bliard <c.bliard@openproject.com>
2022-09-01 15:18:19 +02:00
Christophe Bliard f5ad11f893 Raise error if no working days defined at all
There should be at least one working day defined in the week.
2022-09-01 10:22:54 +02:00
Christophe Bliard 67cd5757b4 Fix computing of days delta starting from a non-working day 2022-09-01 10:22:53 +02:00
Christophe Bliard 3b7bfa3759 Handle computed soonest start being a non-working day 2022-08-24 11:35:54 +02:00
Christophe Bliard e2e66c569d Keep start_date, due_date, and duration in sync 2022-08-18 16:48:18 +02:00
Christophe Bliard 8e224102b7 [#41821] Calculate due date from start date and duration 2022-08-01 10:19:42 +02:00
Christophe Bliard 30cf1e4307 Reschedule correctly if delta covers non-working days 2022-08-01 10:11:44 +02:00
Christophe Bliard f2d591f1e1 [#41821] Partially schedule according to non-working days 2022-08-01 10:11:43 +02:00
Christophe Bliard 905dd195b1 [#41821] Set duration when from date or to date is nil 2022-08-01 10:11:42 +02:00
Christophe Bliard f21bb85168 [#41821] Can compute duration based on defined non working days
Related to: Non working days & duration in scheduling https://community.openproject.org/work_packages/41821
2022-08-01 10:11:42 +02:00