The CKEditor mention plugin reads `displayId` (camelCase, stringified)
off each entry to insert `#PROJ-7` or `#1234` into the editor source and
to build the mention's link URL. The contract must hold in both classic
and semantic mode so the frontend doesn't have to branch on identifier
shape, and the comment in the controller cites APIv3 parity as the reason
the value is forced to a String.
Render-views spec asserts the camelCase key, the stringified value, and
the mode-conditional shape (numeric id in classic, semantic identifier
in semantic).
Both :work_package_id (single-WP routes) and :ids (bulk routes) come
from URLs or HTML forms and may carry semantic identifiers, so the
prior numeric-only assumption on :ids was wrong. Route both inputs
through WorkPackage.where_display_id_in, which returns a chainable
scope that matches numeric, current-identifier, and historical-alias
forms in a single query — no per-id round trip and no controller-side
coupling to WorkPackageSemanticAlias.
Tighten the post-move controller spec to assert the redirect URL
contains the destination project's semantic prefix when follow: 1 is
set, which is the path that exercises the moved WP's display_id.
Single-WP routes pass :work_package_id from the URL, which can be a
semantic identifier (e.g. "PROJ-42") since commit 4dfdd6ec5d dropped
numeric pins on the move and copy HAL action links. The bulk
where(id:) lookup in find_work_packages only matches numeric primary
keys, so /work_packages/PROJ-42/move/new returned 404. Translate
:work_package_id through find_by_display_id first; the bulk :ids
branch is untouched since form submissions already send numeric ids.
https://community.openproject.org/wp/62178
Single work package "copy" was changed to "duplicate" (See OP#56900).
To be consistent with this change, other places need to be updated as well.
Updated places are:
- in work packages list
- "Bulk copy" menu action -> "Bulk duplicate"
- in bulk copy screen:
- "Copy" browser title -> "Duplicate"
- "Copy" header -> "Duplicate"
- "Copy" and "Copy and follow" buttons -> "Duplicate" and "Duplicate and follow"
- in duplicate single work package page (create page in disguise):
- "Copy work package" browser title -> "Duplicate work package"
- in permissions:
- "Copy work packages" -> "Duplicate work packages" (permission name is still the same)
https://community.openproject.org/wp/65303
When there are errors on the work package when saving the progress
tracking values, the modal is rendered again with those errors so that
the invalid fields are highlighted and have a validation error message.
When the error is external to the progress modal, for instance a
mandatory custom field or an invalid project phase, it is displayed in a
top banner with a flash message. Before the error was not displayed at
all, leaving users confused as why the progress values could not be
saved.
Render it using our component wrapper and
`update_via_turbo_stream(method: "morph")`. Move `<turbo-frame>` of
progress modal from component to the view to avoid double rendering of
the turbo-frame tag.
Inspired by PR #18152 where a similar was done for date picker modal.
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/63831
When bulk deleting work packages, successors of descendants are
rescheduled, because as they have one less predecessor, they may need to
be switched to manual scheduling mode.
Problem: if one of these successor to reschedule is also a child of the
deleted work package, then it cannot be rescheduled: it's deleted. When
trying to rescheduled and save it, the error
`ActiveRecord::StaleObjectError` is raised.
Solution: only reschedule successors that are not descendants of the
deleted work package.
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.
It does not need a dummy `work_package_id` with value `new` to render
the preview for a work package creation.
Refactored the `DialogPreviewController` to simplify the logic used to
compute the preview url.
https://community.openproject.org/wp/62580
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.
From the deleted work package, its parent, its successors, and the
successors of its descendants are rescheduled and switched to manual
scheduling if appropriate.
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`.
- **it's** is a contraction of _it is_ or _it has_. It requires an
apostrophe.
- **its** is the posssive form of _it_, denoting ownership. It should
not use an apostrophe.
- only replace `subject` key in pattern collection from within subject
configuration controller
- fix tab selection so that default tab does not overwrite parameter
tab due to order
- https://community.openproject.org/work_packages/60183
- rewrite work package type routes
- added new controller for subject configuration
- fixed test expectation values for radio buttons
- removed tests for disabled submit button
- extracted tests to new controller