From aec24299f39bf6af72f48e095235bde4d8d53fd1 Mon Sep 17 00:00:00 2001 From: 22Alexandra Date: Fri, 9 Jul 2021 14:48:08 +0300 Subject: [PATCH 1/4] EWPP-1317: Update FeaturedItemAssert classes. --- tests/PatternAssertions/FeaturedItemAssert.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/PatternAssertions/FeaturedItemAssert.php b/tests/PatternAssertions/FeaturedItemAssert.php index 51b0688c1..ef66674e6 100644 --- a/tests/PatternAssertions/FeaturedItemAssert.php +++ b/tests/PatternAssertions/FeaturedItemAssert.php @@ -18,7 +18,7 @@ protected function getAssertions($variant): array { return [ 'title' => [ [$this, 'assertElementText'], - 'article.ecl-card header.ecl-card__header h1.ecl-card__title a.ecl-link', + 'article.ecl-card .ecl-card__body h1.ecl-card__title a.ecl-link', ], 'link' => [ [$this, 'assertLink'], @@ -34,7 +34,7 @@ protected function getAssertions($variant): array { ], 'meta' => [ [$this, 'assertElementText'], - 'article.ecl-card header.ecl-card__header div.ecl-card__meta', + 'article.ecl-card .ecl-card__body div.ecl-card__meta', ], 'footer_items' => [ [$this, 'assertFooterItems'], @@ -63,7 +63,7 @@ protected function assertBaseElements(string $html, string $variant): void { * The DomCrawler where to check the element. */ protected function assertFeaturedItemImage($expected_image, string $variant, Crawler $crawler): void { - $image_div_selector = 'article.ecl-card header.ecl-card__header div.ecl-card__image'; + $image_div_selector = 'article.ecl-card div.ecl-card__image'; if (is_null($expected_image)) { $this->assertElementNotExists($image_div_selector, $crawler); return; @@ -85,7 +85,7 @@ protected function assertFeaturedItemImage($expected_image, string $variant, Cra */ protected function assertLink($expected_link, string $variant, Crawler $crawler): void { // Assert the title url points to the correct direction. - $this->assertElementAttribute($expected_link['href'], 'article.ecl-card header.ecl-card__header h1.ecl-card__title a.ecl-link', 'href', $crawler);; + $this->assertElementAttribute($expected_link['href'], 'article.ecl-card .ecl-card__body h1.ecl-card__title a.ecl-link', 'href', $crawler);; // If the variant is extended, assert that the button is correct. if ($variant == 'extended') { @@ -103,7 +103,7 @@ protected function assertLink($expected_link, string $variant, Crawler $crawler) * The DomCrawler where to check the element. */ protected function assertFooterItems($expected_info_items, Crawler $crawler): void { - $info_elements = $crawler->filter('article.ecl-card footer.ecl-card__footer ul.ecl-card__info-container li.ecl-card__info-item'); + $info_elements = $crawler->filter('article.ecl-card div.ecl-card__body ul.ecl-card__info-container li.ecl-card__info-item'); self::assertCount(count($expected_info_items), $info_elements, 'The expected info items do not match the found info items.'); foreach ($expected_info_items as $index => $expected_info_item) { $info_element = $info_elements->eq($index); From ab1b8c909f48a9d2bc7345c0b6b7083894d3ce03 Mon Sep 17 00:00:00 2001 From: 22Alexandra Date: Mon, 12 Jul 2021 16:23:04 +0300 Subject: [PATCH 2/4] EWPP-1317: Patch card component to replace join filter for the meta array with safe_join. --- patches/@ecl/twig-component-card+3.0.0-beta.1.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/@ecl/twig-component-card+3.0.0-beta.1.patch diff --git a/patches/@ecl/twig-component-card+3.0.0-beta.1.patch b/patches/@ecl/twig-component-card+3.0.0-beta.1.patch new file mode 100644 index 000000000..692770ac0 --- /dev/null +++ b/patches/@ecl/twig-component-card+3.0.0-beta.1.patch @@ -0,0 +1,12 @@ +patch-package +--- a/node_modules/@ecl/twig-component-card/card.html.twig ++++ b/node_modules/@ecl/twig-component-card/card.html.twig +@@ -99,7 +99,7 @@ + +
+ {% if _card.meta is not empty %} +-
{{ _card.meta|join(" | ") }}
++
{{ _card.meta|safe_join(" | ") }}
+ {% endif %} + {% if _card.title is not empty %} +

From 3da855fed2521e264877ded3855907e45e540d3d Mon Sep 17 00:00:00 2001 From: 22Alexandra Date: Tue, 13 Jul 2021 18:54:35 +0300 Subject: [PATCH 3/4] EWPP-1317: Update logo path in language selection page template. --- .../language-selection-page-content.html.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/language-selection-page/language-selection-page-content.html.twig b/templates/language-selection-page/language-selection-page-content.html.twig index 4a35f846f..cbc3064dc 100644 --- a/templates/language-selection-page/language-selection-page-content.html.twig +++ b/templates/language-selection-page/language-selection-page-content.html.twig @@ -18,6 +18,11 @@ {% endif %} {% endif %} +{% if ecl_component_library == 'eu' %} + {% set logo_path = ecl_logo_path ~ '/logo-eu--mute.svg'%} +{% else %} + {% set logo_path = ecl_logo_path ~ '/logo-ec--mute.svg'%} +{% endif %} {% include '@ecl-twig/language-list' with { eu_category: eu_category, @@ -27,6 +32,6 @@ icon_path: ecl_icon_path, logo: { alt: 'European Commission logo'|t, - path: ecl_logo_path ~ '/logo--mute.svg' + path: logo_path } } only %} From 65d2a49c1c557f35709c96dfdcc50ab4b02348a5 Mon Sep 17 00:00:00 2001 From: Imanol Eguskiza Date: Wed, 14 Jul 2021 13:43:26 +0200 Subject: [PATCH 4/4] EWPP-1317: Simplify logo path generation on language selection page. --- .../language-selection-page-content.html.twig | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/templates/language-selection-page/language-selection-page-content.html.twig b/templates/language-selection-page/language-selection-page-content.html.twig index cbc3064dc..2724e6a84 100644 --- a/templates/language-selection-page/language-selection-page-content.html.twig +++ b/templates/language-selection-page/language-selection-page-content.html.twig @@ -18,12 +18,6 @@ {% endif %} {% endif %} -{% if ecl_component_library == 'eu' %} - {% set logo_path = ecl_logo_path ~ '/logo-eu--mute.svg'%} -{% else %} - {% set logo_path = ecl_logo_path ~ '/logo-ec--mute.svg'%} -{% endif %} - {% include '@ecl-twig/language-list' with { eu_category: eu_category, non_eu_category: non_eu_category, @@ -32,6 +26,6 @@ icon_path: ecl_icon_path, logo: { alt: 'European Commission logo'|t, - path: logo_path + path: ecl_logo_path ~ '/logo-' ~ ecl_component_library ~ '--mute.svg' } } only %}