[#74366] Adapt PDF exports for semantic identifiers#23093
Open
judithroth wants to merge 4 commits intodevfrom
Open
[#74366] Adapt PDF exports for semantic identifiers#23093judithroth wants to merge 4 commits intodevfrom
judithroth wants to merge 4 commits intodevfrom
Conversation
https://community.openproject.org/wp/74366 Basic report adaptions
1b4db6c to
f1dd442
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adapts PDF export output to use semantic (formatted/display) work package identifiers instead of raw numeric IDs, and extends mention handling so work package mentions render with the correct identifier format.
Changes:
- Replace numeric ID rendering in multiple PDF exports (titles, tables, Gantt labels) with
display_id/formatted_id. - Centralize work package mention expansion into a shared module and reuse it across PDF markdown generators.
- Add/adjust specs to validate classic vs semantic identifier output for filenames, Gantt strings, and markdown mention expansion.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb | Updates expectations to use formatted_id in headings. |
| spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb | Updates list/detail expectations to use display_id. |
| spec/models/work_packages/pdf_export/work_package_list_to_pdf_gantt_spec.rb | Uses formatted_id in Gantt labels; adds classic vs semantic assertions. |
| spec/models/work_package/pdf_export/document_generator_spec.rb | Adds coverage for filename titles and WP mentions in descriptions. |
| spec/models/exports/pdf/common/markdown/md2_pdf_export_spec.rb | New spec file covering mention expansion in classic vs semantic mode. |
| app/models/work_package/pdf_export/work_package_to_pdf.rb | Uses formatted_id / display_id in heading and filename. |
| app/models/work_package/pdf_export/generator/generator.rb | Adds WP mention rendering using shared mention expander. |
| app/models/work_package/pdf_export/document_generator.rb | Uses display_id in filename generation. |
| app/models/exports/pdf/components/gantt/gantt_builder.rb | Uses formatted_id in work package info line. |
| app/models/exports/pdf/common/work_package_mentions.rb | New shared module to expand WP mentions consistently. |
| app/models/exports/pdf/common/markdown.rb | Removes duplicated mention expansion/date helpers in favor of shared module. |
| app/models/exports/pdf/common/common.rb | Changes ID column cell rendering to use display_id link caption. |
b524896 to
81b1a53
Compare
https://community.openproject.org/wp/74366 And also improve rendering of linked work packages for this. Before, the macros were not expanded, but only the hashes and ID output directly.
81b1a53 to
f8c29e8
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was rushed a bit because I wanted to get this done before my vacation 😅
This adapts different exports and is probably best reviewed commit by commit.
If you don't see the need for changes and approve, also merge it please!
Ticket
https://community.openproject.org/wp/74366 / https://community.openproject.org/wp/74754
What are you trying to accomplish?
Use semantic IDs in PDF exports for
This also improves the output of a work package with other linked work packages in the description for the "Contract" Template. Before, the links would not have been expanded (e.g. "##124" would be part of the PDF instead of the nicer expanded representation). This was solved with a shared module.
Out of scope (will be fully covered with https://community.openproject.org/wp/74755):
Merge checklist