Merge pull request #23712 from opf/implementation/stc-783-adapt-pdf-export-of-timesheets-for-semantic-identifiers

Implementation/STC-783: Adapt PDF export of timesheets for semantic identifiers
This commit is contained in:
Kabiru Mwenja
2026-06-12 17:09:17 +03:00
committed by GitHub
2 changed files with 13 additions and 1 deletions
@@ -224,7 +224,7 @@ class CostQuery::PDF::TimesheetGenerator
href = url_helpers.work_package_url(entry.entity)
{
content: "#{make_link_href(href, "##{entry.entity.id}")} #{entry.entity.subject || ''}",
content: "#{make_link_href(href, entry.entity.formatted_id)} #{entry.entity.subject || ''}",
inline_format: true
}
end
@@ -227,4 +227,16 @@ RSpec.describe CostQuery::PDF::TimesheetGenerator do
expect(subject).to eq expected_document(false)
end
end
context "with semantic work package identifiers",
with_settings: { work_packages_identifier: "semantic", allow_tracking_start_and_end_times: false } do
before do
user_time_entry.entity.update_columns(identifier: "PROD-42", sequence_number: 42)
end
it "renders the semantic identifier in the work package column" do
expect(subject).to include("PROD-42")
expect(subject).not_to include("##{user_time_entry.entity.id}")
end
end
end