206 Commits

Author SHA1 Message Date
Tom Hykel 2e01aff2a3 Merge pull request #23325 from opf/bug/74927-unable-to-change-a-parent-on-bulk-edit-of-work-packages-with-semantic-id
[#74927] Unable to change a parent on bulk edit of work packages with semantic ID
2026-06-03 13:39:06 +02:00
Tom Hykel afe7550851 Merge pull request #23366 from opf/fix/74928-numeric-id-instead-of-semantic-one-on-th
fix(ui): Numeric ID instead of semantic one on the error message on bulk edit (WP #74928)
2026-06-02 17:24:18 +02:00
Tomas Hykel 2ad4ea078a fix(ui): Numeric ID instead of semantic one on the error message on bulk edit (WP #74928) 2026-05-26 23:47:59 +02:00
Tomas Hykel 529bd77587 fix(ui): Numeric ID instead of semantic one in bulk edit work packages (WP #74926) 2026-05-26 23:31:44 +02:00
Tomas Hykel 948fa43321 chore: Remove feature flag for project-based work package identifiers 2026-05-25 17:45:06 +02:00
Tomas Hykel 3fbad33ee1 [#74927] Unable to change a parent on bulk edit of work packages with semantic ID
https://community.openproject.org/wp/74927
2026-05-22 19:10:26 +02:00
Kabiru Mwenja ed4d03d6c3 Cover displayId JSON contract in both modes
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).
2026-05-15 10:59:09 +03:00
Kabiru Mwenja a88698c230 Use where_display_id_in in find_work_packages
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.
2026-04-30 17:44:12 +03:00
Kabiru Mwenja c069e1bcb1 Resolve semantic work package id in find_work_packages
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.
2026-04-30 16:45:27 +03:00
Oliver Günther f695883e27 Properly authorize bulk actions
https://community.openproject.org/work_packages/73345
2026-03-23 14:33:08 +01:00
Klaus Zanders 1fd5469c33 Merge branch 'dev' into merge-release/17.1-20260223152205 2026-02-23 16:25:43 +01:00
OpenProject Actions CI c779e8fc67 Merge branch 'release/17.0' into release/17.1 2026-02-23 14:29:39 +00:00
Kabiru Mwenja c406e7c5c3 Scope journal lookup to work package in activities tab
https://community.openproject.org/wp/72390
https://community.openproject.org/wp/72393
2026-02-23 16:33:31 +03:00
Klaus Zanders 516c42fcf7 Correctly handle error cases for activity tab controller 2026-02-09 15:08:07 +01:00
Klaus Zanders 5ffcb63e05 Remove GET route for bulk delete 2026-02-02 11:50:26 +01:00
Dombi Attila 652551d537 [#68040] Switching a multi select list cf to a single select cf of projects breaks opening the editing modal on the overview page
https://community.openproject.org/work_packages/68040

Change the custom_value_for method signature to always use a custom field.
2025-11-12 20:25:16 +02:00
Christophe Bliard 039f0eea1f Add unit test for bug #68402 2025-10-17 17:03:34 +02:00
Oliver Günther 0dae9a7c9a Restore functionality of bulk edit done_ratio 2025-08-29 11:45:27 +02:00
Christophe Bliard 3065917c8e Merge pull request #19404 from opf/bug/65303-error-on-updating-work-package-progress-tracking
[65303] Display non-progress errors in a top banner
2025-07-15 08:19:09 +02:00
Alexander Brandon Coles 1110f6b91f Merge branch 'dev' into merge-release/16.2-20250709034943 2025-07-09 08:21:02 +01:00
Christophe Bliard 075430d154 [62178] Rename "bulk copy" to "bulk duplicate"
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)
2025-07-03 17:09:55 +02:00
Christophe Bliard e8bdff0cbc [65303] Display non-progress errors in a top banner
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.
2025-07-03 12:15:13 +02:00
Christophe Bliard 029864a859 refactor: use more conventional way to render the progress modal
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.
2025-07-03 11:26:20 +02:00
Dombi Attila 2bb3002748 Use a preview action for the work package datepicker.
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.
2025-07-02 01:21:19 +03:00
Dombi Attila 7a8c424cce Render view to test live region presence. 2025-07-02 01:21:09 +03:00
Eric Schubert e36d115295 [#65242] moved most of the wp types related files to new namespace
- https://community.openproject.org/work_packages/65242
- moved a lot of classes under ::Types or ::WorkPackages::Types to
  ::WorkPackageTypes namespace
2025-06-30 13:31:39 +02:00
Christophe Bliard 775a0dc4a6 [64603] Fix milestone handling when switching from manual to automatic
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.
2025-06-13 18:03:17 +02:00
Behrokh Satarnejad 9b5fedb1ce [62708] Implementing ARIA live regions to communicate contextual changes (#17920)
* 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>
2025-05-21 13:08:21 +02:00
OpenProject Actions CI 21ddc6700a Merge branch 'release/16.0' into dev 2025-05-12 08:42:25 +00:00
Christophe Bliard 16d7501e77 Make expectation more explicit
Co-authored-by: Klaus Zanders <klaustopher@users.noreply.github.com>
2025-05-12 10:13:34 +02:00
Christophe Bliard 6574e2a479 [63831] Fix error 500 when bulk deleting related work packages
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.
2025-05-09 18:01:48 +02:00
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
Bruno Pagno c2886046cd update comment permission names 2025-04-24 13:12:32 +02:00
Christophe Bliard 9fc6f78c5d [63434] Fix read-only error displayed when editing progress values
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.
2025-04-17 11:44:42 +02:00
Christophe Bliard bf7c2536a8 refactor: move progress new action to the collection level
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.
2025-04-17 11:17:44 +02:00
Christophe Bliard be8d290e4c [62580] Fix read-only error displayed when editing progress values
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.
2025-03-28 11:07:19 +01:00
Christophe Bliard 11216aca21 Merge pull request #17235 from opf/feature/42388-new-automatic-scheduling-mode
[59539] Add automatic scheduling mode
2025-02-28 13:23:01 +01:00
Christophe Bliard 1517b7cee0 [59539] Reschedule related work packages when deleting
From the deleted work package, its parent, its successors, and the
successors of its descendants are rescheduled and switched to manual
scheduling if appropriate.
2025-02-25 09:18:28 +01:00
Christophe Bliard aaddc7067f Make test faster by using shared_let helper
from 19 secs to 10 secs.
2025-02-25 09:18:28 +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
Eric Schubert b945d8860c [#61619] fixed controler name
- subject configuration renamed to subject configuration tab to
  emphasize the purpose
2025-02-24 14:05:55 +01:00
as-op 90c5f0fc4e add controller spec 2025-02-17 16:11:12 +01:00
Alexander Brandon Coles b8cb9b13e0 Fix Rubocop offenses in AutoCompletesController spec
Fixes duplicate `describe` blocks and other issues.
2025-02-12 06:36:50 -03:00
Alexander Brandon Coles 1d707895c6 Grammar fixes in code, docs: possessive its/it's
- **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.
2025-02-12 06:36:46 -03:00
Eric Schubert 71f99d2738 [#60518] validate enterprise action in backend
- https://community.openproject.org/work_packages/60518
- if UI is tricked, the update is guarded by an enterprise action,
  prevent persistence
- added unit tests for pattern validation
2025-01-21 12:53:06 +01:00
Eric Schubert d61554501c [#60183] merge pattern collection on update subject pattern
- 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
2025-01-17 13:24:41 +01:00
Eric Schubert de4eb6cfa5 [#60183] add pattern contract validation to subject configuration
- 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
2025-01-17 13:24:27 +01:00
jjabari-op 6757ebabea Merge branch 'dev' into feature/54733-primerise-the-activity-panel 2024-09-25 18:08:15 +02: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
Jonas Jabari 4cc43ff532 extended permission controller specs 2024-09-10 17:40:46 +02:00