https://community.openproject.org/wp/68402
There was a bug where when switching to manual mode and clearing the
dates, the controller would also clear the duration and consider it as
being done by the user (touched field). Then when switching to automatic
mode, before calling the SetAttributesService, start date and finish
date would be discarded because the work package is in automatic mode.
The SetAttributesService would then think that the duration being empty
was done by the user, and would then also unset the finish date. That
lead to the incorrect display of the dates and duration in the date
picker: they would appear as empty instead of having the dates inherited
from the child.
Fix is to also discard the duration if the work package is automatically
scheduled and has children.
This helps differentiating the form when it is initially rendered, or
due to a modification. This distinction is important to decide whether
the live_messages should be rendered or not. Initial rendering of the
dialog should not display live messages, as nothing has changed.
https://community.openproject.org/wp/64603
When it's a milestone being updated, the due date was copied from the
start date. This works when the milestone is in manual scheduling mode,
but when it's in automatic scheduling mode, or when it's switched to
automatic scheduling mode, this copy gives a nil value to the due date,
and due date cannot be set because it's readonly in automatic
scheduling. This lead to the 422 error.
Now the copy of due date from start date is only done if the start date
parameter is present too.
* check if there is a screen reader active on page load
* hide the flat picker for screen readers
* make the banner focusable
* change the focus color in banner
* change disabled to readonly input fields
* change replace_via_turbo_stream to add a message to it
* add live region of github to out project
* add a method to send the aria message
* make it possible to pass the attributes
* pass type of aria live region to front-end based on the action
* remove focused field from date picker
* focus on tabs when there is no banner
* Revert "remove focused field from date picker"
This reverts commit ab5e3060343860e9c34514818f6d9eee59e91ee1.
* focus on the first element when opening the dialog
* remove auto-focus
* undo changes for adding a message
* add a new input method for adding a date and select today as a date
* remove label and name from form input
* change readonly to disabled
* undo changes for date-form
* delete dateform file
* add aria-live for fields in date pickr
* add a turbo stream to the component to load the messages for aria live regions
* undo changes for check f there is an active screen reader
* use settimeout instead of add event listener, so turbo frame also can be used hare
* undo changes for text with link form input
* remove text with link form input
* add documentation for aria-live region
* add an example for using current method in relation creation
* add aria live region in date-pickr dialog
* add some delay for polite messages to make sure it is caught
* send a message to be gotten by screen reader in date picker while changing inputs
* remove aria-live form inputs in date pickr
* show update message after any change in inputs of date picker
* fix rubocup errors in relation controller
* fix rubocup errors in datepicker controller
* fix eslint error
* update docs
* add some details to the aria live doc
* remove test for aria-live on inputs of date pickr
* remove unnecessary live region polite for date picker
* Update lookbook/docs/patterns/18-aria-live.md.erb
Co-authored-by: Henriette Darge <h.darge@openproject.com>
* Update lookbook/docs/patterns/18-aria-live.md.erb
Co-authored-by: Henriette Darge <h.darge@openproject.com>
* fix comment in preview controller
* remove role: alert
* set correct value for target
* move aria turbo stream below live region
* add missing spaces and a better headline for js handling turbo aria action
* move the exception of modals and dialogs to the end of doc file
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update frontend/src/turbo/aria-stream-action.ts
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update app/controllers/work_packages/date_picker_controller.rb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update app/controllers/concerns/op_turbo/component_stream.rb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update app/controllers/work_packages/date_picker_controller.rb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update app/controllers/work_packages/date_picker_controller.rb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* change parameter in update_inputs_aria_live_message string
* change type to politeness
* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
* set delay for polite updates
* use delay in relations tab update and date pickr update
* remove the usage of aria live region update message in relations tab, since we should handle update message here in another way
* use assistive technology instead of screen reader only
* change the stream action to live region
* change the aria action to live region
* remove alert role
* change the string in away that if there is no value for start date, finish date or duration, it shouldn't be part of the string
* remove aria-live from input text fields
* test for updated message in date pickr
* undo changes for relations updates
* check if message is null then return
* add more delay for updating data in date picker
* fix test for adding more delay for updating data in date picker
---------
Co-authored-by: Henriette Darge <h.darge@openproject.com>
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
https://community.openproject.org/wp/63434
The contract class being used was always `WorkPackages::CreateContract`.
It needs to be `WorkPackages::UpdateContract` when the user edits fields
so that the correct permissions are checked.
Also added a spec for the date picker controller.
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.
https://community.openproject.org/wp/62012
When clicking on a date field in single date mode, it used to
reinitialize the flatpickr instance. This happens because it was using a
turbo-stream to update the dialog. When doing so, the node where the
flatpickr is attached is replaced.
We have some logic to avoid this replacement in the preview controller:
it listens to turbo:before-frame-render events and avoids morphing for
tags starting with "opce".
As the logic is already there, this commit uses a turbo-frame instead of
a turbo-stream. This way the flatpickr instance is not replaced and the
calendar view is kept.
The controller had to be updated to alter the work package attributes
with the given params.