34 Commits

Author SHA1 Message Date
Alexander Brandon Coles a7e0dc3f75 Merge remote-tracking branch 'opf/dev' into HEAD
# Conflicts:
#	modules/backlogs/config/locales/crowdin/cs.yml
#	modules/backlogs/config/locales/crowdin/es.yml
#	modules/backlogs/config/locales/crowdin/it.yml
#	modules/backlogs/config/locales/crowdin/ko.yml
#	modules/backlogs/config/locales/crowdin/pl.yml
#	modules/backlogs/config/locales/crowdin/pt-BR.yml
#	modules/backlogs/config/locales/crowdin/ro.yml
#	modules/backlogs/config/locales/crowdin/zh-CN.yml
#	modules/backlogs/spec/features/inbox_column_spec.rb
#	modules/backlogs/spec/support/pages/backlog.rb
#	modules/resource_management/config/locales/crowdin/es.yml
#	modules/resource_management/config/locales/crowdin/it.yml
#	modules/resource_management/config/locales/crowdin/ko.yml
#	modules/resource_management/config/locales/crowdin/pl.yml
#	modules/resource_management/config/locales/crowdin/zh-CN.yml
#	modules/wikis/config/locales/crowdin/es.yml
#	modules/wikis/config/locales/crowdin/it.yml
#	modules/wikis/config/locales/crowdin/ko.yml
#	modules/wikis/config/locales/crowdin/pl.yml
#	modules/wikis/config/locales/crowdin/pt-BR.yml
#	modules/wikis/config/locales/crowdin/zh-CN.yml
2026-06-04 09:44:51 +02:00
Kabiru Mwenja f50b2f9794 Resolve semantic work package identifiers in attribute macros
The resolver only treated purely numeric references as work package ids,
so semantic identifiers fell through to a typeahead search and failed.
Route both numeric and semantic ids to the show endpoint instead.
2026-06-03 16:16:48 +03:00
Oliver Günther 1f3da064ac Escape CSV formula cells by default 2026-06-01 13:44:29 +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 24c869b5c4 Apply review feedback to PDF semantic macro handler
Scope semantic-id resolution through `WorkPackage.visible` so a reference to a
work package outside the current user's visibility falls through to literal
text. Without this, semantic identifiers (guessable, project-prefixed) would
disclose existence: a hidden `#PROJ-1` would resolve and render a mention,
whereas a non-existent `#GHOST-1` would fall through — a discoverable oracle.
Spec pins the new contract; matches the in-app preload pipeline which already
uses `WorkPackage.visible`.

Drop the `to_i.to_s` round-trip on the numeric branch. `numeric_id?` already
verifies the matched string is canonical, so the round-trip is a no-op.

Tighten the alias spec to assert the rendered `data-text` carries the current
identifier, not just that the old one is absent. Trim the `render_link`
comment to the load-bearing claim (defence-in-depth escape).
2026-05-20 17:32:17 +03:00
Kabiru Mwenja 796f6b1ccd Resolve semantic identifiers in PDF text macro links
In semantic mode, the PDF text-macro handler resolves `#PROJ-1`,
`##PROJ-1`, and `###PROJ-1` through `find_by_display_id` and emits a
`<mention>` whose `data-id` carries the display id straight through to
the PDF renderer. Cache misses (unknown identifier, deleted WP) fall
through to literal text. Historical aliases resolve to the current
identifier. Classic mode rejects semantic-shape input — `#PROJ-1` in
a classic-mode export stays literal.

Numeric input keeps its current path: the matcher emits the mention
from the matched id without a DB lookup.

`render_link` HTML-escapes both interpolated values. The matcher
regex (`ID_ROUTE_CONSTRAINT`) already constrains shape to
`\d+|[A-Z][A-Z0-9_]*-\d+`, so the escape is defence-in-depth: a
future caller bypassing the matcher cannot regress into HTML
attribute injection.

The fast-path filter `Links.applicable?` matches `/#[A-Z\d]/` so
semantic-only bodies reach the full regex.

Downstream `Exports::PDF::Common::Markdown#wp_mention_macro` is
updated to `find_by_display_id` in PR 23093. This commit must land
after that PR — otherwise its existing `id[/\d+/]; find_by(id:)`
extracts the trailing digits from `data-id="PROJ-7"` and resolves
to WP id 7.
2026-05-20 16:35:04 +03:00
Kabiru Mwenja 1ce4251c23 Merge pull request #23203 from opf/feature/text-macro-semantic-id-rendering
Accept semantic work-package identifiers in text macros
2026-05-19 14:42:30 +03:00
Kabiru Mwenja f9406ff1c7 Trim verbose contextual comments on WP identifier branch
Cuts comments that restate code mechanics, narrate the journey, or
pile on implementation detail. Genuine WHYs (perf rationale of the
to_i.to_s round-trip, the alias second-query reason, leading-zero
rejection, classic-mode preload skip) all stayed.
2026-05-15 08:24:16 +03:00
Kabiru Mwenja ba974ebed2 Pin PDF export macros to numeric-only references
`Macros::Links` extends `ResourceLinksMatcher`, so the regex broadening
in the previous commit also matches `#PROJ-1` shapes inside markdown
that's about to be exported as PDF. Without an explicit guard, the PDF
custom handler would silently emit `<mention data-id="0">` (since
`"PROJ-1".to_i == 0`) — broken-looking output that's hard to attribute.

Tighten `WorkPackagesLinkHandler#applicable?` to reject semantic-shape
input. Override `call` so it doesn't fall through the parent's
cache-driven path (PDF rendering walks Markly nodes via a separate
pipeline that doesn't populate the per-render cache). Cite WP #74366 in
the comment as the follow-up that adds semantic-id support to the PDF
side via the Markly walk in `app/models/exports/pdf/common/macro.rb`.

New specs assert `#PROJ-1` falls through to literal text in PDF output
and never produces a `data-id="0"` mention, both alone and mixed with
numeric references.
2026-05-15 08:24:14 +03:00
Judith Roth 15647fe65d [#74366] Adapt regular PDF export description contents for semantic identifiers
https://community.openproject.org/wp/74366
2026-05-07 21:06:05 +02:00
as-op b4e56f3f09 support large animated WebP image conversion for PDF exports and add tests
https://community.openproject.org/work_packages/70333
2026-03-03 13:20:56 +01:00
Ivan Kuchin 9d4e81ca6a unit test for custom comment export formatter 2026-02-25 20:07:24 +01:00
ulferts a7bb8e4285 Merge remote-tracking branch 'origin/dev' into merge-release/17.0-20260106162012 2026-01-06 17:41:43 +01:00
Jens Ulferts 8302fea025 Merge pull request #21542 from opf/bug/70004-special-letters-like-umlaute-in-file-links-to-project-initiation-requests
[#70004] Special letters like Umlaute in file links to project initiation requests
2026-01-06 17:00:53 +01:00
ulferts 365d3e8dc2 rename Project status to Status 2026-01-06 14:55:20 +01:00
as-op 1ba354d65f fix spelling and grammar [skip ci] 2026-01-06 09:06:32 +01:00
as-op 446d5aee37 [#70004] Special letters like Umlaute in file links to project initiation requests
https://community.openproject.org/work_packages/70004
2026-01-05 15:54:42 +01:00
OpenProject Actions CI bf733ef180 Merge branch 'release/17.0' into dev 2025-12-17 13:16:58 +00:00
Oliver Günther 78d104bb2e Use gsub to match all found elements of the regexp
The macro replacement iterates matches manually to substrings by index.
When multiple macros appeared in the same text segment (e.g.,
workPackageValue:"dueDate" workPackageValue:"startDate"), the first
replacement left later macros in the line unprocessed, so raw macro
markup ended up being in the PDF output.

Using gsub with the macro regexp ensures we replace every match in a
single pass even when multiple macros are used in a row
2025-12-17 09:06:16 +01:00
as-op c015499912 [#69625] Error in PDF exports if font file is damaged or storage is broken
https://community.openproject.org/work_packages/69625
2025-12-04 16:32:17 +01:00
Eric Schubert 3aa0400bd1 [#69014] adapt test description 2025-11-17 13:35:22 +01:00
Eric Schubert 4abb01b1dd [#69014] fix unit tests and export formatter 2025-11-14 17:13:31 +01:00
as-op a56f40f32f Ensure that when a formatted custom field contains markdown that MUST start at BOL and the macro appears mid-line, a line break is inserted before the markdown. 2025-11-06 15:54:40 +01:00
as-op a9f834b511 [#68540] Support non-nested long text fields macro in PDF Export
https://community.openproject.org/work_packages/68540
2025-10-28 15:01:12 +01:00
Eric Schubert 1a815c10dd Merge pull request #20036 from opf/implementation/66412-update-persistence-services-to-handle-score-data
[#66412] amend persistence layer to handle item scores
2025-08-26 15:25:41 +02:00
Eric Schubert c6ad2c3c8f [#66412] fixed test setup
- use new interface of persistence service
- use correct spec helper
2025-08-26 13:18:47 +02: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
as-op 12f595747b [#66736] PDF export fails for cover page and CustomStyle with cover_text_color
https://community.openproject.org/work_packages/66736
2025-08-21 15:47:57 +02:00
as-op ce2bf6d768 obey rubocop 2025-08-19 12:40:37 +02:00
as-op 31738e635a use the custom font in all PDF exports 2025-08-19 12:27:42 +02:00
as-op 32ff7de6af obey rubocop 2025-07-22 14:32:48 +02:00
as-op 4bdf570854 add ee to test 2025-06-23 12:50:56 +02:00
as-op c27cc16b6b add addition test level 2025-06-23 12:40:42 +02:00
as-op 56aef10377 [#60404] Hierarchy custom field - pdf output display only last item without hierarchy
https://community.openproject.org/work_packages/60404
2025-06-18 12:53:01 +02:00