25 Commits

Author SHA1 Message Date
Alexander Brandon Coles 801984e8b9 Stabilize time-sensitive feature specs
Use shared_let for frozen feature spec times
2026-03-10 15:26:39 -03:00
Christophe Bliard b06120d4e3 Add ability to use identifiers in table helpers
This allows to use identifiers in table helpers without checking the
subjects. That's useful for work packages with types having
automatically generated subjects.
2025-10-28 10:16:53 +01:00
Kabiru Mwenja b52debb70d Style/ItBlockParameter: Use it block parameter.RuboCopStyle/ItBlockParameter (#19318) 2025-06-26 13:36:49 +03:00
Christophe Bliard 010359aaa3 Make table helpers supports hierarchy column in expect_work_packages
When using `expect_work_packages`, if the column name is `hierarchy`,
the indentations of the work packages names will indicate parent-child
relationships.

So it's possible to check if a work package is parent of another one
along with other properties by writing something like this:

```ruby
expect_work_packages([parent, child], <<~TABLE)
  | hierarchy | duration |
  | parent    |        3 |
  |   child1  |        2 |
  |   child2  |        2 |
TABLE
```

If `child2` is not a child of `parent`, this test would fail.
2025-05-23 14:58:09 +02:00
Christophe Bliard ea2844e939 table_helpers: Add successor relations column type
Example usage:
  | subject      | successors                   |
  | predecessor2 | main, predecessor with lag 2 |
  | predecessor  | precedes main                |
  | main         |                              |
2025-04-01 18:11:10 +02:00
Christophe Bliard 6a836d758e table_helpers: fix bug when defining multiple relations at once
ActiveSupport deep_merge does not concatenate arrays from different
hashes. Relations were stored as an array.

Switch to a hash to store all relations without any loss.
2025-03-28 16:56:52 +01:00
Jan Sandbrink 112ae02926 Update Ruby copyright headers using rake task
This effectively removes the year from a bunch of copyright headers.
We stopped indicating a specific year at some point, but
didn't propagate this change to every file yet.
2025-03-18 14:23:54 +01:00
Christophe Bliard 59825de677 table_helpers: Fix issue with empty tables 2025-02-25 09:12:26 +01:00
Christophe Bliard 26fbc5522a [59539] switch scheduling mode when modifying follows relations
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.
2025-02-25 09:12:25 +01:00
Christophe Bliard c0a3e0edc3 table helpers: rename properties column to predecessors
It was only used to specify predecessors, so it makes more sense, and it
now allows a shorter syntax: "follows wp1, wp2, wp3".
2025-02-25 09:12:24 +01:00
Christophe Bliard f72692d3fe Show non-working days in the rendered table of table helpers 2025-02-25 09:12:22 +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
Christophe Bliard bac76b9f6a Define a 'scheduling mode' column in table_helpers
More expressive code.
2025-02-25 09:12:19 +01:00
Christophe Bliard 2219c89cc4 Add schedule and properties column types to table_helpers
They are taken from the schedule_helpers. It will help writing tests
with many work packages needing both the schedule, some properties
(follows relationships) and some other attributes like automatic/manual
scheduling mode.
2024-11-21 16:08:19 +01:00
Christophe Bliard 86a4b9818e Split TableHelpers::Column into multiple files
Introduce a ColumnType class to better separate responsibilities.

It prepares the merge with schedule helpers.
2024-11-21 16:08:18 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Christophe Bliard d728ea37db Raise an error if there are more cells than headers in a row
It's to prevent silly mistakes when writing and copy-pasting tables in
specs.
2024-05-23 10:51:08 +02:00
Christophe Bliard 4e05da24c1 Table helper can have first line being a comment 2024-05-14 15:31:12 +02:00
Christophe Bliard a89cfa4321 Make match_table work regardless of the order of the work packages 2024-05-02 17:44:41 +02:00
Christophe Bliard 3e6071b425 Fix table helpers: do not ignore header if first row value is empty
When using `match_table` helper, some column were missing on the output.
It's because the headers where read from the first row, and the ones
without any value were stripped out. As this information is used to know
how to pull column data from work packages, the data was missing.
2024-04-08 16:34:04 +02:00
Christophe Bliard a0cfa092a7 Add status column to table helpers
Works by adding the name of the status in the table.

Raises an error if the status name does not exist
2024-04-05 11:24:05 +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 d044c908e0 Introduce let_work_packages helpers
It allows to declare work packages and their properties from a visual
table. It is especially useful to visualize hierarchies and data as if
it were presented in the work package table page in OpenProject app.
2024-01-09 17:47:20 +01:00