378 Commits

Author SHA1 Message Date
Alexander Brandon Coles 0b4bcb5d3c Set accessible names on table column headers
capybara_accessible_selectors 0.16 resolves role selectors such as
`:columnheader` by the computed accessible name. In a browser that name
folds in the CSS `text-transform: uppercase` styling and the column
action-menu trigger text, so `have_columnheader("Subject")` no longer
matches a header whose accessible name resolves to "SUBJECT Open menu".

Sets an explicit `aria-label` equal to the plain caption on each header
cell, in both the server-rendered tables and the work package table, so
the accessible name is the column title alone. This also improves screen
reader output, which previously announced the uppercased text and the
menu label.
2026-05-29 19:30:27 +02:00
Kabiru Mwenja ab32cab495 Merge pull request #23337 from opf/bug/74762-numeric-id-in-the-email-notification-after-adding-watchers
bug/74762 Numeric ID in the email notification after adding watchers
2026-05-28 11:38:02 +03:00
Kabiru Mwenja 499d7820a2 Add render_mode flag and MailFormattingHelper
`format_text` accepts `render_mode:` (`:in_app_html`, `:external_html`,
`:external_text`), which resolves the `only_path`, `static_html` and
`plain_text` context flags as a set. External surfaces (mailer HTML
body, future RSS/PDF/webhook) need absolute URLs and static rendering
together; pinning the trio at the public API keeps callers from
forgetting one. Explicit primitive kwargs still override.

`MailFormattingHelper` exposes `format_mail_html` and `format_mail_text`
thin wrappers around `format_text(render_mode:)`. The `_html` / `_text`
suffix matches the `.html.erb` / `.text.erb` template extension so
caller intent stays visible in the view, with no introspection of
`formats`.

The five WorkPackageMailer view sites use the helpers; `_work_package_details`,
`mentioned.html`, `mentioned.text`, `watcher_changed.html`, `watcher_changed.text`
drop the `static_html:`/`only_path:`/`plain_text:` boilerplate.
2026-05-27 13:04:26 +03:00
Behrokh Satarnejad dbef4d9e71 [74931] Show type of field beside the attribute (#23205)
* Show filed type beside its name

* Add feature spec

* Add a comment for field_type_label

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add custom field type label assertion to feature spec

* Move custom field to active group before asserting type label

* Rename the displayed field format value from field_type to
field_format_label and reuse CustomFieldsHelper for custom field format
labels.

* Make the table configuration modal wait more and embedded work package table loading take longer to avoid flaky failures when the modal or embedded table is still refreshing in CI

* Undo changes for switch_to method

* Undo changes for the tests that are sometimes failing on CI

* Update spec/features/types/form_configuration_spec.rb

Co-authored-by: Henriette Darge <h.darge@openproject.com>

* Update spec/helpers/types_helper_spec.rb

Co-authored-by: Henriette Darge <h.darge@openproject.com>

* Rubocop errors fixed

* Fix flaky field format labels spec by revisiting page after custom field creation

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Henriette Darge <h.darge@openproject.com>
2026-05-27 09:24:38 +02:00
Tomas Hykel 948fa43321 chore: Remove feature flag for project-based work package identifiers 2026-05-25 17:45:06 +02:00
Kabiru Mwenja d1fc18b7f2 Apply S1 review feedback
- Pin literal "MACROPROJ-42" in helper spec so a regression where
  the helper accidentally returns `#N` shape still trips the
  assertion. Previously the expected string was built from the
  same accessor under test.
- Drop framework-mechanics narration from the cause spec comment.
  The assertion already conveys intent.
2026-05-13 17:49:52 +03:00
Kabiru Mwenja 392ba04d1d Use formatted_id in journal cause formatter and link_to_work_package
The activity feed renders an automatic entry whenever a parent / child /
predecessor / related work package change cascades dates onto the
current WP. Both render paths spoke numeric ids:

- The plain-text branch (used for the API JSON) hardcoded `##{id}`.
- The HTML branch went through `link_to_work_package`, which built the
  visible link label as `Type ##{id}: subject`.

Both now use `formatted_id`, which produces `PROJ-7` in semantic mode
and `#42` in classic — same shape, mode-aware. The link href was
already mode-correct via `to_param`; only the visible label needed the
swap.
2026-05-13 17:41:48 +03: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
Oliver Günther eae05f9d1a Fix after login redirect not ending up on configured URL by default
We used request.url and a back_url for the home path to redirect users
if they did not end up trying to access on a deep link.

In case you access / and get redirected by require_login, you want users
to end up on the after_login_default_redirect_url

Likewise, if you access /login without a back_url, you want the same
behavior

Deep linking logins are unchanged

https://community.openproject.org/work_packages/74756
2026-05-08 09:26:58 +02:00
Oliver Günther a92edf17a6 Merge remote-tracking branch 'origin/release/17.3' into dev 2026-04-21 11:00:11 +02:00
Oliver Günther cb38ec7b96 Update behavior now that relevant tags are removed, not escaped 2026-04-20 19:38:03 +02:00
Christophe Bliard a5434ca2a3 [73986] Prevent browser title truncation at 70 chars
https://community.openproject.org/wp/73986

The meta-tags gem truncates the page title to 70 characters by default,
which caused the browser title bar to show incomplete page titles.

Add initializer that disables that limit so the full title is always
displayed.
2026-04-16 18:58:25 +02:00
Behrokh Satarnejad 7014e13d3e Merge pull request #22475 from opf/71063-create-a-pagination-component-based-on-the-primer-specification
[71063] Update PVC with new Pagination component and Banner styles
2026-03-25 14:02:04 +01:00
Oliver Günther 4d731dcab6 Replace raw and explicit html_safe calls 2026-03-20 09:49:10 +01:00
Oliver Günther c3b075d391 Merge remote-tracking branch 'origin/release/17.1' into release/17.2 2026-03-16 11:11:43 +01:00
Oliver Günther 30ef57877c Merge remote-tracking branch 'origin/release/17.0' into release/17.1 2026-03-16 11:10:12 +01:00
Oliver Günther 8d61c5fe7f Merge remote-tracking branch 'origin/release/16.6' into release/17.0 2026-03-16 11:08:23 +01:00
Klaus Zanders afc0012a72 Refactor HTML generation for repositories 2026-03-13 14:17:05 +01:00
OpenProject Actions CI 53ad486160 Merge branch 'release/17.1' into release/17.2 2026-03-03 13:38:43 +00:00
ulferts b8546a4292 fix saving project quries broken because of an unreachable method definition 2026-02-27 15:53:25 +01:00
Oliver Günther 680d3293dd Refactor installation uuid to use new persist_on_first_read 2026-02-10 07:40:32 +01:00
Kabiru Mwenja 8dbac61c57 Add project-scoped configuration API [OP#70979]
Adds `GET /api/v3/projects/:id/configuration` endpoint that returns
all global configuration properties plus project-specific settings.

This allows client apps to check both enterprise token features
(availableFeatures) and project settings (enabledInternalComments)
in a single API call.
2026-01-29 10:32:29 +03:00
OpenProject Actions CI 7dd0318e30 Merge branch 'release/16.6' into release/17.0 2026-01-26 05:41:40 +00:00
Oliver Günther 5af326a2ec Remove unused options in work package helper (#21687)
* Remove unused options and improved output in work package helper and object_linking

* Extend tests
2026-01-26 06:40:58 +01:00
Alexander Brandon Coles 44f4b56733 [#65031] Fix broken breadcrumb links on Wiki pages
https://community.openproject.org/work_packages/65031
2026-01-06 09:51:35 -03:00
Eric Schubert 36685aed7f [#68223] improve formatting and add test cases 2025-11-24 14:36:19 +01:00
Eric Schubert 2f99ec91d7 [#68223] add numeric representation helper
- https://community.openproject.org/wp/68223
- add helper for formatting numbers
- add tests to express expectations
2025-11-24 12:44:15 +01:00
Alexander Brandon Coles 7cad4d295d Ensure csp_onclick escapes selector 2025-11-05 12:53:16 +00:00
Alexander Brandon Coles 722f1d462a Remove jQuery from csp_onclick helper 2025-11-02 20:26:50 +00:00
Ivan Kuchin fdf7d0854e more precise error message helper tests 2025-09-24 19:25:03 +02:00
Tobias Dillmann 71af416c05 [#66093] Use module_function
Also provide a constant for the default translation key as it's used in
multiple places. Avoids the duplicates.
2025-09-24 19:19:03 +02:00
Tobias Dillmann 653dd5eb33 [#66093] Move calculation error translations into helper 2025-09-24 19:19:03 +02:00
Alexander Brandon Coles 66da672b7d Also refactor #lang_options_for_select
Based on `My::TimeZoneForm` implementation.

Should also reduce allocations (however, possible performance/memory
usage improvements have not been benchmarked).
2025-08-27 18:28:01 +01:00
Andrej Sandorf 6d32400044 Merge pull request #19874 from opf/feature/66384-custom-font-for-pdf-exports
[#66384] Custom font for PDF Exports
2025-08-26 12:49:16 +02:00
Alexander Brandon Coles c65265c7e8 Make #icon_for_color skip render if hexcode invalid 2025-08-18 16:26:14 +01:00
as-op b8b3c86a7a add specs for font upload and deletion 2025-08-12 12:58:43 +02:00
Alexander Brandon Coles 51213056b0 Replace .hidden-for-sighted with Primer's .sr-only
See (docs): https://primer.style/css/storybook/?path=/story/utilities-layout--screen-reader-only
See (source): https://github.com/primer/css/blob/main/src/utilities/visibility-display.scss#L96
2025-07-21 11:25:24 +01:00
Alexander Brandon Coles 8e18e3b192 Also skip FlashComponent turbo stream rendering 2025-07-18 16:38:35 +01:00
Alexander Brandon Coles f5c28cc9d9 Skip FlashComponent rendering if content is blank 2025-07-18 16:38:35 +01:00
Alexander Brandon Coles ca8f69641c [#65925] Make #join_flash_messages return String 2025-07-18 16:38:03 +01:00
Alexander Brandon Coles 5b63480642 Apply aria-live="polite" to announce range changes 2025-07-14 10:02:43 +01:00
Alexander Brandon Coles f6c2b16e21 [#64235] Provide A11y labels for pagination links (#19468)
* Make link_to_content_update forward all arguments

Supports block arguments.
Makes param names match `link_to`.

* [#65625] Provide A11y labels for pagination links

Applies `aria-label`, `role` and uses semantic markup where possible.

This should bring parity with the recently-updated Angular
`TablePaginationComponent`.

* Make internal PaginationHelper methods private

* Rework PaginationHelper to use keyword arguments

* Move custom LinkRenderer out of PaginationHelper

Works around `Rails/HelperInstanceVariable` offense false positives.

* Remove unnecessary LinkRenderer#to_html override

* Use text and chevron Octicons for Previous, Next

* Fix vertical alignment of pagination items

* Remove classes only used for Rails impl. specs

Test using semantic elements where possible.
2025-07-14 08:20:47 +02:00
Kabiru Mwenja b52debb70d Style/ItBlockParameter: Use it block parameter.RuboCopStyle/ItBlockParameter (#19318) 2025-06-26 13:36:49 +03:00
Henriette Darge 7a64597a7a Remove obsolete toolbar helpers 2025-06-18 17:22:16 +02:00
Christophe Bliard efbdb62656 [64635] Format enterprise tokens table according to their statuses
https://community.openproject.org/wp/64635

This follows the design on Figma:
- 4 columns: subscription, active users, domain, dates
- subscription shows plan name, subscriber, and some labels depending on
  the token validity and attributes
- the dates are highlighted if they have an influence on the token status
2025-06-17 15:37:19 +02:00
Alexander Brandon Coles 8858f66e47 Implement #render_flash_messages_as_turbo_streams
Renders flash messages wrapped in `<turbo-stream>` tags, suitable for
inlining as part of an HTML response (e.g. within a `turbo-frame`).

See: https://turbo.hotwired.dev/handbook/streams#stream-messages-and-actions

> Also, any <turbo-stream> element that’s inserted into the page (e.g.
> through full page or frame load), will be processed by Turbo and then
> removed from the dom. This allows stream actions to be executed
> automatically when a page or frame is loaded.

/ HT @bsatarnejad
2025-06-11 16:31:41 +01:00
Alexander Brandon Coles 5d15c53cfe Add initial specs for FlashMessagesHelper 2025-06-11 16:31:40 +01:00
Klaus Zanders 7ff8ee4cef Merge branch 'dev' into merge-release/16.0-20250522034632 2025-05-22 08:30:36 +02:00
Kabiru Mwenja 52ea17f7d2 [#64144] Watcher email notification can expose an internal comment if it is the latest comment
https://community.openproject.org/work_packages/64144

Co-authored-by: Bruno Pagno <b.pagno@openproject.com>
2025-05-21 12:55:43 +03:00
Jan Sandbrink 03c8db36bf Merge pull request #18806 from opf/frozen-specs
Freeze string literals in specs
2025-05-07 07:54:10 +02:00