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

Don't show logo in worldwide org when they are sponsoring [Solution 1] #3509

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
15 changes: 13 additions & 2 deletions app/views/content_items/worldwide_organisation/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<% if @content_item.sponsoring_organisations.present? %>
<header class="worldwide-organisation-header govuk-grid-row">
<div class="govuk-grid-column-two-thirds worldwide-organisation-header__logo">
<%= render "govuk_publishing_components/components/organisation_logo", {
organisation: @content_item.organisation_logo,
<%= render "govuk_publishing_components/components/heading", {
text: @content_item.title,
heading_level: 1,
inline: true,
} %>
</div>
<% else %>
<header class="worldwide-organisation-header govuk-grid-row">
<div class="govuk-grid-column-two-thirds worldwide-organisation-header__logo">
<%= render "govuk_publishing_components/components/organisation_logo", {
organisation: @content_item.organisation_logo,
heading_level: 1,
inline: true,
} %>
</div>
<% end %>

<div class="govuk-grid-column-one-third govuk-!-padding-top-2">
<% if @content_item.available_translations.length > 1 %>
Expand Down
8 changes: 0 additions & 8 deletions test/integration/worldwide_corporate_information_page_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ class WorldwideCorporateInformationPageTest < ActionDispatch::IntegrationTest
assert page.has_content? "The description for the worldwide corporate information page"
end

test "includes the logo and name of the worldwide organisation as a link" do
setup_and_visit_content_item("worldwide_corporate_information_page")

assert_has_component_organisation_logo
assert_has_component_title("British Embassy\nManila")
assert page.has_link? "British EmbassyManila", href: "/world/organisations/british-embassy-manila"
end

test "includes the world locations and sponsoring organisations" do
setup_and_visit_content_item("worldwide_corporate_information_page")

Expand Down
8 changes: 0 additions & 8 deletions test/integration/worldwide_office_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ class WorldwideOfficeTest < ActionDispatch::IntegrationTest
assert page.has_content? "24/7 consular support is available by telephone for all routine enquiries and emergencies."
end

test "includes the logo and formatted name of the worldwide organisation as a link" do
setup_and_visit_content_item("worldwide_office")

assert_has_component_organisation_logo
assert_has_component_title("British Embassy\nManila")
assert page.has_link? "British EmbassyManila", href: "/world/organisations/british-embassy-manila"
end

test "includes the world locations and sponsoring organisations" do
setup_and_visit_content_item("worldwide_office")

Expand Down
2 changes: 1 addition & 1 deletion test/integration/worldwide_organisation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class WorldwideOrganisationTest < ActionDispatch::IntegrationTest
test "renders basic worldwide organisation page" do
setup_and_visit_content_item("worldwide_organisation")
assert_has_component_title("British Deputy High Commission\nHyderabad")
assert page.has_text?(@content_item["title"])
assert page.has_text?(@content_item["description"])
end

Expand Down
Loading