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

EWPP-2204: Update epic branch for Simple Teaser. #1115

Merged
Merged
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: 6 additions & 9 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ default:
- OpenEuropa\Behat\TransformationContext:
elements:
about dropdown menu: ".ecl-menu__item:nth-child(2) .ecl-menu__mega"
breadcrumb: "nav.ecl-breadcrumb-core"
breadcrumb: "nav.ecl-breadcrumb"
dropdown content: ".ecl-unordered-list"
language switcher: ".ecl-language-list"
language switcher link: ".ecl-site-header-core__language-selector, .ecl-site-header-standardised__language-selector"
Expand All @@ -33,7 +33,7 @@ default:
logo: "a.ecl-site-header-core__logo-link .ecl-site-header-core__logo-image, a.ecl-site-header-standardised__logo-link .ecl-site-header-standardised__logo-image"
footer logo: "a.ecl-footer-core__logo-link .ecl-footer-core__logo-image-desktop, a.ecl-footer-standardised__logo-link .ecl-footer-standardised__logo-image-desktop"
media container: ".ecl-media-container"
page header: ".ecl-page-header-core"
page header: ".ecl-page-header"
priorities dropdown menu: ".ecl-menu__item:nth-child(3) .ecl-menu__mega"
search form: ".ecl-search-form"
navigation menu: ".ecl-menu"
Expand Down Expand Up @@ -72,17 +72,14 @@ default:
header with menu: ".ecl-site-header-core[data-ecl-has-menu], .ecl-site-header-standardised[data-ecl-has-menu]"
language dialog: ".ecl-dialog"
language switcher: ".ecl-language-list"
language page switcher: ".ecl-page-header-core .ecl-lang-select-page"
navigation: ".ecl-menu"
page: "body"
page header: ".ecl-page-header-core, .ecl-page-header-standardised"
page header: ".ecl-page-header"
page header site identity: "h2.ecl-u-type-heading-2"
page header title: ".ecl-page-header-core .ecl-page-header-core__title"
page header intro: ".ecl-page-header-core .ecl-page-header-core__description"
page header meta: ".ecl-page-header-core .ecl-page-header-core__meta"
page header title: ".ecl-page-header .ecl-page-header__title"
page header intro: ".ecl-page-header .ecl-page-header__description"
page header meta: ".ecl-page-header .ecl-page-header__meta"
priorities dropdown menu: ".ecl-menu__item:nth-child(3) .ecl-menu__mega"
selected language in the language page switcher: ".ecl-page-header-core .ecl-lang-select-page .ecl-lang-select-page__option--is-selected"
unavailable languages in the language page switcher: ".ecl-page-header-core .ecl-lang-select-page .ecl-lang-select-page__unavailable"
Social media links: "#oe-social-media-links-values"
Social media follow: ".ecl-social-media-follow"
event contacts: "#event-contacts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Override behaviour for empty navigation list.
*/
Drupal.eclInPageNavigation.handleEmptyInpageNavigation = function(element) {
document.querySelector('h1.ecl-page-header-core__title').classList.add('empty-inpage-nav-test');
document.querySelector('h1.ecl-page-header__title').classList.add('empty-inpage-nav-test');
element.remove();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ public function testNodeRoutes(): void {
// Verify that the page header block is shown in the node canonical route
// and contains the correct revision text.
$this->drupalGet($node->toUrl());
$this->assertSession()->elementTextContains('css', '.ecl-page-header-core__description', $published_revision_body);
$this->assertSession()->elementTextContains('css', '.ecl-page-header__description', $published_revision_body);

// Verify that the block is also shown in the latest version route with the
// correct draft revision loaded.
$this->drupalGet($node->toUrl('latest-version'));
$this->assertSession()->elementTextContains('css', '.ecl-page-header-core__description', $draft_revision_body);
$this->assertSession()->elementTextContains('css', '.ecl-page-header__description', $draft_revision_body);

// Verify also for the node single revision route.
$this->drupalGet($first_revision_url);
$this->assertSession()->elementTextContains('css', '.ecl-page-header-core__description', $published_revision_body);
$this->assertSession()->elementTextContains('css', '.ecl-page-header__description', $published_revision_body);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ public function testRendering(): void {
$assert_session = $this->assertSession();

// Only one page header should be rendered.
$assert_session->elementsCount('css', '.ecl-page-header-core', 1);
$header = $this->getSession()->getPage()->find('css', '.ecl-page-header-core');
$assert_session->elementsCount('css', '.ecl-page-header.ecl-page-header--negative', 1);
$header = $this->getSession()->getPage()->find('css', '.ecl-page-header.ecl-page-header--negative');
// Test that the page title is rendered in the page header.
$this->assertEquals($entity->label(), trim($header->find('css', '.ecl-page-header-core__title')->getText()));
$this->assertEquals($entity->label(), trim($header->find('css', '.ecl-page-header__title')->getText()));
// Intro and meta items are empty.
$assert_session->elementsCount('css', '.ecl-page-header__intro', 0);
$assert_session->elementsCount('css', '.ecl-meta--header .ecl-meta__item', 0);

// Test another route.
$this->drupalGet('/user/login');
$assert_session->elementsCount('css', '.ecl-page-header-core', 1);
$header = $this->getSession()->getPage()->find('css', '.ecl-page-header-core');
$this->assertEquals('Log in', trim($header->find('css', '.ecl-page-header-core__title')->getText()));
$assert_session->elementsCount('css', '.ecl-page-header-core__description', 0);
$assert_session->elementsCount('css', '.ecl-page-header.ecl-page-header--negative', 1);
$header = $this->getSession()->getPage()->find('css', '.ecl-page-header.ecl-page-header--negative');
$this->assertEquals('Log in', trim($header->find('css', '.ecl-page-header__title')->getText()));
$assert_session->elementsCount('css', '.ecl-page-header__description', 0);
$assert_session->elementsCount('css', '.ecl-page-header__meta-list', 0);

// Enable the test plugin and add some metadata.
Expand All @@ -103,14 +103,14 @@ public function testRendering(): void {
$this->drupalGet('/user/login');
// The test plugin metadata is shown as it has higher priority than the
// default one.
$assert_session->elementsCount('css', '.ecl-page-header-core', 1);
$assert_session->elementsCount('css', '.ecl-page-header-core__description', 1);
$assert_session->elementsCount('css', '.ecl-page-header-core__meta', 1);
$header = $this->getSession()->getPage()->find('css', '.ecl-page-header-core');
$this->assertEquals($test_data['title'], trim($header->find('css', '.ecl-page-header-core__title')->getText()));
$this->assertEquals($test_data['introduction'], trim($header->find('css', '.ecl-page-header-core__description')->getText()));

$actual_metas = $header->findAll('css', '.ecl-page-header-core__meta .ecl-page-header-core__meta-item');
$assert_session->elementsCount('css', '.ecl-page-header.ecl-page-header--negative', 1);
$assert_session->elementsCount('css', '.ecl-page-header__description', 1);
$assert_session->elementsCount('css', '.ecl-page-header__meta', 1);
$header = $this->getSession()->getPage()->find('css', '.ecl-page-header.ecl-page-header--negative');
$this->assertEquals($test_data['title'], trim($header->find('css', '.ecl-page-header__title')->getText()));
$this->assertEquals($test_data['introduction'], trim($header->find('css', '.ecl-page-header__description')->getText()));

$actual_metas = $header->findAll('css', '.ecl-page-header__meta .ecl-page-header__meta-item');
foreach ($test_data['metas'] as $index => $expected_meta) {
$this->assertEquals($expected_meta, $actual_metas[$index]->getText());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function testLibrary(): void {
// Give time for the javascript code to remove the block from the page.
$assert_session->waitForElementRemoved('css', '#block-inpage-navigation');
// Ensure that overridden callback is triggered for empty navigation list.
$assert_session->elementExists('css', 'h1.ecl-page-header-core__title.empty-inpage-nav-test');
$assert_session->elementExists('css', 'h1.ecl-page-header__title.empty-inpage-nav-test');
}

}
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@
"prepare": "patch-package"
},
"dependencies": {
"@ecl/builder": "3.2.4",
"@ecl/preset-ec": "3.2.4",
"@ecl/preset-eu": "3.2.4",
"@ecl/preset-reset": "3.2.4",
"@ecl/builder": "3.3.1",
"@ecl/preset-ec": "3.3.1",
"@ecl/preset-eu": "3.3.1",
"@ecl/preset-reset": "3.3.1",
"@ecl/stylelint-config": "0.2.1",
"@ecl/theme-ec": "3.2.4",
"@ecl/theme-eu": "3.2.4",
"@ecl/twig-component-accordion": "3.2.4",
"@ecl/twig-component-blockquote": "3.2.4",
"@ecl/twig-component-breadcrumb-core": "3.2.4",
"@ecl/twig-component-breadcrumb-standardised": "3.2.4",
"@ecl/twig-component-button": "3.2.4",
"@ecl/twig-component-card": "3.2.4",
"@ecl/twig-component-datepicker": "3.2.4",
"@ecl/twig-component-description-list": "3.2.4",
"@ecl/twig-component-expandable": "3.2.4",
"@ecl/twig-component-fact-figures": "3.2.4",
"@ecl/twig-component-file": "3.2.4",
"@ecl/twig-component-footer-core": "3.2.4",
"@ecl/twig-component-footer-standardised": "3.2.4",
"@ecl/twig-component-gallery": "3.2.4",
"@ecl/twig-component-hero-banner": "3.2.4",
"@ecl/twig-component-icon": "3.2.4",
"@ecl/twig-component-inpage-navigation": "3.2.4",
"@ecl/twig-component-language-list": "3.2.4",
"@ecl/twig-component-link": "3.2.4",
"@ecl/twig-component-list-illustration": "3.2.4",
"@ecl/twig-component-label": "3.2.4",
"@ecl/twig-component-media-container": "3.2.4",
"@ecl/twig-component-menu": "3.2.4",
"@ecl/twig-component-message": "3.2.4",
"@ecl/twig-component-news-ticker": "3.2.4",
"@ecl/twig-component-page-banner": "3.2.4",
"@ecl/twig-component-page-header-core": "3.2.4",
"@ecl/twig-component-page-header-standardised": "3.2.4",
"@ecl/twig-component-pagination": "3.2.4",
"@ecl/twig-component-radio": "3.2.4",
"@ecl/twig-component-search-form": "3.2.4",
"@ecl/twig-component-site-header-core": "3.2.4",
"@ecl/twig-component-site-header-standardised": "3.2.4",
"@ecl/twig-component-skip-link": "3.2.4",
"@ecl/twig-component-social-media-follow": "3.2.4",
"@ecl/twig-component-social-media-share": "3.2.4",
"@ecl/twig-component-table": "3.2.4",
"@ecl/twig-component-tag": "3.2.4",
"@ecl/twig-component-text-input": "3.2.4",
"@ecl/twig-component-timeline": "3.2.4",
"@ecl/vanilla-utility-background": "3.2.4",
"@ecl/vanilla-utility-border": "3.2.4",
"@ecl/theme-ec": "3.3.1",
"@ecl/theme-eu": "3.3.1",
"@ecl/twig-component-accordion": "3.3.1",
"@ecl/twig-component-blockquote": "3.3.1",
"@ecl/twig-component-breadcrumb": "3.3.1",
"@ecl/twig-component-breadcrumb-core": "3.3.1",
"@ecl/twig-component-breadcrumb-standardised": "3.3.1",
"@ecl/twig-component-button": "3.3.1",
"@ecl/twig-component-card": "3.3.1",
"@ecl/twig-component-datepicker": "3.3.1",
"@ecl/twig-component-description-list": "3.3.1",
"@ecl/twig-component-expandable": "3.3.1",
"@ecl/twig-component-fact-figures": "3.3.1",
"@ecl/twig-component-file": "3.3.1",
"@ecl/twig-component-footer-core": "3.3.1",
"@ecl/twig-component-footer-standardised": "3.3.1",
"@ecl/twig-component-gallery": "3.3.1",
"@ecl/twig-component-hero-banner": "3.3.1",
"@ecl/twig-component-icon": "3.3.1",
"@ecl/twig-component-inpage-navigation": "3.3.1",
"@ecl/twig-component-language-list": "3.3.1",
"@ecl/twig-component-link": "3.3.1",
"@ecl/twig-component-list-illustration": "3.3.1",
"@ecl/twig-component-label": "3.3.1",
"@ecl/twig-component-media-container": "3.3.1",
"@ecl/twig-component-menu": "3.3.1",
"@ecl/twig-component-message": "3.3.1",
"@ecl/twig-component-news-ticker": "3.3.1",
"@ecl/twig-component-page-banner": "3.3.1",
"@ecl/twig-component-page-header": "3.3.1",
"@ecl/twig-component-pagination": "3.3.1",
"@ecl/twig-component-radio": "3.3.1",
"@ecl/twig-component-search-form": "3.3.1",
"@ecl/twig-component-site-header-core": "3.3.1",
"@ecl/twig-component-site-header-standardised": "3.3.1",
"@ecl/twig-component-skip-link": "3.3.1",
"@ecl/twig-component-social-media-follow": "3.3.1",
"@ecl/twig-component-social-media-share": "3.3.1",
"@ecl/twig-component-table": "3.3.1",
"@ecl/twig-component-tag": "3.3.1",
"@ecl/twig-component-text-input": "3.3.1",
"@ecl/twig-component-timeline": "3.3.1",
"@ecl/vanilla-utility-background": "3.3.1",
"@ecl/vanilla-utility-border": "3.3.1",
"chokidar-cli": "1.2.0",
"grunt": "^1.4.0",
"grunt-contrib-copy": "^1.0.0",
Expand Down
12 changes: 0 additions & 12 deletions patches/@ecl/twig-component-card+3.2.4.patch

This file was deleted.

10 changes: 0 additions & 10 deletions sass/components/_page_header.scss

This file was deleted.

25 changes: 0 additions & 25 deletions sass/compositions/_content_language_switcher.scss

This file was deleted.

2 changes: 0 additions & 2 deletions sass/style-ec.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
// TODO: The help form component is not available on ECL v3.
//@use '@ecl/ec-component-form-help-block/ec-component-form-help-block';
@use "./compositions/content_item";
@use "./compositions/content_language_switcher";
@use "./components/form";
@use "./components/toolbar";
@use "./components/wysiwyg";
@use "./components/page_header";
@use "./components/global";
@use "./components/description_list";
@use "./components/media_iframe";
Expand Down
4 changes: 0 additions & 4 deletions sass/style-eu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
//@use '@ecl/eu-component-form-help-block/eu-component-form-help-block';
@use '@ecl/theme-dev/maps/color';
@use "./compositions/content_item";
@use "./compositions/content_language_switcher" with (
$_core_color: map.get(theme.$color, 'blue-100'),
);
@use "./components/form";
@use "./components/toolbar";
@use "./components/wysiwyg";
@use "./components/page_header";
@use "./components/global";
@use "./components/description_list";
@use "./components/media_iframe";
Expand Down
68 changes: 34 additions & 34 deletions templates/patterns/featured_item/pattern-featured-item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,36 @@
In order to replicate the extended functionality we add a button
at the end of the description if the variant is set to "extended".
#}
{% if variant == 'extended' %}
{% set _description %}
{% if description %}
<p class="ecl-paragraph">
{{ description|smart_trim(length) }}
</p>
{% endif %}
<a href="{{ link.href }}" class="ecl-button ecl-button--call">
<span class="ecl-button__container">
<span class="ecl-button__label">{{ link.label }}</span>
{% include '@ecl-twig/icon' with {
icon: {
path: ecl_icon_path,
name: "corner-arrow",
size: "xs",
transform: "rotate-90"
},
extra_classes: "ecl-button__icon ecl-button__icon--after"
} only %}
</span>
</a>
{% endset %}
{% if link.href is not empty %}
{% set _title = {
'label': title,
'path': link.href
} %}
{% if variant == 'extended' %}
{% set _description %}
{% if description %}
<p class="ecl-paragraph">
{{ description|smart_trim(length) }}
</p>
{% endif %}
<a href="{{ link.href }}" class="ecl-button ecl-button--call">
<span class="ecl-button__container">
<span class="ecl-button__label">{{ link.label }}</span>
{% include '@ecl-twig/icon' with {
icon: {
path: ecl_icon_path,
name: "corner-arrow",
size: "xs",
transform: "rotate-90"
},
extra_classes: "ecl-button__icon ecl-button__icon--after"
} only %}
</span>
</a>
{% endset %}
{% endif %}
{% else %}
{% set _title = title %}
{% endif %}

{% if ecl_component_library == 'eu' %}
Expand All @@ -46,19 +54,11 @@
}]) %}
{% endfor %}

{% set card = {
{% include '@ecl-twig/card' with {
'description': _description|default(description|smart_trim(length)),
'meta': metas,
'title': {
'label': title,
'path': link.href,
'type': "standalone"
},
'infos': _footer_items,
'primary_meta': metas,
'title': _title,
'secondary_meta': _footer_items,
'image': image,
'labels': badges,
} %}

{% include '@ecl-twig/card' with {
'card': card,
} %}
Loading