54 Commits

Author SHA1 Message Date
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
Henriette Darge f0c723ae43 Allow editing the finish date in automatic scheduling mode 2025-03-31 08:27:17 +02:00
Christophe Bliard c8f1454bb7 [62261] Fix error displayed when switching parent to automatic
https://community.openproject.org/wp/62261

When switching a parent to automatic scheduling mode, the date picker
displayed an error because the dates set in manual mode are reused.

Fix is to dismiss dates from `params` when the scheduling mode is
automatic, so that the dates are always computed.
2025-03-20 13:02:53 +01:00
Christophe Bliard b3642054f8 [62362] Show "working days only" checkbox only if date form is shown too
https://community.openproject.org/wp/62362

When clicking the checkbox, it takes all form data and sends it to the
server for rerendering the form with the value updated.

Problem is: when the date form is not displayed and the "no
predecessors" message is displayed instead, there is no form data, so it
sends incomplete data to the server, and the server renders a minimalist
form.

The fix is to hide the checkbox too if the other form elements are hidden.
No checkbox, no click, no problem.
2025-03-20 11:36:17 +01:00
Christophe Bliard d47295bafb [61979] Switch successor to automatic mode even without rescheduling
https://community.openproject.org/wp/61979

Switching to automatic mode was done in `ScheduleDependency` before. As
the scheduling mode was changed outside of the `SetScheduleService`, it
was not seen as a change and no dependent result was saved and
eventually the scheduling mode change was not persisted.

By moving the scheduling mode change to the `SetScheduleService`, the
dependent results are now correctly saved and the scheduling mode change
is persisted.
2025-03-17 11:46:41 +01:00
Christophe Bliard 9896908867 [61965] Switch parent to automatic mode when adding first child
https://community.openproject.org/wp/61965
https://community.openproject.org/wp/61054

If a manually scheduled work package has no direct or indirect
predecessors and no children, it switches to automatic scheduling mode
when a child is added.

This fixes the scenario 29 from #61054 and bug #61965. Other scenarios
have been implemented too. 4 of them still need to be implemented.
2025-03-17 10:47:26 +01:00
Oliver Günther b438d67f9a Change scheduling mode journal label
https://community.openproject.org/work_packages/62091
2025-03-12 13:06:36 +01:00
ulferts dbce860782 Merge remote-tracking branch 'origin/dev' into feature/47519-single-date-mode-for-work-package-date-pickers 2025-03-05 12:09:05 +01:00
ulferts c5841b690b remove pending as the spec is stable locally 2025-03-05 10:00:17 +01:00
Dombi Attila 5c1787f662 Wait for the datepicker toggle to finish loading
This is required to prevent submitting the datepicker form too quickly,
before the toggle happens.
2025-03-04 19:14:07 +02:00
Henriette Darge 55ab827f84 Merge branch 'dev' into feature/47519-single-date-mode-for-work-package-date-pickers 2025-03-04 14:06:32 +01:00
Dombi Attila 9980f2e513 Disable flaky spec until it's fixed. 2025-03-03 19:07:29 +02:00
Christophe Bliard a9176a6b43 Merge branch 'feature/42388-new-automatic-scheduling-mode' into feature/47519-single-date-mode-for-work-package-date-pickers 2025-02-28 10:04:21 +01:00
Christophe Bliard 66e66a9b87 Added test outlines for wp 61054, but do not implement them yet
There are more important things to do to ensure this can be merged
before 15.4 freeze. In the meantime, we'll test these scenarios
manually and implement them later.
2025-02-26 12:10:23 +01:00
Henriette Darge 8d726ced6c Adapt tests to new single-date mode 2025-02-26 08:36:10 +01:00
Christophe Bliard 1bdcb56d67 Start adding automated tests from scenarios in wp #60670
https://community.openproject.org/wp/60670
2025-02-25 17:41:07 +01:00
Christophe Bliard b5d320a124 Fix broken feature test 2025-02-25 09:12:23 +01:00
Christophe Bliard 2d7288d317 [59539] Make work packages manually scheduled by default
The `schedule_manually` column is also non-nullable now.

This includes the following changes:

- Automatically scheduled parent dates are and `ignore_non_working_days`
  attributes are now always derived from children's values, even if the
  children are scheduled manually.

  It's more natural. Without that, adding a child to a work package
  would not change the parent's dates.

  As a consequence, the parent can start on a non-working day if one of
  its children is manually scheduled, ignores non-working days, and
  starts on a non-working day. That's why the parent's
  `ignore_non_working_days` attribute is now also derived from all its
  children regardless of the scheduling mode.

  If the parent is manually scheduled, its dates and it's ability to
  ignore non-working days will still be defined independently from its
  children.

- Fix tests broken by scheduling mode being manual by default.

  The tests had to be adapted to explicitly set scheduling mode to
  automatic for followers and parents, and sometimes even follower's
  children. Without it, work packages would not be rescheduled
  automatically.

- Replace schedule helpers with table helpers.

  Schedule helpers helped well, but table helpers are more flexible and
  support more column types.

- Add "days counting" and "scheduling mode" columns to table helpers.

  "days counting" to set `ignore_non_working_days` attribute.
    - "all days" value maps to `ignore_non_working_days: true`.
    - "working days" value maps to `ignore_non_working_days: false`.
  "scheduling mode" to set `schedule_manually` attribute.
    - "manual" value maps to `schedule_manually: true`.
    - "automatic" value maps to `schedule_manually: false`.
2025-02-25 09:12:22 +01:00
Jonas Jabari 10228cbf8f fixed gitlab specs 2025-01-22 17:18:11 +01:00
Jonas Jabari e81e9845f4 fixed scheduling_mode_spec 2024-11-26 18:32:19 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +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 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +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 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard aa23106c11 lint: autocorrect RSpec/FactoryBot/ConsistentParenthesesStyle
command is

    rubocop -A --only RSpec/FactoryBot/ConsistentParenthesesStyle modules spec
2023-03-07 15:04:32 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther 6c44ee5ae9 Update spec helper to select with new switches 2022-09-27 08:29:30 +02:00
ulferts 189d2b8b9f Revert "[#43884] Change wording on manual scheduling activity"
This reverts commit f87c147cb4.
2022-09-20 14:08:12 +02:00
ulferts bc62c00af3 Merge pull request #11298 from opf/feature/44053-disregard-distance-between-related-work-packages-when-scheduling
Do not move followers backwards when rescheduling
2022-09-16 11:22:30 +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
Dmitrii f87c147cb4 [#43884] Change wording on manual scheduling activity 2022-09-15 11:47:22 +03: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
Oliver Günther 5a52c02a85 Adapt scheduling spec to use the toggle buttons 2022-08-30 08:50:31 +02:00
Henriette Darge 882355c4d9 Adjust end date if a start date is entered that is after the current start date 2022-07-29 14:09:12 +02:00
Christophe Bliard 60924386a0 Merge pull request #10645 from opf/feature/31992-duration-as-column
Duration as an explicit work package column
2022-05-31 17:45:55 +02:00
Henriette Darge 00c540cf7d Remove parent warning check from spec as it is not displayed any more 2022-05-30 14:17:13 +02:00
ulferts 941ae9628f linting hash value 2022-05-25 14:52:26 +02:00
ulferts 6baa2af387 use dates in feature specs 2022-05-25 14:51:56 +02:00
ulferts 491928a3fd replace typed_dag with closure_tree and CTE 2022-03-29 12:02:55 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Benjamin Bädorf 3aaac1c7ce Rename most notification to toaster instances (#9765)
* Rename most notification to toaster instances

* Frontend builds

* Fix spec build

* Rename more notification elements to toaster

* Rename toaster-box to op-toast

* Fix op-toast-container

* Rename toasters upload progress

* Try fixing page.rb toaster check

* Fix some specs, break some others

* Correctly overwrite toast_type

* Fix more specs

* Fix one more notification to toaster rename

* Fix linting errors, harmonize naming more

* Remove byebug debugging statement

* Remove byebug debugging statement

* Rename notification in the backend, too

* Rename more instances of notifications to toastService

* Rename backend back to notification since bundle gems expect it there

* expect_toaster -> expect_toast

Co-authored-by: Henriette Darge <h.darge@openproject.com>
2021-11-04 16:25:55 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
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
2021-01-13 17:47:45 +01:00
ulferts 3a3a48e267 journalize changes to the scheduling mode 2020-08-04 08:12:51 +02:00
ulferts 74fe191997 handle switching from manual to automatic 2020-07-21 09:47:09 +02:00
ulferts 4dc11b7240 handle switching from automatic to manual 2020-07-21 09:47:09 +02:00