Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rendering of unnumbered papers #3988

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Conversation

leenagupte
Copy link
Contributor

@leenagupte leenagupte commented Apr 19, 2024

What

Fix rendering of unnumbered papers so that "Unnumbered..." is displayed

Why

The "false" check in the unnumbered command and act papers was failing because the component is passed an empty string rather than nil for the number, which does not evaluate to false:

e.g.

a = false
!a
=> true
b = nil
!b
=> true
c = ""
!c
=> false

Therefore the check was returning nil rather than the "Unnumbered..." text.

Visual Changes

Before

Screenshot 2024-04-19 at 16 38 17

After

Screenshot 2024-04-19 at 16 38 04

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3988 April 19, 2024 15:46 Inactive
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3988 April 19, 2024 15:47 Inactive
@leenagupte leenagupte requested a review from andysellick April 19, 2024 15:49
Copy link
Contributor

@andysellick andysellick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff.

I'd squash the commits together, since they relate directly to each other.

Also it looks like the 'before' screenshot was taken with the old icon, just noting that this isn't part of this change.

@leenagupte
Copy link
Contributor Author

leenagupte commented Apr 19, 2024

@andysellick Thanks for reviewing. Will squash the commits.

Also it looks like the 'before' screenshot was taken with the old icon

Yeah, the new one hasn't been released yet.

The "false" check in the unnumbered command and act papers was failing
because the component is passed an empty string rather than nil for the
number, which does not evaluate to false:

e.g.

a = false
!a
=> true
b = nil
!b
=> true
c = ""
!c
=> false

Therefore the check was returning `nil` rather than the "Unnumbered..."
text.
@leenagupte leenagupte force-pushed the fix-unnumbered-paper-rendering branch from 293d44c to 55ae60d Compare April 19, 2024 16:09
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3988 April 19, 2024 16:10 Inactive
@leenagupte leenagupte merged commit 621b5f7 into main Apr 19, 2024
13 checks passed
@leenagupte leenagupte deleted the fix-unnumbered-paper-rendering branch April 19, 2024 16:13
@matthillco matthillco mentioned this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants