mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Adapt timesheet PDF export for semantic work package identifiers
The work package column hardcoded the numeric id. Using formatted_id renders the project-based identifier in semantic mode.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user