Skip to content

Commit

Permalink
Merge pull request #3988 from alphagov/fix-unnumbered-paper-rendering
Browse files Browse the repository at this point in the history
Fix rendering of unnumbered papers
  • Loading branch information
leenagupte authored Apr 19, 2024
2 parents ef4e455 + 55ae60d commit 621b5f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Unreleased

* Fix rendering of unnumbered papers ([PR #3988](https://github.com/alphagov/govuk_publishing_components/pull/3988))
* Add PDF specific icon to attachment component ([PR #3985](https://github.com/alphagov/govuk_publishing_components/pull/3985))
* Add the hidden attribute to mobile menu button ([PR #3975](https://github.com/alphagov/govuk_publishing_components/pull/3975))
* Add tool_name to GA4 feedback component tracking ([PR #3984](https://github.com/alphagov/govuk_publishing_components/pull/3984))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def reference
end

def unnumbered_reference
unnumbered_reference = "Unnumbered command paper" if attachment_data[:unnumbered_command_paper].eql?(true) && !attachment_data[:command_paper_number]
unnumbered_reference = "Unnumbered act paper" if attachment_data[:unnumbered_hoc_paper].eql?(true) && !attachment_data[:hoc_paper_number]
unnumbered_reference = "Unnumbered command paper" if attachment_data[:unnumbered_command_paper].eql?(true) && attachment_data[:command_paper_number].blank?
unnumbered_reference = "Unnumbered act paper" if attachment_data[:unnumbered_hoc_paper].eql?(true) && attachment_data[:hoc_paper_number].blank?
unnumbered_reference
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
title: "test",
url: "test",
content_type: "text/csv",
command_paper_number: "",
unnumbered_command_paper: true,
)
expect(attachment.unnumbered_reference).to eq("Unnumbered command paper")
Expand All @@ -185,6 +186,7 @@
title: "test",
url: "test",
content_type: "text/csv",
hoc_paper_number: "",
unnumbered_hoc_paper: true,
)
expect(attachment.unnumbered_reference).to eq("Unnumbered act paper")
Expand Down

0 comments on commit 621b5f7

Please sign in to comment.