From 9fc563ce57e99b9893aaeca7ab799e23dbfa518b Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Thu, 20 Jan 2022 18:02:39 +0200 Subject: [PATCH 01/20] EWPP-1854: Update attributes for header. --- oe_theme.theme | 20 +++++++++++++------ .../block--system-branding-block.html.twig | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/oe_theme.theme b/oe_theme.theme index caecdf2e9..2e4937cd8 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1235,12 +1235,16 @@ function oe_theme_preprocess_block(&$variables) { * Add required variables to follow ECL guidelines. */ function oe_theme_preprocess_block__system_branding_block(&$variables) { - $variables['site_logo_alt'] = !empty($variables['site_name']) ? - t('@site_name logo', ['@site_name' => $variables['site_name']]) : - ''; - - $route_options = ['absolute' => TRUE]; - $variables['site_logo_href'] = Url::fromRoute('', [], $route_options)->toString(); + if ($variables['ecl_component_library'] === 'ec') { + $variables['logo_area_label'] = t('Home') . ' - ' . t('European Commission'); + $variables['site_logo_alt'] = t('European Commission logo'); + $site_logo_href = 'https://ec.europa.eu/info'; + } + else { + $variables['logo_area_label'] = t('Home') . ' - ' . t('European Union'); + $variables['site_logo_alt'] = t('European Union flag'); + $site_logo_href = 'https://european-union.europa.eu'; + } // Ensure the site logo falls back to english version if the language is // not EU language. @@ -1248,6 +1252,10 @@ function oe_theme_preprocess_block__system_branding_block(&$variables) { if (!EuropeanUnionLanguages::hasLanguage($language_code)) { $variables['current_language_id'] = 'en'; } + else { + $site_logo_href .= '/index_' . $variables['current_language_id']; + } + $variables['site_logo_href'] = $site_logo_href; } /** diff --git a/templates/blocks/block--system-branding-block.html.twig b/templates/blocks/block--system-branding-block.html.twig index 7f5979e3d..43dd472d7 100644 --- a/templates/blocks/block--system-branding-block.html.twig +++ b/templates/blocks/block--system-branding-block.html.twig @@ -10,7 +10,7 @@ {% if ecl_component_library == 'eu' %} Date: Thu, 20 Jan 2022 19:20:51 +0200 Subject: [PATCH 02/20] EWPP-1854: Update footer attributes. --- oe_theme.theme | 6 +++++- .../oe-corporate-blocks-eu-footer--core.html.twig | 3 ++- .../oe-corporate-blocks-eu-footer--standardised.html.twig | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/oe_theme.theme b/oe_theme.theme index 2e4937cd8..fb1447a1f 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1686,13 +1686,17 @@ function oe_theme_preprocess_oe_corporate_blocks_eu_footer(array &$variables) { $variables['logo_description'] = t('Discover more on @link', [ '@link' => new FormattableMarkup('europa.eu', []), ]); - + $site_logo_href = 'https://european-union.europa.eu'; // Ensure the site logo falls back to english version if the language is // not EU language. $language_code = \Drupal::languageManager()->getCurrentLanguage()->getId(); if (!EuropeanUnionLanguages::hasLanguage($language_code)) { $variables['current_language_id'] = 'en'; } + else { + $site_logo_href .= '/index_' . $variables['current_language_id']; + } + $variables['path'] = $site_logo_href; } /** diff --git a/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig b/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig index 26bf78b93..766a81cd4 100644 --- a/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig +++ b/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig @@ -15,10 +15,11 @@ [ { 'logo': { - 'path': 'https://europa.eu/', + 'path': path, 'language': current_language_id, 'src_mobile': ecl_logo_path ~ '/condensed-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', 'src_desktop': ecl_logo_path ~ '/standard-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', + 'title': 'European Union'|t, }, 'description': site_owner ? 'This site is managed by the European Commission, @name'|t({'@name': site_owner}), }, diff --git a/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig b/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig index 1b3b77891..d7bf69004 100644 --- a/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig +++ b/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig @@ -35,10 +35,11 @@ [ { 'logo': { - 'path': 'https://europa.eu/', + 'path': path, 'language': current_language_id, 'src_mobile': ecl_logo_path ~ '/condensed-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', 'src_desktop': ecl_logo_path ~ '/standard-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', + 'title': 'European Union'|t, }, 'description': logo_description, }, From 675413de63c56bc3ace4f1ea4f204f917cf4df9a Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Fri, 21 Jan 2022 13:08:07 +0200 Subject: [PATCH 03/20] EWPP-1854: Add accessibility attributes for footer and update tests. --- oe_theme.theme | 10 +-- .../twig-component-footer-core+3.2.0.patch | 21 ++++++ ...-component-footer-standardised+3.2.0.patch | 20 +++++- .../block--system-branding-block.html.twig | 8 +-- ...corporate-blocks-eu-footer--core.html.twig | 2 + ...e-blocks-eu-footer--standardised.html.twig | 2 + tests/features/site-branding.feature | 9 ++- tests/src/Behat/OeThemeTestContext.php | 69 ++++++++++++++++++- 8 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 patches/@ecl/twig-component-footer-core+3.2.0.patch diff --git a/oe_theme.theme b/oe_theme.theme index fb1447a1f..b0527f993 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1236,13 +1236,15 @@ function oe_theme_preprocess_block(&$variables) { */ function oe_theme_preprocess_block__system_branding_block(&$variables) { if ($variables['ecl_component_library'] === 'ec') { - $variables['logo_area_label'] = t('Home') . ' - ' . t('European Commission'); + $variables['logo_aria_label'] = t('Home') . ' - ' . t('European Commission'); $variables['site_logo_alt'] = t('European Commission logo'); + $variables['site_logo_title'] = t('European Commission'); $site_logo_href = 'https://ec.europa.eu/info'; } else { - $variables['logo_area_label'] = t('Home') . ' - ' . t('European Union'); + $variables['logo_aria_label'] = t('Home') . ' - ' . t('European Union'); $variables['site_logo_alt'] = t('European Union flag'); + $variables['site_logo_title'] = t('European Union'); $site_logo_href = 'https://european-union.europa.eu'; } @@ -1253,7 +1255,7 @@ function oe_theme_preprocess_block__system_branding_block(&$variables) { $variables['current_language_id'] = 'en'; } else { - $site_logo_href .= '/index_' . $variables['current_language_id']; + $site_logo_href .= '/index_' . EuropeanUnionLanguages::getInternalLanguageCode($variables['current_language_id']); } $variables['site_logo_href'] = $site_logo_href; } @@ -1694,7 +1696,7 @@ function oe_theme_preprocess_oe_corporate_blocks_eu_footer(array &$variables) { $variables['current_language_id'] = 'en'; } else { - $site_logo_href .= '/index_' . $variables['current_language_id']; + $site_logo_href .= '/index_' . EuropeanUnionLanguages::getInternalLanguageCode($variables['current_language_id']); } $variables['path'] = $site_logo_href; } diff --git a/patches/@ecl/twig-component-footer-core+3.2.0.patch b/patches/@ecl/twig-component-footer-core+3.2.0.patch new file mode 100644 index 000000000..39a57ab30 --- /dev/null +++ b/patches/@ecl/twig-component-footer-core+3.2.0.patch @@ -0,0 +1,21 @@ +patch-package +--- a/node_modules/@ecl/twig-component-footer-core/footer-core.html.twig ++++ b/node_modules/@ecl/twig-component-footer-core/footer-core.html.twig +@@ -5,6 +5,8 @@ + - "rows" (array of objects) (default: []) + - "logo" + - "alt" (string) alt attribute for the logo link ++ - "aria_label" (string) aria-label attribute for the logo link ++ - "title" (string) title attribute for the logo img + - "path" (string) logo link path + - "language" (string) Language code + - "src_mobile" (string) Path the mobile logo (only for EU) +@@ -91,7 +93,7 @@ + path: _sections.logo.path, + label: _label, + type: 'standalone', +- aria_label: _sections.logo.title ++ aria_label: _sections.logo.aria_label, + }, + extra_classes: 'ecl-footer-core__logo-link' + } only %} diff --git a/patches/@ecl/twig-component-footer-standardised+3.2.0.patch b/patches/@ecl/twig-component-footer-standardised+3.2.0.patch index 42f6cb56f..5b3f3b4a1 100644 --- a/patches/@ecl/twig-component-footer-standardised+3.2.0.patch +++ b/patches/@ecl/twig-component-footer-standardised+3.2.0.patch @@ -1,7 +1,25 @@ patch-package --- a/node_modules/@ecl/twig-component-footer-standardised/footer-standardised.html.twig +++ b/node_modules/@ecl/twig-component-footer-standardised/footer-standardised.html.twig -@@ -131,6 +131,7 @@ +@@ -6,6 +6,8 @@ + - "section_class_name" (string) (default: '') + - "logo" (EU only) + - "alt" (string) alt attribute for the logo link ++ - "aria_label" (string) aria-label attribute for the logo link ++ - "title" (string) title attribute for the logo img + - "path" (string) logo link path + - "language" (string) Language code + - "src_mobile" (string) Path the mobile logo +@@ -88,7 +90,7 @@ + path: _sections.logo.path, + label: _label, + type: 'standalone', +- aria_label: _sections.logo.title ++ aria_label: _sections.logo.aria_label, + }, + extra_classes: 'ecl-footer-standardised__logo-link' + } only %} +@@ -133,6 +135,7 @@ {% endif %} {% include '@ecl/link/link.html.twig' with _item|merge({ link: _item.link|default({})|merge({ type: 'standalone' }), diff --git a/templates/blocks/block--system-branding-block.html.twig b/templates/blocks/block--system-branding-block.html.twig index 43dd472d7..62a8d91f9 100644 --- a/templates/blocks/block--system-branding-block.html.twig +++ b/templates/blocks/block--system-branding-block.html.twig @@ -10,25 +10,25 @@ {% if ecl_component_library == 'eu' %} {{ site_logo_alt }} {{ site_logo_alt }} {% else %} {{ site_logo_alt }} diff --git a/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig b/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig index 766a81cd4..dc79ba82b 100644 --- a/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig +++ b/templates/navigation/oe-corporate-blocks-eu-footer--core.html.twig @@ -20,6 +20,8 @@ 'src_mobile': ecl_logo_path ~ '/condensed-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', 'src_desktop': ecl_logo_path ~ '/standard-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', 'title': 'European Union'|t, + 'alt': 'European Union flag'|t, + 'aria_label': 'Home'|t ~ ' - ' ~ 'European Union'|t, }, 'description': site_owner ? 'This site is managed by the European Commission, @name'|t({'@name': site_owner}), }, diff --git a/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig b/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig index d7bf69004..175896309 100644 --- a/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig +++ b/templates/navigation/oe-corporate-blocks-eu-footer--standardised.html.twig @@ -40,6 +40,8 @@ 'src_mobile': ecl_logo_path ~ '/condensed-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', 'src_desktop': ecl_logo_path ~ '/standard-version/positive/logo-eu--' ~ current_language_id|to_internal_language_id ~ '.svg', 'title': 'European Union'|t, + 'alt': 'European Union flag'|t, + 'aria_label': 'Home'|t ~ ' - ' ~ 'European Union'|t, }, 'description': logo_description, }, diff --git a/tests/features/site-branding.feature b/tests/features/site-branding.feature index 0922c18cc..1c4f3062f 100644 --- a/tests/features/site-branding.feature +++ b/tests/features/site-branding.feature @@ -4,24 +4,27 @@ Feature: Site branding As a product owner I want to make sure that all necessary site branding features are provided by the OpenEuropa Theme. - @javascript @enable-non-eu-language @wip + @javascript @enable-non-eu-language Scenario Outline: The European Commission logo is available throughout the site. Given I am on the homepage When the theme is configured to use the "European Union" style And I reload the page Then I should see the "logo" element in the "header" - And the "English" EU mobile logo should be available When I open the language switcher dialog And I click "" Then the "" EU mobile logo should be available + And the "" header logo should contain accessibility attributes When the theme is configured to use the "European Commission" style And I reload the page Then I should see the "logo" element in the "header" + And the "" header logo should contain accessibility attributes When I am on "the user registration page" Then I should see the "logo" element in the "header" + And the "English" header logo should contain accessibility attributes Examples: | language_selector | language | + | English | English | | български | Bulgarian | | español | Spanish | | čeština | Czech | @@ -46,7 +49,7 @@ Feature: Site branding | suomi | Finnish | | svenska | Swedish | # Non-EU language. - | Icelandic | English | + | Icelandic | Icelandic | @javascript @enable-non-eu-language Scenario: The European Union logo is available in the footer when non-EU language is selected. diff --git a/tests/src/Behat/OeThemeTestContext.php b/tests/src/Behat/OeThemeTestContext.php index 85b5f2ed6..5850db773 100644 --- a/tests/src/Behat/OeThemeTestContext.php +++ b/tests/src/Behat/OeThemeTestContext.php @@ -10,6 +10,7 @@ use Drupal\field\Entity\FieldConfig; use Drupal\node\NodeInterface; use Drupal\Tests\oe_theme\Behat\Traits\UtilityTrait; +use function PHPUnit\Framework\assertEquals; /** * Behat step definitions related to the oe_theme_test module. @@ -364,6 +365,15 @@ public function assertFooter(string $component_library, bool $presence): void { $expectation = $presence ? 'present' : 'absent'; throw new \Exception("The {$component_library} corporate footer block was expected to be {$expectation} but it is not."); } + + if ($logo && $presence) { + $link = $page->find('css', '.ecl-footer-' . $this->getEclBranding() . '__logo-link'); + assertEquals('https://european-union.europa.eu/index_en', $link->getAttribute('href')); + assertEquals(t('Home - European Union')->__toString(), $link->getAttribute('aria-label')); + $img = $link->find('css', 'img'); + assertEquals(t('European Union flag')->__toString(), $img->getAttribute('alt')); + assertEquals(t('European Union')->__toString(), $img->getAttribute('title')); + } } /** @@ -398,8 +408,65 @@ public function assertEuMobileLogo(string $language): void { 'Finnish' => 'fi', 'Swedish' => 'sv', ]; + $langcode = $lang_code[$language] ?? 'en'; $this->assertSession()->elementExists('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile'); - $this->assertSession()->elementAttributeContains('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile', 'src', 'oe_theme/dist/eu/images/logo/condensed-version/positive/' . $lang_code[$language] . '.svg'); + $this->assertSession()->elementAttributeContains('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile', 'src', 'oe_theme/dist/eu/images/logo/condensed-version/positive/logo-eu--' . $langcode . '.svg'); + } + + /** + * Asserts that the header logo contains all required attributes. + * + * @Then the :language header logo should contain accessibility attributes + */ + public function assertHeaderLogoAccessibility(string $language): void { + $theme_name = \Drupal::theme()->getActiveTheme()->getName(); + $component_library = \Drupal::config($theme_name . '.settings')->get('component_library'); + $eu_official_languages = [ + 'Bulgarian' => 'bg', + 'Czech' => 'cs', + 'Danish' => 'da', + 'German' => 'de', + 'Estonian' => 'et', + 'Greek' => 'el', + 'English' => 'en', + 'Spanish' => 'es', + 'French' => 'fr', + 'Irish' => 'ga', + 'Croatian' => 'hr', + 'Italian' => 'it', + 'Latvian' => 'lv', + 'Lithuanian' => 'lt', + 'Hungarian' => 'hu', + 'Maltese' => 'mt', + 'Dutch' => 'nl', + 'Polish' => 'pl', + 'Portuguese' => 'pt', + 'Romanian' => 'ro', + 'Slovak' => 'sk', + 'Slovenian' => 'sl', + 'Finnish' => 'fi', + 'Swedish' => 'sv', + ]; + + $link_selector = '.ecl-site-header-' . $this->getEclBranding() . '__logo-link'; + $link = $this->getSession()->getPage()->find('css', $link_selector); + if ($component_library === 'ec') { + $href = !empty($eu_official_languages[$language]) ? 'https://ec.europa.eu/info/index_' . $eu_official_languages[$language] : 'https://ec.europa.eu/info'; + $aria_label = t('Home - European Commission')->__toString(); + $img_alt = t('European Commission logo')->__toString(); + $img_title = t('European Commission')->__toString(); + } + else { + $href = !empty($eu_official_languages[$language]) ? 'https://european-union.europa.eu/index_' . $eu_official_languages[$language] : 'https://european-union.europa.eu'; + $aria_label = t('Home - European Union')->__toString(); + $img_alt = t('European Union flag')->__toString(); + $img_title = t('European Union')->__toString(); + } + assertEquals($href, $link->getAttribute('href')); + assertEquals($aria_label, $link->getAttribute('aria-label')); + $img = $link->find('css', 'img'); + assertEquals($img_alt, $img->getAttribute('alt')); + assertEquals($img_title, $img->getAttribute('title')); } /** From b0c0f50b738d419bf5215ea752c2623ded460ec0 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Fri, 21 Jan 2022 14:34:53 +0200 Subject: [PATCH 04/20] EWPP-1854: Add translation for strings used in logo attributes. --- .../oe_theme_helper/translations/oe_theme_helper-bg.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-cs.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-da.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-de.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-el.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-es.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-et.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-fi.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-fr.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-ga.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-hr.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-hu.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-it.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-lt.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-lv.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-mt.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-nl.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-pl.po | 9 +++++++++ .../translations/oe_theme_helper-pt-pt.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-ro.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-sk.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-sl.po | 9 +++++++++ .../oe_theme_helper/translations/oe_theme_helper-sv.po | 9 +++++++++ 23 files changed, 207 insertions(+) diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-bg.po b/modules/oe_theme_helper/translations/oe_theme_helper-bg.po index 9d39f0e33..546e241f0 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-bg.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-bg.po @@ -524,3 +524,12 @@ msgstr "защита на данните" msgid "Highlighted" msgstr "Акценти" + +msgid "European Union flag" +msgstr "Знаме на Европейския съюз" + +msgid "European Commission logo" +msgstr "Лого на Европейската комисия" + +msgid "Home" +msgstr "Начало" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-cs.po b/modules/oe_theme_helper/translations/oe_theme_helper-cs.po index 0aca45358..236f1c0fd 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-cs.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-cs.po @@ -524,3 +524,12 @@ msgstr "ochrany údajů" msgid "Highlighted" msgstr "Důležité" + +msgid "European Union flag" +msgstr "Vlajka Evropské unie" + +msgid "European Commission logo" +msgstr "Logo Evropské komise" + +msgid "Home" +msgstr "Úvod" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-da.po b/modules/oe_theme_helper/translations/oe_theme_helper-da.po index c3790a091..03dde5c4b 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-da.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-da.po @@ -524,3 +524,12 @@ msgstr "databeskyttelse" msgid "Highlighted" msgstr "Fremhævet" + +msgid "European Union flag" +msgstr "EU-flaget" + +msgid "European Commission logo" +msgstr "Europa-Kommissionens logo" + +msgid "Home" +msgstr "Forside" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-de.po b/modules/oe_theme_helper/translations/oe_theme_helper-de.po index 9a8839ae5..6d583633c 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-de.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-de.po @@ -524,3 +524,12 @@ msgstr "Datenschutzbestimmungen" msgid "Highlighted" msgstr "Hervorgehoben" + +msgid "European Union flag" +msgstr "Flagge der Europäischen Union" + +msgid "European Commission logo" +msgstr "Logo der Europäischen Kommission" + +msgid "Home" +msgstr "Startseite" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-el.po b/modules/oe_theme_helper/translations/oe_theme_helper-el.po index 1a6d0317d..1b3ec4819 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-el.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-el.po @@ -524,3 +524,12 @@ msgstr "όρους προστασίας δεδομένων" msgid "Highlighted" msgstr "Με επισήμανση" + +msgid "European Union flag" +msgstr "Σημαία της Ευρωπαϊκής Ένωσης" + +msgid "European Commission logo" +msgstr "Λογότυπος της Ευρωπαϊκής Επιτροπής" + +msgid "Home" +msgstr "Αρχική σελίδα" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-es.po b/modules/oe_theme_helper/translations/oe_theme_helper-es.po index 132c672f3..c2ddc01d9 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-es.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-es.po @@ -524,3 +524,12 @@ msgstr "condiciones de protección de datos" msgid "Highlighted" msgstr "Destacado" + +msgid "European Union flag" +msgstr "Bandera de la Unión Europea" + +msgid "European Commission logo" +msgstr "Logotipo de la Comisión Europea" + +msgid "Home" +msgstr "Inicio" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-et.po b/modules/oe_theme_helper/translations/oe_theme_helper-et.po index d475f2099..6e74a1ce7 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-et.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-et.po @@ -524,3 +524,12 @@ msgstr "isikuandmete kaitse põhimõtetega" msgid "Highlighted" msgstr "Esiplaanil" + +msgid "European Union flag" +msgstr "Euroopa Liidu lipp" + +msgid "European Commission logo" +msgstr "Euroopa Komisjoni logo" + +msgid "Home" +msgstr "Avaleht" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-fi.po b/modules/oe_theme_helper/translations/oe_theme_helper-fi.po index 36e6ef295..7984ed9c1 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-fi.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-fi.po @@ -524,3 +524,12 @@ msgstr "tietosuojaselosteen" msgid "Highlighted" msgstr "Valokeilassa" + +msgid "European Union flag" +msgstr "Euroopan unionin lippu" + +msgid "European Commission logo" +msgstr "Euroopan komission logo" + +msgid "Home" +msgstr "Etusivu" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-fr.po b/modules/oe_theme_helper/translations/oe_theme_helper-fr.po index 32d0d8cda..774303770 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-fr.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-fr.po @@ -524,3 +524,12 @@ msgstr "conditions relatives à la protection des données" msgid "Highlighted" msgstr "Mis en évidence" + +msgid "European Union flag" +msgstr "Drapeau de l'Union européenne" + +msgid "European Commission logo" +msgstr "Logo de la Commission européenne" + +msgid "Home" +msgstr "Accueil" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-ga.po b/modules/oe_theme_helper/translations/oe_theme_helper-ga.po index 78e9a2f52..1d4e284ac 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-ga.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-ga.po @@ -524,3 +524,12 @@ msgstr "téarmaí cosanta sonraí" msgid "Highlighted" msgstr "Aibhsithe" + +msgid "European Union flag" +msgstr "Bratach an Aontais Eorpaigh" + +msgid "European Commission logo" +msgstr "Lógó an Choimisiúin Eorpaigh" + +msgid "Home" +msgstr "Baile" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-hr.po b/modules/oe_theme_helper/translations/oe_theme_helper-hr.po index 79fc0b7b0..b88d8e292 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-hr.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-hr.po @@ -524,3 +524,12 @@ msgstr "uvjete zaštite podataka" msgid "Highlighted" msgstr "Istaknuto" + +msgid "European Union flag" +msgstr "Zastava Europske unije" + +msgid "European Commission logo" +msgstr "Logotip Europske komisije" + +msgid "Home" +msgstr "Početak" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-hu.po b/modules/oe_theme_helper/translations/oe_theme_helper-hu.po index 51075f750..d82cc8170 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-hu.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-hu.po @@ -524,3 +524,12 @@ msgstr "adatvédelmi nyilatkozatot," msgid "Highlighted" msgstr "Előtérben" + +msgid "European Union flag" +msgstr "Az Európai Unió zászlaja" + +msgid "European Commission logo" +msgstr "Az Európai Bizottság logója" + +msgid "Home" +msgstr "Kezdőlap" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-it.po b/modules/oe_theme_helper/translations/oe_theme_helper-it.po index 7722b72fe..5ddd9f9d5 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-it.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-it.po @@ -524,3 +524,12 @@ msgstr "condizioni relative alla protezione dei dati" msgid "Highlighted" msgstr "Evidenziato" + +msgid "European Union flag" +msgstr "Bandiera dell'Unione europea" + +msgid "European Commission logo" +msgstr "Logo della Commissione europea" + +msgid "Home" +msgstr "Homepage" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-lt.po b/modules/oe_theme_helper/translations/oe_theme_helper-lt.po index 2fa2359e2..647249c90 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-lt.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-lt.po @@ -524,3 +524,12 @@ msgstr "Duomenų apsaugos sąlygas" msgid "Highlighted" msgstr "Paryškinta" + +msgid "European Union flag" +msgstr "Europos Sąjungos vėliava" + +msgid "European Commission logo" +msgstr "Europos Komisijos logotipas" + +msgid "Home" +msgstr "Pradžios puslapis" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-lv.po b/modules/oe_theme_helper/translations/oe_theme_helper-lv.po index ccefac9e1..a289adc0f 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-lv.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-lv.po @@ -524,3 +524,12 @@ msgstr "datu aizsardzības noteikumus" msgid "Highlighted" msgstr "Aktuāli" + +msgid "European Union flag" +msgstr "Eiropas Savienības karogs" + +msgid "European Commission logo" +msgstr "Eiropas Komisijas logotips" + +msgid "Home" +msgstr "Sākumlapa" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-mt.po b/modules/oe_theme_helper/translations/oe_theme_helper-mt.po index 2c08a8328..0d6d2a554 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-mt.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-mt.po @@ -524,3 +524,12 @@ msgstr "mat-termini tal-protezzjoni tad-data" msgid "Highlighted" msgstr "Enfasizzat" + +msgid "European Union flag" +msgstr "Bandiera tal-Unjoni Ewropea" + +msgid "European Commission logo" +msgstr "Logo tal-Kummissjoni Ewropea" + +msgid "Home" +msgstr "Paġna ewlenija" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-nl.po b/modules/oe_theme_helper/translations/oe_theme_helper-nl.po index 3bd15a013..56259162a 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-nl.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-nl.po @@ -524,3 +524,12 @@ msgstr "privacyverklaring" msgid "Highlighted" msgstr "Actueel" + +msgid "European Union flag" +msgstr "Vlag van de Europese Unie" + +msgid "European Commission logo" +msgstr "Logo van de Europese Commissie" + +msgid "Home" +msgstr "Home" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-pl.po b/modules/oe_theme_helper/translations/oe_theme_helper-pl.po index 460a8d7ed..4fd7310cf 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-pl.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-pl.po @@ -524,3 +524,12 @@ msgstr "warunki ochrony danych" msgid "Highlighted" msgstr "Na pierwszym planie" + +msgid "European Union flag" +msgstr "Flaga Unii Europejskiej" + +msgid "European Commission logo" +msgstr "Symbol graficzny Komisji Europejskiej" + +msgid "Home" +msgstr "Strona główna" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po b/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po index 768fe5e8d..bea60b3d1 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po @@ -524,3 +524,12 @@ msgstr "condições aplicáveis em matéria de proteção de dados" msgid "Highlighted" msgstr "Em destaque" + +msgid "European Union flag" +msgstr "Bandeira da União Europeia" + +msgid "European Commission logo" +msgstr "Logótipo da Comissão Europeia" + +msgid "Home" +msgstr "Página principal" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-ro.po b/modules/oe_theme_helper/translations/oe_theme_helper-ro.po index f47484f64..9be1e01bb 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-ro.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-ro.po @@ -524,3 +524,12 @@ msgstr "prevederile referitoare la protecția datelor" msgid "Highlighted" msgstr "În prim-plan" + +msgid "European Union flag" +msgstr "Drapelul Uniunii Europene" + +msgid "European Commission logo" +msgstr "Logoul Comisiei Europene" + +msgid "Home" +msgstr "Prima pagină" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-sk.po b/modules/oe_theme_helper/translations/oe_theme_helper-sk.po index 9af6f36fa..b79da7fb8 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-sk.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-sk.po @@ -524,3 +524,12 @@ msgstr "ochrany údajov" msgid "Highlighted" msgstr "Hlavné témy" + +msgid "European Union flag" +msgstr "Vlajka Európskej únie" + +msgid "European Commission logo" +msgstr "Logo Európskej komisie" + +msgid "Home" +msgstr "Domovská stránka" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-sl.po b/modules/oe_theme_helper/translations/oe_theme_helper-sl.po index 5a0bd12fa..79063f465 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-sl.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-sl.po @@ -524,3 +524,12 @@ msgstr "varstvu podatkov" msgid "Highlighted" msgstr "Izpostavljeno" + +msgid "European Union flag" +msgstr "Zastava Evropske unije" + +msgid "European Commission logo" +msgstr "Logotip Evropske komisije" + +msgid "Home" +msgstr "Domača stran" \ No newline at end of file diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-sv.po b/modules/oe_theme_helper/translations/oe_theme_helper-sv.po index 463ef5f4f..b388014b2 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-sv.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-sv.po @@ -524,3 +524,12 @@ msgstr "skydd av personuppgifter" msgid "Highlighted" msgstr "I fokus" + +msgid "European Union flag" +msgstr "EU-flaggan" + +msgid "European Commission logo" +msgstr "Europeiska kommissionens logotyp" + +msgid "Home" +msgstr "Start" \ No newline at end of file From 2917fe53247d0a0673461295d828b3134ac74472 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Fri, 21 Jan 2022 14:50:34 +0200 Subject: [PATCH 05/20] EWPP-1854: Fix behat tests for lower dependencies. --- tests/src/Behat/OeThemeTestContext.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/src/Behat/OeThemeTestContext.php b/tests/src/Behat/OeThemeTestContext.php index 5850db773..99a0a6c3e 100644 --- a/tests/src/Behat/OeThemeTestContext.php +++ b/tests/src/Behat/OeThemeTestContext.php @@ -10,7 +10,7 @@ use Drupal\field\Entity\FieldConfig; use Drupal\node\NodeInterface; use Drupal\Tests\oe_theme\Behat\Traits\UtilityTrait; -use function PHPUnit\Framework\assertEquals; +use PHPUnit\Framework\Assert; /** * Behat step definitions related to the oe_theme_test module. @@ -368,11 +368,11 @@ public function assertFooter(string $component_library, bool $presence): void { if ($logo && $presence) { $link = $page->find('css', '.ecl-footer-' . $this->getEclBranding() . '__logo-link'); - assertEquals('https://european-union.europa.eu/index_en', $link->getAttribute('href')); - assertEquals(t('Home - European Union')->__toString(), $link->getAttribute('aria-label')); + Assert::assertEquals('https://european-union.europa.eu/index_en', $link->getAttribute('href')); + Assert::assertEquals(t('Home - European Union')->__toString(), $link->getAttribute('aria-label')); $img = $link->find('css', 'img'); - assertEquals(t('European Union flag')->__toString(), $img->getAttribute('alt')); - assertEquals(t('European Union')->__toString(), $img->getAttribute('title')); + Assert::assertEquals(t('European Union flag')->__toString(), $img->getAttribute('alt')); + Assert::assertEquals(t('European Union')->__toString(), $img->getAttribute('title')); } } @@ -462,11 +462,11 @@ public function assertHeaderLogoAccessibility(string $language): void { $img_alt = t('European Union flag')->__toString(); $img_title = t('European Union')->__toString(); } - assertEquals($href, $link->getAttribute('href')); - assertEquals($aria_label, $link->getAttribute('aria-label')); + Assert::assertEquals($href, $link->getAttribute('href')); + Assert::assertEquals($aria_label, $link->getAttribute('aria-label')); $img = $link->find('css', 'img'); - assertEquals($img_alt, $img->getAttribute('alt')); - assertEquals($img_title, $img->getAttribute('title')); + Assert::assertEquals($img_alt, $img->getAttribute('alt')); + Assert::assertEquals($img_title, $img->getAttribute('title')); } /** From 762895a0087c47d3d4d1c8327bb4773c69deaaf3 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Mon, 24 Jan 2022 17:55:57 +0200 Subject: [PATCH 06/20] EWPP-1854: Adjust patch name and improve behat context class. --- ...=> twig-component-footer-core+3.1.2.patch} | 0 tests/src/Behat/OeThemeTestContext.php | 66 ++++--------------- 2 files changed, 14 insertions(+), 52 deletions(-) rename patches/@ecl/{twig-component-footer-core+3.2.0.patch => twig-component-footer-core+3.1.2.patch} (100%) diff --git a/patches/@ecl/twig-component-footer-core+3.2.0.patch b/patches/@ecl/twig-component-footer-core+3.1.2.patch similarity index 100% rename from patches/@ecl/twig-component-footer-core+3.2.0.patch rename to patches/@ecl/twig-component-footer-core+3.1.2.patch diff --git a/tests/src/Behat/OeThemeTestContext.php b/tests/src/Behat/OeThemeTestContext.php index 99a0a6c3e..7c94e07cc 100644 --- a/tests/src/Behat/OeThemeTestContext.php +++ b/tests/src/Behat/OeThemeTestContext.php @@ -9,6 +9,7 @@ use Drupal\DrupalExtension\Context\RawDrupalContext; use Drupal\field\Entity\FieldConfig; use Drupal\node\NodeInterface; +use Drupal\oe_theme_helper\EuropeanUnionLanguages; use Drupal\Tests\oe_theme\Behat\Traits\UtilityTrait; use PHPUnit\Framework\Assert; @@ -382,32 +383,7 @@ public function assertFooter(string $component_library, bool $presence): void { * @Then the :language EU mobile logo should be available */ public function assertEuMobileLogo(string $language): void { - $lang_code = [ - 'Bulgarian' => 'bg', - 'Czech' => 'cs', - 'Danish' => 'da', - 'German' => 'de', - 'Estonian' => 'et', - 'Greek' => 'el', - 'English' => 'en', - 'Spanish' => 'es', - 'French' => 'fr', - 'Irish' => 'ga', - 'Croatian' => 'hr', - 'Italian' => 'it', - 'Latvian' => 'lv', - 'Lithuanian' => 'lt', - 'Hungarian' => 'hu', - 'Maltese' => 'mt', - 'Dutch' => 'nl', - 'Polish' => 'pl', - 'Portuguese' => 'pt', - 'Romanian' => 'ro', - 'Slovak' => 'sk', - 'Slovenian' => 'sl', - 'Finnish' => 'fi', - 'Swedish' => 'sv', - ]; + $lang_code = $this->getEuLanguages(); $langcode = $lang_code[$language] ?? 'en'; $this->assertSession()->elementExists('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile'); $this->assertSession()->elementAttributeContains('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile', 'src', 'oe_theme/dist/eu/images/logo/condensed-version/positive/logo-eu--' . $langcode . '.svg'); @@ -421,32 +397,7 @@ public function assertEuMobileLogo(string $language): void { public function assertHeaderLogoAccessibility(string $language): void { $theme_name = \Drupal::theme()->getActiveTheme()->getName(); $component_library = \Drupal::config($theme_name . '.settings')->get('component_library'); - $eu_official_languages = [ - 'Bulgarian' => 'bg', - 'Czech' => 'cs', - 'Danish' => 'da', - 'German' => 'de', - 'Estonian' => 'et', - 'Greek' => 'el', - 'English' => 'en', - 'Spanish' => 'es', - 'French' => 'fr', - 'Irish' => 'ga', - 'Croatian' => 'hr', - 'Italian' => 'it', - 'Latvian' => 'lv', - 'Lithuanian' => 'lt', - 'Hungarian' => 'hu', - 'Maltese' => 'mt', - 'Dutch' => 'nl', - 'Polish' => 'pl', - 'Portuguese' => 'pt', - 'Romanian' => 'ro', - 'Slovak' => 'sk', - 'Slovenian' => 'sl', - 'Finnish' => 'fi', - 'Swedish' => 'sv', - ]; + $eu_official_languages = $this->getEuLanguages(); $link_selector = '.ecl-site-header-' . $this->getEclBranding() . '__logo-link'; $link = $this->getSession()->getPage()->find('css', $link_selector); @@ -540,4 +491,15 @@ public function setEclBranding(string $ecl_branding): void { \Drupal::service('cache_tags.invalidator')->resetCheckSums(); } + /** + * Get the list of EU official language lang codes keyed by language name. + * + * @return array|false + * Array of languages keyed by language name. + */ + protected function getEuLanguages() { + $eu_languages = EuropeanUnionLanguages::getLanguageList(); + return array_combine(array_column($eu_languages, 0), array_column($eu_languages, 2)); + } + } From 89d64688dda5322088e8a88e53b0519ba0a0413b Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Mon, 31 Jan 2022 13:16:04 +0200 Subject: [PATCH 07/20] EWPP-1854: Move European Union string translation from oe_corporate_block component. --- modules/oe_theme_helper/translations/oe_theme_helper-bg.po | 3 +++ modules/oe_theme_helper/translations/oe_theme_helper-cs.po | 3 +++ modules/oe_theme_helper/translations/oe_theme_helper-da.po | 3 +++ modules/oe_theme_helper/translations/oe_theme_helper-de.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-el.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-es.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-et.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-fi.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-fr.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-ga.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-hr.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-hu.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-it.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-lt.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-lv.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-mt.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-nl.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-pl.po | 5 ++++- .../oe_theme_helper/translations/oe_theme_helper-pt-pt.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-ro.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-sk.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-sl.po | 5 ++++- modules/oe_theme_helper/translations/oe_theme_helper-sv.po | 5 ++++- 23 files changed, 89 insertions(+), 20 deletions(-) diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-bg.po b/modules/oe_theme_helper/translations/oe_theme_helper-bg.po index 546e241f0..d07066445 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-bg.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-bg.po @@ -533,3 +533,6 @@ msgstr "Лого на Европейската комисия" msgid "Home" msgstr "Начало" + +msgid "European Union" +msgstr "Европейски съюз" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-cs.po b/modules/oe_theme_helper/translations/oe_theme_helper-cs.po index 236f1c0fd..acb098ab0 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-cs.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-cs.po @@ -533,3 +533,6 @@ msgstr "Logo Evropské komise" msgid "Home" msgstr "Úvod" + +msgid "European Union" +msgstr "Evropská unie" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-da.po b/modules/oe_theme_helper/translations/oe_theme_helper-da.po index 03dde5c4b..a0fd00ec6 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-da.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-da.po @@ -533,3 +533,6 @@ msgstr "Europa-Kommissionens logo" msgid "Home" msgstr "Forside" + +msgid "European Union" +msgstr "Europæiske Unions" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-de.po b/modules/oe_theme_helper/translations/oe_theme_helper-de.po index 6d583633c..858a3ceef 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-de.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-de.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logo der Europäischen Kommission" msgid "Home" -msgstr "Startseite" \ No newline at end of file +msgstr "Startseite" + +msgid "European Union" +msgstr "Europäische Union" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-el.po b/modules/oe_theme_helper/translations/oe_theme_helper-el.po index 1b3ec4819..2e0da28b2 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-el.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-el.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Λογότυπος της Ευρωπαϊκής Επιτροπής" msgid "Home" -msgstr "Αρχική σελίδα" \ No newline at end of file +msgstr "Αρχική σελίδα" + +msgid "European Union" +msgstr "Ευρωπαϊκή Ένωση" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-es.po b/modules/oe_theme_helper/translations/oe_theme_helper-es.po index c2ddc01d9..24bccbecc 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-es.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-es.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logotipo de la Comisión Europea" msgid "Home" -msgstr "Inicio" \ No newline at end of file +msgstr "Inicio" + +msgid "European Union" +msgstr "Unión Europea" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-et.po b/modules/oe_theme_helper/translations/oe_theme_helper-et.po index 6e74a1ce7..3d96a9c0c 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-et.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-et.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Euroopa Komisjoni logo" msgid "Home" -msgstr "Avaleht" \ No newline at end of file +msgstr "Avaleht" + +msgid "European Union" +msgstr "Euroopa Liit" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-fi.po b/modules/oe_theme_helper/translations/oe_theme_helper-fi.po index 7984ed9c1..202340a29 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-fi.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-fi.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Euroopan komission logo" msgid "Home" -msgstr "Etusivu" \ No newline at end of file +msgstr "Etusivu" + +msgid "European Union" +msgstr "Euroopan unioni" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-fr.po b/modules/oe_theme_helper/translations/oe_theme_helper-fr.po index 774303770..14b30de70 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-fr.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-fr.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logo de la Commission européenne" msgid "Home" -msgstr "Accueil" \ No newline at end of file +msgstr "Accueil" + +msgid "European Union" +msgstr "Union européenne" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-ga.po b/modules/oe_theme_helper/translations/oe_theme_helper-ga.po index 1d4e284ac..9005c28dd 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-ga.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-ga.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Lógó an Choimisiúin Eorpaigh" msgid "Home" -msgstr "Baile" \ No newline at end of file +msgstr "Baile" + +msgid "European Union" +msgstr "Aontais Eorpaigh" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-hr.po b/modules/oe_theme_helper/translations/oe_theme_helper-hr.po index b88d8e292..9fc0d2770 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-hr.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-hr.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logotip Europske komisije" msgid "Home" -msgstr "Početak" \ No newline at end of file +msgstr "Početak" + +msgid "European Union" +msgstr "Europske unije" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-hu.po b/modules/oe_theme_helper/translations/oe_theme_helper-hu.po index d82cc8170..a5478e548 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-hu.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-hu.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Az Európai Bizottság logója" msgid "Home" -msgstr "Kezdőlap" \ No newline at end of file +msgstr "Kezdőlap" + +msgid "European Union" +msgstr "Európai Unió" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-it.po b/modules/oe_theme_helper/translations/oe_theme_helper-it.po index 5ddd9f9d5..ea8293438 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-it.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-it.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logo della Commissione europea" msgid "Home" -msgstr "Homepage" \ No newline at end of file +msgstr "Homepage" + +msgid "European Union" +msgstr "Unione europea" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-lt.po b/modules/oe_theme_helper/translations/oe_theme_helper-lt.po index 647249c90..9d5c3c071 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-lt.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-lt.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Europos Komisijos logotipas" msgid "Home" -msgstr "Pradžios puslapis" \ No newline at end of file +msgstr "Pradžios puslapis" + +msgid "European Union" +msgstr "Europos Sąjunga" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-lv.po b/modules/oe_theme_helper/translations/oe_theme_helper-lv.po index a289adc0f..72ec176b6 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-lv.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-lv.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Eiropas Komisijas logotips" msgid "Home" -msgstr "Sākumlapa" \ No newline at end of file +msgstr "Sākumlapa" + +msgid "European Union" +msgstr "Eiropas Savienība" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-mt.po b/modules/oe_theme_helper/translations/oe_theme_helper-mt.po index 0d6d2a554..88c895b3a 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-mt.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-mt.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logo tal-Kummissjoni Ewropea" msgid "Home" -msgstr "Paġna ewlenija" \ No newline at end of file +msgstr "Paġna ewlenija" + +msgid "European Union" +msgstr "L-Unjoni Ewropea" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-nl.po b/modules/oe_theme_helper/translations/oe_theme_helper-nl.po index 56259162a..50c62bf16 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-nl.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-nl.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logo van de Europese Commissie" msgid "Home" -msgstr "Home" \ No newline at end of file +msgstr "Home" + +msgid "European Union" +msgstr "Europese Unie" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-pl.po b/modules/oe_theme_helper/translations/oe_theme_helper-pl.po index 4fd7310cf..57003f6b1 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-pl.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-pl.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Symbol graficzny Komisji Europejskiej" msgid "Home" -msgstr "Strona główna" \ No newline at end of file +msgstr "Strona główna" + +msgid "European Union" +msgstr "Unia Europejska" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po b/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po index bea60b3d1..ca9f27578 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-pt-pt.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logótipo da Comissão Europeia" msgid "Home" -msgstr "Página principal" \ No newline at end of file +msgstr "Página principal" + +msgid "European Union" +msgstr "União Europeia" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-ro.po b/modules/oe_theme_helper/translations/oe_theme_helper-ro.po index 9be1e01bb..8d0e8c6d7 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-ro.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-ro.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logoul Comisiei Europene" msgid "Home" -msgstr "Prima pagină" \ No newline at end of file +msgstr "Prima pagină" + +msgid "European Union" +msgstr "Uniunea Europeană" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-sk.po b/modules/oe_theme_helper/translations/oe_theme_helper-sk.po index b79da7fb8..e9f29fbc0 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-sk.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-sk.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logo Európskej komisie" msgid "Home" -msgstr "Domovská stránka" \ No newline at end of file +msgstr "Domovská stránka" + +msgid "European Union" +msgstr "Európska únia" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-sl.po b/modules/oe_theme_helper/translations/oe_theme_helper-sl.po index 79063f465..a5521133c 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-sl.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-sl.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Logotip Evropske komisije" msgid "Home" -msgstr "Domača stran" \ No newline at end of file +msgstr "Domača stran" + +msgid "European Union" +msgstr "Evropska unija" diff --git a/modules/oe_theme_helper/translations/oe_theme_helper-sv.po b/modules/oe_theme_helper/translations/oe_theme_helper-sv.po index b388014b2..4c925f010 100644 --- a/modules/oe_theme_helper/translations/oe_theme_helper-sv.po +++ b/modules/oe_theme_helper/translations/oe_theme_helper-sv.po @@ -532,4 +532,7 @@ msgid "European Commission logo" msgstr "Europeiska kommissionens logotyp" msgid "Home" -msgstr "Start" \ No newline at end of file +msgstr "Start" + +msgid "European Union" +msgstr "Europeiska unionen" From 88f69d543de2dec6a21c982c4c9e160beb5f4947 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Mon, 31 Jan 2022 13:48:27 +0200 Subject: [PATCH 08/20] EWPP-1854: Use last release for oe_search. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 13cec5bfc..a47833c6a 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "openeuropa/oe_media": "~1.12", "openeuropa/oe_multilingual": "~1.8", "openeuropa/oe_paragraphs": "~1.10", - "openeuropa/oe_search": "1.x-dev", + "openeuropa/oe_search": "~1.8", "openeuropa/oe_webtools": "~1.12", "openeuropa/oe_contact_forms": "~1.1", "openeuropa/rdf_skos": "~1.0", From 18ab197648d8f11b981369f6f0a49a0b73417afa Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Mon, 31 Jan 2022 14:03:52 +0200 Subject: [PATCH 09/20] EWPP-1854: Fix phpcs issues. --- modules/oe_theme_helper/oe_theme_helper.module | 2 +- oe_theme.theme | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/oe_theme_helper/oe_theme_helper.module b/modules/oe_theme_helper/oe_theme_helper.module index ff5e59cb2..04601a598 100644 --- a/modules/oe_theme_helper/oe_theme_helper.module +++ b/modules/oe_theme_helper/oe_theme_helper.module @@ -141,7 +141,7 @@ function oe_theme_helper_field_widget_oe_paragraphs_variants_form_alter(&$elemen function template_preprocess_oe_theme_helper_in_page_navigation(array &$variables) { $variables['title'] = $variables['element']['#title']; $variables['entity'] = $variables['element']['#entity']; - $variables['items'] = isset($variables['element']['#items']) ? $variables['element']['#items'] : []; + $variables['items'] = $variables['element']['#items'] ?? []; // Process in-page navigation items, assigning them a unique ID. foreach ($variables['items'] as $key => $item) { diff --git a/oe_theme.theme b/oe_theme.theme index b0527f993..b9d806b9c 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1197,7 +1197,7 @@ function _oe_theme_preprocess_search_input_text(array $element): array { $ecl_array = [ 'id' => $element['#attributes']['id'], 'name' => $element['#attributes']['name'], - 'disabled' => isset($element['#attributes']['disabled']) ? $element['#attributes']['disabled'] : FALSE, + 'disabled' => $element['#attributes']['disabled'] ?? FALSE, 'type' => $element['#attributes']['type'], 'class' => $element['#attributes']['class'], ]; @@ -1308,7 +1308,7 @@ function oe_theme_preprocess_table(array &$variables): void { // Assign data to table headers as ECL expects it. $ecl_table_header_data = []; - $variables['header'] = isset($variables['header']) ? $variables['header'] : []; + $variables['header'] = $variables['header'] ?? []; foreach ($variables['header'] as &$cell) { $cell['label'] = $cell['content']; @@ -1332,7 +1332,7 @@ function oe_theme_preprocess_table(array &$variables): void { // Account for colspan values when counting the number of columns. // This ensures that header content is is displayed on related columns // when the table is displayed on small screen devices. - $columns_count = isset($cell['colspan']) ? $cell['colspan'] : 1; + $columns_count = $cell['colspan'] ?? 1; for ($i = 1; $i <= $columns_count; $i++) { $ecl_table_header_data[] = $cell_header_data; } From 44f708d0de370880f1cae5d75f8059c11ec58513 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Wed, 2 Feb 2022 17:02:44 +0200 Subject: [PATCH 10/20] EWPP-1854: Update dev dependencies in composer.json file. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a47833c6a..671ba9ad7 100644 --- a/composer.json +++ b/composer.json @@ -46,12 +46,12 @@ "openeuropa/behat-transformation-context": "~0.1", "openeuropa/code-review": "~1.6", "openeuropa/drupal-core-require-dev": "^8.9 || ^9.1", - "openeuropa/oe_content": "~2.6", + "openeuropa/oe_content": "2.x-dev", "openeuropa/oe_corporate_blocks": "~4.0", "openeuropa/oe_corporate_countries": "~2.0", "openeuropa/oe_media": "~1.12", "openeuropa/oe_multilingual": "~1.8", - "openeuropa/oe_paragraphs": "~1.10", + "openeuropa/oe_paragraphs": "dev-master", "openeuropa/oe_search": "~1.8", "openeuropa/oe_webtools": "~1.12", "openeuropa/oe_contact_forms": "~1.1", From 4f4a79a1cac9b4ac0fac3775fa9aa2cd9234e774 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Wed, 2 Feb 2022 17:30:18 +0200 Subject: [PATCH 11/20] EWPP-1854: Fix functional and kernel after change in skos terms. --- tests/src/Functional/ContentOrganisationRenderTest.php | 2 +- tests/src/Functional/ContentPersonRenderTest.php | 8 ++++---- tests/src/Kernel/PersonRenderTest.php | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/src/Functional/ContentOrganisationRenderTest.php b/tests/src/Functional/ContentOrganisationRenderTest.php index e7b873d54..539d76fb9 100644 --- a/tests/src/Functional/ContentOrganisationRenderTest.php +++ b/tests/src/Functional/ContentOrganisationRenderTest.php @@ -288,7 +288,7 @@ public function testOrganisationRendering(): void { $person->save(); $this->getSession()->reload(); $person_content = $content_items[2]->findAll('css', 'article.ecl-u-d-flex.ecl-u-pv-m.ecl-u-border-bottom.ecl-u-border-color-grey-15'); - $this->assertEquals('Advisor, Chief advisor', $person_content[0]->find('css', '.ecl-content-item__meta.ecl-u-type-s.ecl-u-type-color-grey-75.ecl-u-mb-xs')->getText()); + $this->assertEquals('Adviser, Chief Adviser', $person_content[0]->find('css', '.ecl-content-item__meta.ecl-u-type-s.ecl-u-type-color-grey-75.ecl-u-mb-xs')->getText()); } } diff --git a/tests/src/Functional/ContentPersonRenderTest.php b/tests/src/Functional/ContentPersonRenderTest.php index 28d38c0da..56b4fb6be 100644 --- a/tests/src/Functional/ContentPersonRenderTest.php +++ b/tests/src/Functional/ContentPersonRenderTest.php @@ -220,7 +220,7 @@ public function testPersonRendering(): void { $node->set('oe_person_jobs', $job_1)->save(); $this->drupalGet($node->toUrl()); - $page_header_expected_values['meta'] = ['(Acting) Advisor']; + $page_header_expected_values['meta'] = ['(Acting) Adviser']; $assert->assertPattern($page_header_expected_values, $page_header->getOuterHtml()); $inpage_nav_expected_values['list'][] = [ @@ -233,7 +233,7 @@ public function testPersonRendering(): void { $this->assertCount(3, $content_items); $this->assertContentHeader($content_items[2], 'Responsibilities', 'responsibilities'); $job_role_content = $content_items[2]->find('css', 'h3.ecl-u-type-heading-3.ecl-u-mt-none.ecl-u-mb-s'); - $this->assertEquals('(Acting) Advisor', $job_role_content->getText()); + $this->assertEquals('(Acting) Adviser', $job_role_content->getText()); $job_description_content = $content_items[2]->find('css', 'div.ecl-u-mb-l.ecl'); $this->assertEquals('Description job_1', $job_description_content->getText()); @@ -242,12 +242,12 @@ public function testPersonRendering(): void { $node->set('oe_person_jobs', [$job_1, $job_2])->save(); $this->drupalGet($node->toUrl()); - $page_header_expected_values['meta'] = ['(Acting) Advisor, Chief advisor']; + $page_header_expected_values['meta'] = ['(Acting) Adviser, Chief Adviser']; $assert->assertPattern($page_header_expected_values, $page_header->getOuterHtml()); $content_items = $content->findAll('xpath', '/div'); $job_role_items = $content_items[2]->findAll('css', 'h3.ecl-u-type-heading-3.ecl-u-mt-none.ecl-u-mb-s'); - $this->assertEquals('Chief advisor', $job_role_items[1]->getText()); + $this->assertEquals('Chief Adviser', $job_role_items[1]->getText()); $job_description_items = $content_items[2]->findAll('css', 'div.ecl-u-mb-l.ecl'); $this->assertEquals('Description job_2', $job_description_items[1]->getText()); diff --git a/tests/src/Kernel/PersonRenderTest.php b/tests/src/Kernel/PersonRenderTest.php index 0a8807c0a..c55887805 100644 --- a/tests/src/Kernel/PersonRenderTest.php +++ b/tests/src/Kernel/PersonRenderTest.php @@ -258,11 +258,11 @@ public function testTeaser(): void { 'variant' => 'highlight', ], ]; - $expected_values['meta'] = '(Acting) Advisor'; + $expected_values['meta'] = '(Acting) Adviser'; $expected_values['additional_information'][1] = new PatternAssertState(new FieldListAssert(), [ 'items' => [ [ - 'label' => '(Acting) Advisor', + 'label' => '(Acting) Adviser', 'body' => 'Description job_1', ], ], @@ -271,14 +271,14 @@ public function testTeaser(): void { $job_2 = $this->createPersonJobEntity('job_2', ['oe_role_reference' => 'http://publications.europa.eu/resource/authority/role-qualifier/ADVIS_CHIEF']); $node->set('oe_person_jobs', [$job_1, $job_2])->save(); - $expected_values['meta'] = '(Acting) Advisor, Chief advisor'; + $expected_values['meta'] = '(Acting) Adviser, Chief Adviser'; $expected_values['additional_information'][1] = new PatternAssertState(new FieldListAssert(), [ 'items' => [ [ - 'label' => '(Acting) Advisor', + 'label' => '(Acting) Adviser', 'body' => 'Description job_1', ], [ - 'label' => 'Chief advisor', + 'label' => 'Chief Adviser', 'body' => 'Description job_2', ], ], From 7ef78d55fe8260b746bbe5cb69b0fe22944a62df Mon Sep 17 00:00:00 2001 From: upchuk Date: Tue, 11 Jan 2022 15:56:46 +0200 Subject: [PATCH 12/20] EWPP-1860: Prepending inpage nav ids with ref-. --- js/inpage_navigation.js | 7 +++++++ .../oe-theme-inpage-navigation-test-content.html.twig | 2 ++ .../FunctionalJavascript/InPageNavigationBlockTest.php | 2 ++ .../InPageNavigationLibraryTest.php | 10 ++++++++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/js/inpage_navigation.js b/js/inpage_navigation.js index 845c4ed1e..d5f5ae958 100644 --- a/js/inpage_navigation.js +++ b/js/inpage_navigation.js @@ -136,6 +136,13 @@ return false; } + if (!slug[0].match("^[a-zA-Z]*$")) { + // In case the slug doesn't start with letters, append a string to + // ensure that the resulting slug is always a valid query selector. + slug = 'ref-' + slug; + originalSlug = slug; + } + // If an element with the generated slug as ID already exists, mark the slug as seen. if (!this.seenIds.hasOwnProperty(slug) && document.querySelector('#' + slug)) { this.seenIds[slug] = 0; diff --git a/modules/oe_theme_helper/tests/modules/oe_theme_inpage_navigation_test/templates/oe-theme-inpage-navigation-test-content.html.twig b/modules/oe_theme_helper/tests/modules/oe_theme_inpage_navigation_test/templates/oe-theme-inpage-navigation-test-content.html.twig index fcb85edc3..5097d0003 100644 --- a/modules/oe_theme_helper/tests/modules/oe_theme_inpage_navigation_test/templates/oe-theme-inpage-navigation-test-content.html.twig +++ b/modules/oe_theme_helper/tests/modules/oe_theme_inpage_navigation_test/templates/oe-theme-inpage-navigation-test-content.html.twig @@ -45,4 +45,6 @@ {# An element that will generate an ID that can represent a property of the Object prototype. #}

Length

+

2022, a new year

+ diff --git a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationBlockTest.php b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationBlockTest.php index 5f7fb9e55..ebe8d02a3 100644 --- a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationBlockTest.php +++ b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationBlockTest.php @@ -10,6 +10,8 @@ /** * Test Inpage navigation block plugin. + * + * @group batch3 */ class InPageNavigationBlockTest extends WebDriverTestBase { diff --git a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php index d96b3d9ab..3afa29afc 100644 --- a/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php +++ b/modules/oe_theme_helper/tests/src/FunctionalJavascript/InPageNavigationLibraryTest.php @@ -66,7 +66,7 @@ public function testLibrary(): void { // container. // CSS selector uses "descendent-or-self" as prefix, so we need to use // XPath to exclude the container from the selection. - $this->assertCount(10, $container->findAll('xpath', '//*[@id]')); + $this->assertCount(11, $container->findAll('xpath', '//*[@id]')); $inner = $container->find('xpath', '/div[@data-inpage-navigation-source-area="h3"]'); // Since an element with ID "details" already exists in the page, the @@ -91,10 +91,12 @@ public function testLibrary(): void { // easier to assert the content. $this->assertEquals('Title with HTML tags', $container->find('xpath', '/h3[@id="title-with-html-tags"]')->getHtml()); - // Last 3 assertions for the ID generation. + // Last 4 assertions for the ID generation. $this->assertEquals('strip--unwanted-characters', $container->find('css', '.strip')->getAttribute('id')); $this->assertEquals('constructor', $container->find('xpath', '/h3[@class="heading"][text()="Reserved keyword"]')->getAttribute('id')); $this->assertEquals('length', $container->find('xpath', '/h3[@class="heading"][text()="Length"]')->getAttribute('id')); + // The heading starting with a non-alpha character gets a ref- prepended. + $this->assertEquals('ref-2022-a-new-year', $container->find('xpath', '/h3[@class="heading"][text()="2022, a new year"]')->getAttribute('id')); $navigation = $assert_session->elementExists('css', '#block-inpage-navigation nav[data-ecl-inpage-navigation]'); $assert = new InPageNavigationAssert(); @@ -137,6 +139,10 @@ public function testLibrary(): void { 'label' => 'Length', 'href' => '#length', ], + [ + 'label' => '2022, a new year', + 'href' => '#ref-2022-a-new-year', + ], ], ]; $assert->assertPattern($expected, $navigation->getOuterHtml()); From 8dba40e210acedcdc2e135ce2559897c32ad3f33 Mon Sep 17 00:00:00 2001 From: upchuk Date: Wed, 2 Feb 2022 09:28:56 +0100 Subject: [PATCH 13/20] EWPP-1860: Updating dev dependencies. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 671ba9ad7..13244f5c2 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "openeuropa/oe_media": "~1.12", "openeuropa/oe_multilingual": "~1.8", "openeuropa/oe_paragraphs": "dev-master", - "openeuropa/oe_search": "~1.8", + "openeuropa/oe_search": "^1.8", "openeuropa/oe_webtools": "~1.12", "openeuropa/oe_contact_forms": "~1.1", "openeuropa/rdf_skos": "~1.0", From 9bee9f6ecbdb98022d127bc23f2cc37d2b1af361 Mon Sep 17 00:00:00 2001 From: Evgenii Nikitin Date: Thu, 20 Jan 2022 14:45:17 +0300 Subject: [PATCH 14/20] EWPP-1888: Handle non-eu logos provided by ECL 3.2. --- oe_theme.theme | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/oe_theme.theme b/oe_theme.theme index b9d806b9c..8e84c11a3 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1248,11 +1248,27 @@ function oe_theme_preprocess_block__system_branding_block(&$variables) { $site_logo_href = 'https://european-union.europa.eu'; } - // Ensure the site logo falls back to english version if the language is - // not EU language. + // Provide correct icon for non-eu languages. $language_code = \Drupal::languageManager()->getCurrentLanguage()->getId(); if (!EuropeanUnionLanguages::hasLanguage($language_code)) { - $variables['current_language_id'] = 'en'; + $language_icon_mapping = [ + 'nb' => 'no', + 'tr' => 'tu', + ]; + if (isset($language_icon_mapping[$language_code])) { + // Set correct icon for Norwegian and Turkish languages. + $variables['current_language_id'] = $language_icon_mapping[$language_code]; + } + else { + // Check whether ECL provides a logo for the language. + $ecl_logo = DRUPAL_ROOT . '/' . drupal_get_path('theme', 'oe_theme') . '/dist/' . $variables['ecl_component_library'] . '/images/logo/'; + $ecl_logo .= $variables['ecl_component_library'] === 'eu' ? 'standard-version/positive/' : ''; + $ecl_logo .= 'logo-' . $variables['ecl_component_library'] . '--' . $language_code . '.svg'; + if (!file_exists($ecl_logo)) { + // Provide fallback "en" icon if language logo doesn't exist. + $variables['current_language_id'] = 'en'; + } + } } else { $site_logo_href .= '/index_' . EuropeanUnionLanguages::getInternalLanguageCode($variables['current_language_id']); From 45be8a5bde67446485fd85bb934380984e724855 Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Thu, 27 Jan 2022 17:02:03 +0200 Subject: [PATCH 15/20] EWPP-1935: Uppdate ECL version to 3.2.2. --- package.json | 92 +++++++++---------- ....patch => twig-component-card+3.2.2.patch} | 0 ...component-footer-standardised+3.2.2.patch} | 0 ...patch => twig-component-table+3.2.2.patch} | 0 4 files changed, 46 insertions(+), 46 deletions(-) rename patches/@ecl/{twig-component-card+3.2.0.patch => twig-component-card+3.2.2.patch} (100%) rename patches/@ecl/{twig-component-footer-standardised+3.2.0.patch => twig-component-footer-standardised+3.2.2.patch} (100%) rename patches/@ecl/{twig-component-table+3.2.0.patch => twig-component-table+3.2.2.patch} (100%) diff --git a/package.json b/package.json index d594ac780..d29d246e7 100644 --- a/package.json +++ b/package.json @@ -14,53 +14,53 @@ "prepare": "patch-package" }, "dependencies": { - "@ecl/builder": "3.2.0", - "@ecl/preset-ec": "3.2.0", - "@ecl/preset-eu": "3.2.0", - "@ecl/preset-reset": "3.2.0", + "@ecl/builder": "3.2.2", + "@ecl/preset-ec": "3.2.2", + "@ecl/preset-eu": "3.2.2", + "@ecl/preset-reset": "3.2.2", "@ecl/stylelint-config": "0.2.1", - "@ecl/theme-ec": "3.2.0", - "@ecl/theme-eu": "3.2.0", - "@ecl/twig-component-accordion": "3.2.0", - "@ecl/twig-component-blockquote": "3.2.0", - "@ecl/twig-component-breadcrumb-core": "3.2.0", - "@ecl/twig-component-breadcrumb-standardised": "3.2.0", - "@ecl/twig-component-button": "3.2.0", - "@ecl/twig-component-card": "3.2.0", - "@ecl/twig-component-datepicker": "3.2.0", - "@ecl/twig-component-description-list": "3.2.0", - "@ecl/twig-component-expandable": "3.2.0", - "@ecl/twig-component-fact-figures": "3.2.0", - "@ecl/twig-component-file": "3.2.0", - "@ecl/twig-component-footer-core": "3.2.0", - "@ecl/twig-component-footer-standardised": "3.2.0", - "@ecl/twig-component-gallery": "3.2.0", - "@ecl/twig-component-hero-banner": "3.2.0", - "@ecl/twig-component-icon": "3.2.0", - "@ecl/twig-component-inpage-navigation": "3.2.0", - "@ecl/twig-component-language-list": "3.2.0", - "@ecl/twig-component-link": "3.2.0", - "@ecl/twig-component-label": "3.2.0", - "@ecl/twig-component-media-container": "3.2.0", - "@ecl/twig-component-menu": "3.2.0", - "@ecl/twig-component-message": "3.2.0", - "@ecl/twig-component-page-banner": "3.2.0", - "@ecl/twig-component-page-header-core": "3.2.0", - "@ecl/twig-component-page-header-standardised": "3.2.0", - "@ecl/twig-component-pagination": "3.2.0", - "@ecl/twig-component-radio": "3.2.0", - "@ecl/twig-component-search-form": "3.2.0", - "@ecl/twig-component-site-header-core": "3.2.0", - "@ecl/twig-component-site-header-standardised": "3.2.0", - "@ecl/twig-component-skip-link": "3.2.0", - "@ecl/twig-component-social-media-follow": "3.2.0", - "@ecl/twig-component-social-media-share": "3.2.0", - "@ecl/twig-component-table": "3.2.0", - "@ecl/twig-component-tag": "3.2.0", - "@ecl/twig-component-text-input": "3.2.0", - "@ecl/twig-component-timeline": "3.2.0", - "@ecl/vanilla-utility-background": "3.2.0", - "@ecl/vanilla-utility-border": "3.2.0", + "@ecl/theme-ec": "3.2.2", + "@ecl/theme-eu": "3.2.2", + "@ecl/twig-component-accordion": "3.2.2", + "@ecl/twig-component-blockquote": "3.2.2", + "@ecl/twig-component-breadcrumb-core": "3.2.2", + "@ecl/twig-component-breadcrumb-standardised": "3.2.2", + "@ecl/twig-component-button": "3.2.2", + "@ecl/twig-component-card": "3.2.2", + "@ecl/twig-component-datepicker": "3.2.2", + "@ecl/twig-component-description-list": "3.2.2", + "@ecl/twig-component-expandable": "3.2.2", + "@ecl/twig-component-fact-figures": "3.2.2", + "@ecl/twig-component-file": "3.2.2", + "@ecl/twig-component-footer-core": "3.2.2", + "@ecl/twig-component-footer-standardised": "3.2.2", + "@ecl/twig-component-gallery": "3.2.2", + "@ecl/twig-component-hero-banner": "3.2.2", + "@ecl/twig-component-icon": "3.2.2", + "@ecl/twig-component-inpage-navigation": "3.2.2", + "@ecl/twig-component-language-list": "3.2.2", + "@ecl/twig-component-link": "3.2.2", + "@ecl/twig-component-label": "3.2.2", + "@ecl/twig-component-media-container": "3.2.2", + "@ecl/twig-component-menu": "3.2.2", + "@ecl/twig-component-message": "3.2.2", + "@ecl/twig-component-page-banner": "3.2.2", + "@ecl/twig-component-page-header-core": "3.2.2", + "@ecl/twig-component-page-header-standardised": "3.2.2", + "@ecl/twig-component-pagination": "3.2.2", + "@ecl/twig-component-radio": "3.2.2", + "@ecl/twig-component-search-form": "3.2.2", + "@ecl/twig-component-site-header-core": "3.2.2", + "@ecl/twig-component-site-header-standardised": "3.2.2", + "@ecl/twig-component-skip-link": "3.2.2", + "@ecl/twig-component-social-media-follow": "3.2.2", + "@ecl/twig-component-social-media-share": "3.2.2", + "@ecl/twig-component-table": "3.2.2", + "@ecl/twig-component-tag": "3.2.2", + "@ecl/twig-component-text-input": "3.2.2", + "@ecl/twig-component-timeline": "3.2.2", + "@ecl/vanilla-utility-background": "3.2.2", + "@ecl/vanilla-utility-border": "3.2.2", "chokidar-cli": "1.2.0", "grunt": "^1.4.0", "grunt-contrib-copy": "^1.0.0", diff --git a/patches/@ecl/twig-component-card+3.2.0.patch b/patches/@ecl/twig-component-card+3.2.2.patch similarity index 100% rename from patches/@ecl/twig-component-card+3.2.0.patch rename to patches/@ecl/twig-component-card+3.2.2.patch diff --git a/patches/@ecl/twig-component-footer-standardised+3.2.0.patch b/patches/@ecl/twig-component-footer-standardised+3.2.2.patch similarity index 100% rename from patches/@ecl/twig-component-footer-standardised+3.2.0.patch rename to patches/@ecl/twig-component-footer-standardised+3.2.2.patch diff --git a/patches/@ecl/twig-component-table+3.2.0.patch b/patches/@ecl/twig-component-table+3.2.2.patch similarity index 100% rename from patches/@ecl/twig-component-table+3.2.0.patch rename to patches/@ecl/twig-component-table+3.2.2.patch From 46cf0646a6e9347b4dc00192c98bbe762a2a349d Mon Sep 17 00:00:00 2001 From: Sergii Pavlenko Date: Fri, 28 Jan 2022 11:29:55 +0200 Subject: [PATCH 16/20] EWPP-1935: Remove mapping for turkish language. --- oe_theme.theme | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/oe_theme.theme b/oe_theme.theme index 8e84c11a3..20c514a9b 100644 --- a/oe_theme.theme +++ b/oe_theme.theme @@ -1251,13 +1251,9 @@ function oe_theme_preprocess_block__system_branding_block(&$variables) { // Provide correct icon for non-eu languages. $language_code = \Drupal::languageManager()->getCurrentLanguage()->getId(); if (!EuropeanUnionLanguages::hasLanguage($language_code)) { - $language_icon_mapping = [ - 'nb' => 'no', - 'tr' => 'tu', - ]; - if (isset($language_icon_mapping[$language_code])) { - // Set correct icon for Norwegian and Turkish languages. - $variables['current_language_id'] = $language_icon_mapping[$language_code]; + if ($language_code === 'nb') { + // Set correct icon for Norwegian language. + $variables['current_language_id'] = 'no'; } else { // Check whether ECL provides a logo for the language. From 2642d5ac04eaa07af231b721ddd68070f6b6e5ce Mon Sep 17 00:00:00 2001 From: Evgenii Nikitin Date: Wed, 2 Feb 2022 14:58:22 +0300 Subject: [PATCH 17/20] EWPP-1888: Fix PHPCS and components issues. --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 13244f5c2..7e25edda8 100644 --- a/composer.json +++ b/composer.json @@ -64,7 +64,6 @@ "We explicitly require consolidation/robo to allow lower 'composer update --prefer-lowest' to complete successfully.", "We explicitly require consolidation/annotated-command to allow lower 'composer update --prefer-lowest' to complete successfully.", "We explicity require drupal/core to allow lower 'composer update --prefer-lowest' to complete successfully.", - "openeuropa/oe_search is used from a branch because of major upgrading is pending. Change again when it released.", "openeuropa/ecl-twig-loader is used from a branch because it must be upgrade to be D9 compatible. Change again when it released." ], "conflict": { From 9bbbee45e32cf8f3676e14a107d2cee982168c4b Mon Sep 17 00:00:00 2001 From: Imanol Eguskiza Date: Mon, 7 Feb 2022 09:50:35 +0100 Subject: [PATCH 18/20] EWPP-1888: Restore oe_search comment on composer.json. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 7e25edda8..13244f5c2 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,7 @@ "We explicitly require consolidation/robo to allow lower 'composer update --prefer-lowest' to complete successfully.", "We explicitly require consolidation/annotated-command to allow lower 'composer update --prefer-lowest' to complete successfully.", "We explicity require drupal/core to allow lower 'composer update --prefer-lowest' to complete successfully.", + "openeuropa/oe_search is used from a branch because of major upgrading is pending. Change again when it released.", "openeuropa/ecl-twig-loader is used from a branch because it must be upgrade to be D9 compatible. Change again when it released." ], "conflict": { From 48434b2c2b5231658c8085e98c437415079f70d0 Mon Sep 17 00:00:00 2001 From: Imanol Eguskiza Date: Mon, 7 Feb 2022 10:46:38 +0100 Subject: [PATCH 19/20] EWPP-1888: Check for new non eu logos on behat tests. --- tests/src/Behat/OeThemeTestContext.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/src/Behat/OeThemeTestContext.php b/tests/src/Behat/OeThemeTestContext.php index 7c94e07cc..57a592296 100644 --- a/tests/src/Behat/OeThemeTestContext.php +++ b/tests/src/Behat/OeThemeTestContext.php @@ -384,6 +384,14 @@ public function assertFooter(string $component_library, bool $presence): void { */ public function assertEuMobileLogo(string $language): void { $lang_code = $this->getEuLanguages(); + $available_non_eu_logos = [ + 'Turkish' => 'tr', + 'Icelandic' => 'is', + 'Catalan' => 'ca', + 'Arabic' => 'ar', + 'Norwegian' => 'no', + ]; + $lang_code = array_merge($lang_code, $available_non_eu_logos); $langcode = $lang_code[$language] ?? 'en'; $this->assertSession()->elementExists('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile'); $this->assertSession()->elementAttributeContains('css', 'img.ecl-site-header-' . $this->getEclBranding() . '__logo-image-mobile', 'src', 'oe_theme/dist/eu/images/logo/condensed-version/positive/logo-eu--' . $langcode . '.svg'); From 003d77200fa48907c766f2e2c5bcb15c3c51bc26 Mon Sep 17 00:00:00 2001 From: Imanol Eguskiza Date: Mon, 7 Feb 2022 11:54:32 +0100 Subject: [PATCH 20/20] Prepare release 3.0.0-beta8. --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06bfbe2a1..a7c9a0efa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [3.0.0-beta8](https://github.com/openeuropa/oe_theme/tree/3.0.0-beta8) (2022-02-07) + +[Full Changelog](https://github.com/openeuropa/oe_theme/compare/3.0.0-beta7...3.0.0-beta8) + +**Closed issues:** + +- Navigation is displayed above the breadcrumb [\#1002](https://github.com/openeuropa/oe_theme/issues/1002) + +**Merged pull requests:** + +- EWPP-1888: Handle non-eu logos provided by ECL 3.2. [\#1011](https://github.com/openeuropa/oe_theme/pull/1011) ([yenyasinn](https://github.com/yenyasinn)) +- EWPP-1860: Prepending inpage nav ids with ref-. [\#1004](https://github.com/openeuropa/oe_theme/pull/1004) ([upchuk](https://github.com/upchuk)) +- EWPP-1854: Adapt HTML attributes to improve accessibility and behavior of the Logo link in header and footer. [\#1012](https://github.com/openeuropa/oe_theme/pull/1012) ([sergepavle](https://github.com/sergepavle)) +- EWPP-1585: Show calendar icon on the datepicker. [\#1010](https://github.com/openeuropa/oe_theme/pull/1010) ([yenyasinn](https://github.com/yenyasinn)) +- EWPP-1890: Update to ECL 3.2.0. [\#1008](https://github.com/openeuropa/oe_theme/pull/1008) ([22Alexandra](https://github.com/22Alexandra)) +- EWPP-1631: Contact "name" field should remain optional. [\#984](https://github.com/openeuropa/oe_theme/pull/984) ([yenyasinn](https://github.com/yenyasinn)) +- EPIC-EWPP-755-Highlighted [\#1005](https://github.com/openeuropa/oe_theme/pull/1005) ([22Alexandra](https://github.com/22Alexandra)) +- EWPP-1728: Define blocks for project results field group template. [\#992](https://github.com/openeuropa/oe_theme/pull/992) ([nagyad](https://github.com/nagyad)) + ## [3.0.0-beta7](https://github.com/openeuropa/oe_theme/tree/3.0.0-beta7) (2021-12-06) [Full Changelog](https://github.com/openeuropa/oe_theme/compare/3.0.0-beta6...3.0.0-beta7)