-
Notifications
You must be signed in to change notification settings - Fork 17
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
Use formatted name for worldwide organisations #3029
Conversation
Depends on alphagov/publishing-api#2587. |
e81e925
to
1a23c25
Compare
1a23c25
to
538bcda
Compare
538bcda
to
b950143
Compare
We are currently presenting the Worldwide Organisation's title in the logo. This means there are no line breaks in the places specified by the user. Updating to use the formatted title, which the publisher would have expected since they entered this in Whitehall. This also applies the change to Worldwide Offices and Worldwide Corporate Information Pages, which include the Worldwide Organisation's logo in the header.
b950143
to
bae6511
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the screenshots
@@ -41,7 +41,8 @@ class WorldwideCorporateInformationPageTest < ActionDispatch::IntegrationTest | |||
setup_and_visit_content_item("worldwide_corporate_information_page") | |||
|
|||
assert_has_component_organisation_logo | |||
assert page.has_link? "British Embassy Manila", href: "/world/organisations/british-embassy-manila" | |||
assert_has_component_title("British Embassy\nManila") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this works with a \n
and not a <br>
😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's because we're matching on text
here, rather than the raw HTML, so the line break has already been parsed.
@@ -41,7 +41,8 @@ class WorldwideCorporateInformationPageTest < ActionDispatch::IntegrationTest | |||
setup_and_visit_content_item("worldwide_corporate_information_page") | |||
|
|||
assert_has_component_organisation_logo | |||
assert page.has_link? "British Embassy Manila", href: "/world/organisations/british-embassy-manila" | |||
assert_has_component_title("British Embassy\nManila") | |||
assert page.has_link? "British EmbassyManila", href: "/world/organisations/british-embassy-manila" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shame this doesn't also work with the \n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. There seems to be some inconsistency in the way these matchers work.
@@ -42,7 +42,7 @@ def schema_name | |||
|
|||
presented = create_presenter(WorldwideCorporateInformationPagePresenter, content_item: without_sponsoring_organisations) | |||
|
|||
expected = { name: "British Embassy Manila", url: "/world/organisations/british-embassy-manila", crest: "single-identity", brand: "single-identity" } | |||
expected = { name: "British Embassy<br/>Manila", url: "/world/organisations/british-embassy-manila", crest: "single-identity", brand: "single-identity" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand where this <br/> is coming from. I can see the title in the schema example...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes from the formatted_title
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh different field! OK gottit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks Bruce
We are currently presenting the Worldwide Organisation's title in the logo. This means there are no line breaks in the places specified by the user.
Updating to use the formatted title, which the publisher would have expected since they entered this in Whitehall.
Screenshots
Trello card