1691 Commits

Author SHA1 Message Date
Tobias Dillmann b698ef9eb6 Catch malformed filter parameters 2026-06-11 09:13:49 +02:00
Kabiru Mwenja f94d7b0bfc Resolve the changes-filter predecessor once in a journals CTE
The :only_changes filter re-seeked each journal's predecessor in every EXISTS
branch (~7 LATERAL lookups per row). A CTE now shadows the journals table,
exposing predecessor_id/predecessor_data_id once per row, and each branch reads
those columns instead. On a 703-journal work package this cuts the COUNT from
~1.13M to ~35K shared buffers.
2026-06-09 10:25:21 +03:00
Jens Ulferts 6885ca695d Merge pull request #23580 from opf/merge-release/17.5-20260605114354
Merge release/17.5 into dev
2026-06-05 16:42:32 +02:00
Kabiru Mwenja fd22629702 Code Maintenance/STC-462: Tidy the activity-tab paginator and centralise filter modes (#23552)
https://community.openproject.org/wp/STC-462

Two readability passes over the work package activity tab, no behaviour change. The paginator's private methods are reordered to follow their call order so the file reads top-down from `#call`, and the three activity filter modes (`:all`, `:only_comments`, `:only_changes`) — until now bare symbols duplicated across the controller, paginator, journal components and the hidden form — move into a single `WorkPackages::ActivitiesTab::Filters` module so the modes have one source of truth and can't drift apart. The diff reaches beyond the paginator into the controller, several components and a form, since that's where the symbols were scattered.
2026-06-05 16:50:08 +03:00
ulferts 4f5a52edf9 Merge remote-tracking branch 'origin/dev' into merge-release/17.5-20260605114354 2026-06-05 13:44:46 +02:00
Kabiru Mwenja 5fdf57df69 Defer activity-tab sequence_version to anchor resolution
The work package activity tab computed a per-journal sequence_version on
every render — a ROW_NUMBER() window function over a LATERAL join — only to
stamp the legacy data-anchor-activity-id that #activity-N deep links rely on.
Nothing mints those links anymore; copy and share links use
#comment-<journal id>, which needs no extra query.

The activity number is now resolved on demand. Only a request carrying
?anchor=activity-N runs the window function, mapping the number to a journal
id the paginator exposes as resolved_anchor. The view hands that to the
client, which rewrites #activity-N to the canonical #comment-<id> and scrolls
using the comment anchor already present in the DOM. Default renders no longer
touch the window function.

References WP #68063.
2026-06-05 14:26:04 +03:00
Kabiru Mwenja 376f5fcdc3 Code Maintenance/STC-462: Move work package activity tab from in-memory to database-level pagination (#23434) 2026-06-05 14:21:47 +03:00
Henriette Darge 6c04182dff Simplify test case 2026-06-04 09:05:50 +02:00
Behrokh Satarnejad 8801288af0 Clean stale attributes in type form configuration 2026-06-03 16:16:42 +02:00
Oliver Günther 11dc79a74d Merge remote-tracking branch 'origin/release/17.5' into dev 2026-06-02 16:22:39 +02:00
Oliver Günther 9993792dbf Merge remote-tracking branch 'origin/release/17.4' into release/17.5 2026-06-02 16:22:18 +02:00
Oliver Günther 2a6412d5ae Merge remote-tracking branch 'origin/release/17.3' into release/17.4 2026-06-02 16:22:05 +02:00
Oliver Günther bef69b6aaf Parse query params as a separate options hash, not kwargs 2026-06-02 16:21:14 +02:00
OpenProject Actions CI b2f72fd486 Merge branch 'release/17.5' into dev 2026-05-30 04:49:04 +00:00
Tomas Hykel baf9f7f2c9 fix: Stability fixes for the identifier conversion procedure 2026-05-29 13:09:26 +02:00
OpenProject Actions CI 3e02e2863f Merge branch 'release/17.5' into dev 2026-05-28 12:18:34 +00:00
Tomas Hykel 7e3fbfbb65 Revert "increase to 10 chars for good measure"
This reverts commit 941230671c.
2026-05-28 13:23:51 +02:00
Tomas Hykel accd7a0628 fix an unrelated test 2026-05-28 13:22:08 +02:00
Tomas Hykel 941230671c increase to 10 chars for good measure 2026-05-28 13:21:05 +02:00
Tomas Hykel a8005ff6d4 just use project-{random_suffix} 2026-05-28 13:20:03 +02:00
Tomas Hykel 5343c1139d use a random suffix instead 2026-05-28 13:07:05 +02:00
Tomas Hykel ccc3a004d6 fix(db): Conversion stuck and not resumable for users after validation error during conversion job (WP #75170) 2026-05-28 12:52:24 +02:00
OpenProject Actions CI 49b802ca02 Merge branch 'release/17.5' into dev 2026-05-28 08:51:09 +00:00
Kabiru Mwenja 23d52fcf1c Drop semantic_work_package_ids flag annotations
The feature flag is gone on release/17.5 (PR #23324); the
`with_settings: { work_packages_identifier: ... }` annotation alone
is enough to pin classic vs semantic behaviour in each context.
2026-05-26 14:24:03 +03:00
Kabiru Mwenja 6e3068531f Write primary-key WP refs in auto-generated journal notes
The earlier write-time canonicalization stored the rendered
display_id ("#PROJ-7") in the journal note, which would rot under
project-identifier renames and leave dangling semantic strings if
semantic mode were rolled back. Restore the PK shape ("#42") and
let the formatter pipeline turn it into the user-facing identifier
at render time, where the resolver already handles both modes.

Both spec contexts now assert the same PK shape; the mode-specific
rendering of "#N" lives in the formatter specs.
2026-05-26 14:19:25 +03:00
Kabiru Mwenja 878048f8e8 Resolve WP labels across visibility boundaries in text macros
The macro preload was visibility-scoped — references to work packages the
recipient cannot see would fall through to the literal `#43` shape, even
when the same reference rendered as `DCP-1` for an author with full view
permission. Notification recipients saw misleading numeric ids for cross-
project references in journal notes.

Splits label resolution from link gating:

- `ResourceLinksMatcher.build_lookup` now does an unscoped fetch for the
  primary identifier and a separate visibility-scoped id pluck. The link
  handler reads `visible_to_current_user?` to decide between a navigable
  anchor and a plain-text label.
- `UpdateAncestorsService#set_journal_note` writes `#display_id` so new
  notes carry the semantic shape at the source; render-time resolution
  heals legacy `#N` content for users with view permission.

Tradeoff: a recipient without view permission now sees the WP's semantic
identifier (e.g. `DCP-1`) as plain text rather than `#43`. The reference's
existence was already disclosed by the stored journal text; the project
identifier is the only new piece of information surfaced, and is not
treated as a secret elsewhere in the system (URLs, exports, API).
2026-05-26 14:18:48 +03:00
Alexander Brandon Coles 1ba2dd2775 [#75314] Replace deprecated Pagy max_pages option
Pagy 43.4.3 deprecated `:max_pages` and recommends capping records
before pagination instead. Caps the combined array in `base_journals`.

https://community.openproject.org/wp/75314
2026-05-26 11:56:20 +02:00
Tomas Hykel 948fa43321 chore: Remove feature flag for project-based work package identifiers 2026-05-25 17:45:06 +02:00
Mir Bhatia 14b4228be7 Merge pull request #23283 from opf/bug/73494-role-not-created-properly-when-unselecting-all-permissions
[#73494] Role not created properly when unselecting all permissions
2026-05-21 15:36:01 +02:00
Tomas Hykel 1ce03faa03 feat: Improve progress reporting during identifier conversion 2026-05-20 20:27:43 +02:00
Jens Ulferts 0ceaa2617c Merge pull request #23181 from opf/code-maintenance/74768-remove-calculated_value_project_attribute-feature-flag
[#74768] Remove calculated_value_project_attribute feature flag
2026-05-20 16:09:46 +02:00
Mir Bhatia 9937d62cad Allow explicitly setting no permissions on role creation 2026-05-20 11:24:13 +02:00
Dombi Attila 93594ec0f2 Merge pull request #23127 from opf/code-maintenance/74402-centralize-move-action-in-controllers
[#74402] Centralize move action in controllers
2026-05-19 19:43:36 +03:00
Dombi Attila 3b0642db88 Implement ServiceResult#bind to allow chaining successful service call operations. 2026-05-19 18:58:28 +03:00
Ivan Kuchin b648341030 [#74768] Remove calculated_value_project_attribute feature flag
https://community.openproject.org/wp/74768
2026-05-19 17:42:42 +02:00
Pavel Balashou 5af7d211c8 [#74977] Modify friendly_id_slugs constraints.
https://community.openproject.org/wp/74977

Add NOT NULL to *sluggable_type* and fix NULL *scope* uniqueness in *friendly_id_slugs*

- Delete duplicate NULL *scope* rows, keeping the most recent per (slug, sluggable_type)
- Delete NULL *sluggable_type* rows before adding NOT NULL constraint
- Replace unique index on (slug, sluggable_type, scope) with NULLS NOT DISTINCT variant (requires Postgres 15+)

Why?

1. *sluggable_type* NOT NULL
  every slug must belong to a model (e.g. Post, User). A slug with no *sluggable_type* is orphaned and meaningless.
2. NULLS NOT DISTINCT in the unique constraint
  not treating every NULL *scope* as unique leads to duplicate records if *scope* is NULL which does not make sense
  and pollutes the table with unnecessary data
2026-05-19 11:14:41 +02:00
Tomas Hykel 506198d55d chore: Consolidate classic project ID generation 2026-05-18 14:15:20 +02:00
Tomas Hykel e07f2006f6 remove the dot/bang conversion 2026-05-17 15:25:00 +02:00
Tomas Hykel 4e5ae54077 Fix ClassicIdentifierSuggestionGenerator to reject all-numeric slugs 2026-05-17 15:16:05 +02:00
Tomas Hykel b606031356 TDD time! 2026-05-17 13:35:22 +02:00
Tom Hykel 93e2a2bef7 Merge pull request #22938 from opf/fix/semantic_conversion_patches_4
fix: Do not trigger notifications during project identifier migration
2026-05-13 14:27:38 +02:00
Behrokh Satarnejad d924c255cf [69524] Primerize Types form configuration page (#22854)
* Create the section component

* Create the form configuration component

* Create a controller

* change form template

* Use primer dialog for reset to defaults button

* show WP configuration modal while creating a related WPs table

* Fix the drag and drop functionality without save button

* Fix renaming functionality

* Use generic drag and drop in form configuration and move all client side action handling to server side

* Fix embedded query form configuration regressions

* Add data test selectors to all elements that we used for test

* update the current tests with the new implementations and design

* Add new tests for new controller of sections and rows

* WP quesry row should only have edit quesry action

* Update transformer spec regarding the new changes

* Fix the failing test in reset form configuration and some tests for actions

* Fix rubocop errors

* Fix eslint errors

* Add spec for removing a section

* Use condensed border boxes

* fix failing specs

* fix failing specs

* Switch the buttons in form configuration component

* Create the section at the top of the list

* Instead of using UUID, use the name of the group as the key

* Add missing check for EE for section actions

* Remove angular components

* Use action list instead of a border box for left side panel

* Reduce the margin between the right side panel and sub header, add some space to the query table left side, span to the whole available space

* Show validation errors while updating and creating a section

* Use a danger dialog for reset to default

* Add a confirmation for removing the section

* Align items in the row

* Use test_selector instead of data-test-selector

* Create move_action in rb file

* Create move_action in rb file

* Simplify section component

* Simplify form configuration component

* Remove dialog for rename and delete section on missing EE

* Create a component for inactive attribute list

* Create a separate component for reset dialog

* Remove EE feedback dialog

* Remove form partial which is not needed anymore

* Remove unused js strings

* Update using update_via_turbo

* Remove form configuration rows controller

* Create a blanksalte component

* Fix failing specs

* Fix failing specs

* Fix failing specs

* Remove unused translation strings

* Align form configuration section routes with actual create flow

* Change section to group

* Change section to group in services and controllers

* Change section to group in en.yml

* Fix rubocop errors

* Move the query group persistence assertion from the JS feature spec
to the synchronous form configuration groups controller spec.

* Reuse query service result in embedded query build

* Keep inactive attribute filter after turbo list refresh

* Extract form configuration group edit state into form model

* Fix the failing test

* Potential fix for pull request finding 'CodeQL / Potentially uninitialized local variable'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Rename inactive attribute component inputs

* Refine reset dialog wording for form configuration

* Use direct Turbo action for adding attribute groups

* Reuse generic filter-list controller for inactive attributes

* Remove focus impelementation in ts

* Group form configuration Stimulus controllers under one namespace

* Use turbo request service in form configuration controller

* Clarify legacy group key normalization in form config contract

* Replace inactive attribute list wrapper via turbo stream

* Extract duplicate untitled group key generation into Type::FormGroup.next_untitled_key

* Auto-generate untitled group name on create instead of returning an error

* Avoid mixed return types in form config group create service

* Extract shared form configuration group service behavior into concern

* Fix spacing for the last group and italic font for the placeholder rows

* Replace Angular no-results component with Primer Banner on form configuration page

* Hide dropped element immediately to prevent flickering before Turbo Stream response

* Reload type before rendering create error to prevent duplicate groups

* Await service initialization before use to prevent potential race condition

* Replace sleep calls with deterministic waits in form configuration spec

* Handle malformed JSON and invalid query errors gracefully in form configuration update

* Make query group label a clickable button and empty group hint italic

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-05-13 12:56:18 +02:00
Tomas Hykel 1d320fb544 fix: Do not trigger notifications during project identifier migration 2026-05-12 21:22:58 +02:00
Tom Hykel 3ff2481ab2 Merge pull request #23121 from opf/fix/project-copy-counter-bug
fix: Correctly handle semantic ID counter on project copy
2026-05-08 14:31:56 +02:00
Tomas Hykel ae3f4aa689 fix: Adjust save button behaviour in identifier settings 2026-05-07 23:37:05 +02:00
Tomas Hykel 53a557678f fix the test 2026-05-07 22:43:42 +02:00
Tomas Hykel 8e70767c5f fix: Correctly handle wp_sequence_counter on project copy 2026-05-07 22:12:27 +02:00
Oliver Günther d314c487d5 Use registry for associated journal objects, not hard coded map 2026-05-07 10:34:06 +02:00
Jan Sandbrink 6fed98298e Merge pull request #23080 from opf/core-health-validator
Move health validator to core
2026-05-07 08:13:45 +02:00
OpenProject Actions CI 0778811719 Merge branch 'release/17.4' into dev 2026-05-06 12:47:03 +00:00