Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions modules/meeting/app/workers/meetings/pdf/common/agenda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ def agenda_title_wp(work_package)
make_link_href(
href,
prawn_table_cell_inline_formatting_data(
"#{work_package.type.name} ##{work_package.id} #{work_package.subject}",
work_package_title_text(work_package),
{ styles: [:underline] }
)
)
end

def work_package_title_text(work_package)
"#{work_package.type.name} #{work_package.formatted_id} #{work_package.subject}"
end

def agenda_wp_title_row(agenda_item)
if agenda_item.visible_work_package?
work_package = agenda_item.work_package
Expand Down Expand Up @@ -109,7 +113,7 @@ def write_work_package_outcome(outcome)

def write_visible_work_package_outcome(work_package)
href = url_helpers.work_package_url(work_package)
link_text = "#{work_package.type.name} ##{work_package.id} #{work_package.subject}"
link_text = work_package_title_text(work_package)
status_text = " (#{work_package.status.name})"
base_style = styles.outcome_work_package
pdf.formatted_text([
Expand Down
72 changes: 72 additions & 0 deletions modules/meeting/spec/workers/meetings/pdf/default/exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,52 @@ def meeting_head
expect(subject).to eq expected_document
end
end

context "with semantic work package identifiers",
with_settings: { work_packages_identifier: "semantic" } do
let(:options) do
{
participants: "0",
outcomes: "0",
backlog: "0",
attachments: "0"
}
end
let(:wp_agenda_item) do
create(:wp_meeting_agenda_item,
meeting:,
meeting_section: meeting_section_second,
work_package:,
duration_in_minutes: 10,
notes: "<mention class=\"mention\" data-id=\"#{work_package.id}\" data-type=\"work_package\" " \
"data-text=\"##{work_package.id}\">##{work_package.id}</mention>")
end

before do
work_package.update_columns(identifier: "MEET-1", sequence_number: 1)
end

it "renders the semantic identifier for the agenda item and the mention in its notes" do
expected_document = [
*expected_cover_page,
*meeting_head,

"Untitled section", " ", "15 mins",
"Agenda Item TOP 1", " ", "15 mins", " ", "Export User",
"foo",

"Second section", " ", "10 mins",
"Task", "MEET-1", "Important task", " (Workin' on it)", " ", "10 mins",
"MEET-1",

"1", # Page number
export_time_formatted,
project.name
].join(" ")

expect(subject).to eq expected_document
end
end
end

context "with a meeting with special work package agenda item" do
Expand Down Expand Up @@ -362,6 +408,32 @@ def meeting_head

expect(subject).to eq expected_document
end

context "with semantic work package identifiers",
with_settings: { work_packages_identifier: "semantic" } do
before do
outcome_work_package.update_columns(identifier: "MEET-1", sequence_number: 1)
end

it "renders the work package outcome with the semantic identifier" do
expected_document = [
*expected_cover_page,
*meeting_head,

"Section with outcomes", " ", "15 mins",
"Agenda Item", " ", "15 mins", " ", "Export User",
"Agenda item notes",
"✓ Outcome",
"Task", "MEET-1", "Outcome WP", " (In Progress)",

"1", # Page number
export_time_formatted,
project.name
].join(" ")

expect(subject).to eq expected_document
end
end
end

context "with a hidden work package outcome" do
Expand Down
67 changes: 67 additions & 0 deletions modules/meeting/spec/workers/meetings/pdf/minutes/exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,50 @@ def expected_header_footer
expect(subject).to eq expected_document
end
end

context "with semantic work package identifiers",
with_settings: { work_packages_identifier: "semantic" } do
let(:options) do
default_options.merge(
{
first_page_header_left: "",
outcomes: "0",
author: ""
}
)
end
let(:wp_agenda_item) do
create(:wp_meeting_agenda_item,
meeting:,
meeting_section: meeting_section_second,
work_package:,
duration_in_minutes: 10,
notes: "<mention class=\"mention\" data-id=\"#{work_package.id}\" data-type=\"work_package\" " \
"data-text=\"##{work_package.id}\">##{work_package.id}</mention>")
end

before do
work_package.update_columns(identifier: "MEET-1", sequence_number: 1)
end

it "renders the semantic identifier for the agenda item and the mention in its notes" do
expected_document = [
meeting.title,
*meeting_info,
"1. Untitled section", " ", "15 mins",
"1.1. Agenda Item TOP 1",
"foo",

"2. Second section", " ", "10 mins",
"2.1. Task", "MEET-1", "Important task", " (Workin' on it)",
"MEET-1",

*expected_footer
].join(" ")

expect(subject).to eq expected_document
end
end
end

context "with a meeting with special work package agenda item" do
Expand Down Expand Up @@ -352,6 +396,29 @@ def expected_header_footer

expect(subject).to eq expected_document
end

context "with semantic work package identifiers",
with_settings: { work_packages_identifier: "semantic" } do
before do
outcome_work_package.update_columns(identifier: "MEET-1", sequence_number: 1)
end

it "renders the work package outcome with the semantic identifier" do
expected_document = [
meeting.title,
*meeting_info,
*meeting_info_custom,
"1. Section with outcomes", " ", "15 mins",
"1.1. Agenda Item",
"Agenda item notes",
"✓ Outcome",
"Task", "MEET-1", "Outcome WP", " (In Progress)",
*expected_header_footer
].join(" ")

expect(subject).to eq expected_document
end
end
end

context "with a hidden work package outcome" do
Expand Down
Loading