Skip to content

Commit

Permalink
Merge pull request #46 from openeuropa/OEL-750-all
Browse files Browse the repository at this point in the history
OEL-750: BCL Upgrade to 0.14.0
  • Loading branch information
drishu authored Nov 29, 2021
2 parents 4b76f6b + feb887f commit 87d570f
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 45 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"drupal/core": "^8.9 || ^9.1",
"drupal/ui_patterns": "^1.0",
"drupal/ui_patterns_settings": "^1.0",
"openeuropa/oe_bootstrap_theme": "1.0.0-alpha3"
"openeuropa/oe_bootstrap_theme": "0.750.202111261805"
},
"require-dev": {
"composer/installers": "^1.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public function bclFooterLinks(array $context, array $links): array {
'label' => $link['label'],
'path' => $link['href'],
'icon_position' => 'after',
'standalone' => TRUE,
'attributes' => [
'class' => [
'text-decoration-none',
'd-block',
'mb-1',
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"production": "npm-run-all build:*"
},
"devDependencies": {
"@openeuropa/bcl-builder": "0.9.0",
"@openeuropa/bcl-builder": "0.14.0",
"chokidar-cli": "^3.0.0",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
Expand Down
15 changes: 4 additions & 11 deletions templates/patterns/header/pattern-header--variant-ec.html.twig
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{% extends "pattern-header.html.twig" %}
{#
/**
* @file
* Template override for pattern header variant EC.
*/
#}
{% set _header_classes = attributes.addClass('ec__header') %}

{% block content %}
{{ pattern('navbar', {
navbar_left: header_left,
navbar_right: header_right,
color_set: 'light',
collapse_id: 'navbarNavDropdown',
attributes: attributes
}) }}
{% extends "pattern-header.html.twig" %}
{% block header %}
{% set _header_attributes = create_attribute().addClass(['ec__header', 'bcl-header']) %}
{{ parent() }}
{% endblock %}
13 changes: 4 additions & 9 deletions templates/patterns/header/pattern-header--variant-eu.html.twig
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{% extends "pattern-header.html.twig" %}
{#
/**
* @file
* Template override for pattern header variant EU.
*/
#}
{% block content %}
{{ pattern('navbar', {
navbar_left: header_left,
navbar_right: header_right,
color_set: 'dark',
collapse_id: 'navbarNavDropdown',
attributes: attributes
}) }}
{% extends "pattern-header.html.twig" %}
{% block header %}
{% set _header_attributes = create_attribute().addClass(['bcl-header']) %}
{{ parent() }}
{% endblock %}
44 changes: 24 additions & 20 deletions templates/patterns/header/pattern-header.html.twig
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
{#
/**
* @file
* Template for header pattern.
*/
#}
{%
set _header_classes = [
'bcl-header',
]
%}
{%
set _nav_classes = [
set _nav_attributes = create_attribute().addClass([
'w-100',
'shadow-sm',
'navbar',
'navbar-expand-lg',
'navbar-light',
]
])
%}
<header {{ attributes.addClass(_header_classes) }}>
<nav {{ attributes.addClass(_nav_classes) }}>
{% set navbar_attributes = create_attribute().addClass(['bcl-header__navbar']) %}
{% set _header_attributes = create_attribute() %}
{% block header %}
<header {{ _header_attributes }}>
{% endblock %}
<nav {{ _nav_attributes }}>
<div class="container">
{{ navbar_branding }}
<ul class="nav">
Expand All @@ -22,24 +27,23 @@
</div>
</nav>
{%
set _project_classes = [
set _project_attributes = create_attribute().addClass([
'bcl-header__project',
bcl_header_style == 'light' ? bcl_header_style,
]
])
%}
<div {{attributes.addClass(_project_classes)}}>
<div {{ _project_attributes }}>
<div class="container">
{{ header_top }}
</div>
</div>
{% set attributes = {
'class': [
'bcl-header__navbar',
]
} %}
{% block content %}
{{ content}}
{% endblock %}
{{ pattern('navbar', {
navbar_left: header_left,
navbar_right: header_right,
color_set: 'dark',
collapse_id: 'navbarNavDropdown',
attributes: navbar_attributes,
}) }}
<div class="container">
{{ breadcrumbs }}
</div>
Expand Down
5 changes: 3 additions & 2 deletions tests/src/Kernel/FooterBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FooterBlockTest extends SparqlKernelTestBase {
'components',
'ui_patterns',
'ui_patterns_library',
'ui_patterns_settings',
'user',
'system',
'oe_whitelabel_helper',
Expand Down Expand Up @@ -84,7 +85,7 @@ public function testEcFooterBlockRendering(): void {
$this->assertCount(2, $borderedSections);
$sectionTitles = $crawler->filter('p.fw-bold.mb-2');
$this->assertCount(3, $sectionTitles);
$sectionLinks = $crawler->filter('div.col-12.col-lg-4:nth-child(2) a.text-decoration-none.d-block.mb-1');
$sectionLinks = $crawler->filter('div.col-12.col-lg-4:nth-child(2) a.text-underline-hover.d-block.mb-1');
$this->assertCount(3, $sectionLinks);
}

Expand Down Expand Up @@ -119,7 +120,7 @@ public function testEuFooterBlockRendering(): void {
$this->assertCount(1, $borderedSections);
$sectionTitles = $crawler->filter('p.fw-bold.mb-2');
$this->assertCount(5, $sectionTitles);
$sectionLinks = $crawler->filter('div.col-12.col-lg-4:nth-child(2) a.text-decoration-none.d-block.mb-1');
$sectionLinks = $crawler->filter('div.col-12.col-lg-4:nth-child(2) a.text-underline-hover.d-block.mb-1');
$this->assertCount(10, $sectionLinks);
}

Expand Down

0 comments on commit 87d570f

Please sign in to comment.