28 Commits

Author SHA1 Message Date
Kabiru Mwenja b52debb70d Style/ItBlockParameter: Use it block parameter.RuboCopStyle/ItBlockParameter (#19318) 2025-06-26 13:36:49 +03:00
Christophe Bliard ebb1987bc2 Fix progress popover features tests
Debounce value was changed in the app part, but was not updated in the
test.

Also, changed the way the field is focused to avoid the select to be
opened (because it could stay opened sometimes). And for input fields
being focused, it required to also move the carte to the end of the
input before clearing it. It was not needed before because we used to
click in the field to give focus, and clicking also moves the caret to
the end (most of the time).
2025-02-25 09:18:10 +01:00
Christophe Bliard 4ac1b1ca7a Remove :percent_complete_edition feature flag
% complete edition will be released in 14.6
2024-09-25 15:31:11 +02:00
Christophe Bliard b676e4b3c6 Fix flakiness when checking progress field focus state 2024-09-17 14:21:30 +02:00
Christophe Bliard 0a5765f21a Fix lost progress popover state on submit with invalid values
When submitting with invalid values, the progress popover was updated
via turbo-stream with a modal which did not include the touched fields.
This caused the fields to be ignored on the second submit, even if they
appeared to be invalid. This was also causing the preview to not work as
expected.

This has been changed:
- the update is done through a turbo-stream morph instead of an update.
  It avoids disconnecting and reconnecting the stimulus controllers.
- the touched fields are now correctly sent to the component for
  rendering. The state is maintained in the stimulus controller instead
  of the hidden fields. Fields are still needed for form submission.
- the fields sent to the server when previewing are exactly the same as
  the ones being sent on submit.
- the turbo_stream commands are sent directly from the controller. None
  are sent if the update completed successfully as the modal will be
  closed by client side javascript anyway.
- the referrer-field is now just the field name instead of the full
  work package key, to reduce noise.
2024-09-17 13:49:35 +02:00
Christophe Bliard 78ef2f98f1 [57258] Display derivation hints in status-based mode
https://community.openproject.org/wp/57258

It was calculated but not displayed. This is now covered by a feature
test.

In the progress popover, when the input is a select, the event being
listened to to render a preview is `change` instead of `input. It's
because cuprite does not emit the `input` event when selecting an option
in a select input. It only emits `change`. `ProgressEditField` has been
updated to correctly focus and change the value of a select (for
status selection inside the popover).

Also to allow `ProgressEditField#expect_modal_field_value` to work
regardless of the field being disabled or readonly, the disabled value
default to `:all` which matches both disabled and enabled inputs, and
the `readonly` parameter has been removed. To check for it, call
`ProgressEditField#expect_modal_field_read_only` directly instead.
2024-08-30 18:00:39 +02:00
Christophe Bliard 93a6873dd9 [57512] Make it easier to clear all fields
https://community.openproject.org/wp/57512

When work is modified and remaining work and % complete are both empty,
the % complete field should not be untouched because that would lead to
it having a value again, which is tedious when one wants to clear all
values.
2024-08-28 14:57:53 +02:00
Christophe Bliard 078d21c3dc Keep Work value when it's set
If Remaining work and % Complete are both modified and Work is initially
empty, then it will be derived, but if it is set then it's % Complete
and Remaining work which will change.

The goal is to keep the Work value unchanged as much as possible.
2024-08-22 12:17:16 +02:00
Christophe Bliard 217be2e4b5 Fix test: turn some no-ops into real expectations
That's why tests should be red before turning them green.
2024-08-22 10:20:36 +02:00
Oliver Günther 12ee9e6b83 Merge remote-tracking branch 'origin/idea/56781-remove-years-from-copyrights' into dev 2024-08-06 10:17:59 +02:00
Christophe Bliard e027383487 Fix test flakiness 2024-08-01 12:16:47 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Christophe Bliard 38fcd07836 [52233] Add feature flag for modification of % complete field
Feature flag is percent_complete_edition. So % complete edition will be
shipped but disabled in 14.4.

It will eventually be activated in 15.0 when there will be a total %
complete calculation mode so that we can bundle both features together
in one release.
2024-07-17 17:24:04 +02:00
Christophe Bliard 706c5b228a Fix progress value live preview in new work package page
The values were not retained between modifications of percent values, so
a new parameter `initial` was introduced to "save" the entered values
between edits.

It also fixed the progress modal having empty values when opening it a
second time in the create work package page.
2024-07-15 17:32:33 +02:00
Christophe Bliard 0d79dba094 No longer display migration warning when only % complete is set
Because now we can set it.
2024-07-12 14:11:58 +02:00
Christophe Bliard 4fabb80cf9 Merge branch 'release/14.0' into feature-add-turbo-frame-morphing 2024-04-23 08:56:39 +02:00
Christophe Bliard 4354d8f239 Make the test pass with a sleep
I do not like sleep like this. But because I do not manage to find a
better synchronization strategy for the turbo stream to come back and
update values, I prefer something slow and working than something fast
an breaking. Using `page.driver.wait_for_network_idle` does not seem to
wait for long enough as Angular has to do its Angular things to update
the model being created.

Please fix it if you can.
2024-04-22 17:42:39 +02:00
Christophe Bliard 00c078e535 [54370] Prevent error when saving unset progress modal
See https://community.openproject.org/wp/54370

It was producing a 500 error.
2024-04-22 16:09:55 +02:00
Aaron Contreras 7c8d75e5d7 Render help text for missing values only on work-based mode 2024-04-12 08:07:08 -05:00
Aaron Contreras 1c0780313d Render migration warning banner message when % complete is the only field set 2024-04-09 23:17:45 -05:00
Aaron Contreras 2c52c4129c Ensure only valid status transitions are allowed in the modal 2024-04-09 16:49:59 -05:00
Aaron Contreras 984032e785 Add feature specs for status-based modal behavior 2024-04-08 12:16:47 -05:00
Aaron Contreras 7e769b1ecf Render the minimum fractional part for numeric fields in progress modal
This ensures that 10.0 is rendered as 10, 5.50 rendered as 5.5 and
5.75 rendered as 5.75.
2024-04-05 00:37:11 -05:00
Aaron Contreras 4fd98ef65b Disable editing values on the progress display fields
* Ensures interactions are solely via the modal.
2024-04-05 00:11:16 -05:00
Aaron Contreras dcc1144243 Add feature specs for possible modal scenarios 2024-04-05 00:11:12 -05:00
Aaron Contreras 6e2ab1b545 Distinguish field selectors in specs based on create/update context
The selector for the progress edit fields varies based on whether it's
in a create or update context. This commit ensures that this
distinction is made when inferring the `#display_selector` method and
provided by the WorkPackageTable object.
2024-04-04 10:46:31 -05:00
Aaron Contreras 75e36e4425 Fix update_ancestors_spec for split view create
* This needs a better solution down the line to deal with the progress
  modal being able to deal with intermediate updates without actually
  persisting on create pages.
2024-04-04 07:58:38 -05:00
Christophe Bliard cc0868ef36 Fix test features/work_packages/share/access_spec.rb
By refactoring ProgressEditModal to inherit from EditField. The class has been renamed to ProgressEditField as it is about editing a field rather than the modal itself.
2024-03-29 17:32:48 +01:00