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

OPENEUROPA-1744: Implement site switcher in oe_theme. #190

Merged
merged 7 commits into from Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion behat.yml.dist
Expand Up @@ -21,7 +21,7 @@ default:
page header: ".ecl-page-header__body"
priorities dropdown menu: "#nav-menu-expandable-group-3 .ecl-navigation-menu__links"
search form: ".ecl-search-form"
sites switcher: ".demo-block-site-switcher"
sites switcher: ".ecl-site-switcher--header"
dropdown content: ".ecl-link-block__list"
pages:
user registration: "/user/register"
Expand Down
19 changes: 19 additions & 0 deletions config/optional/block.block.oe_theme_site_switcher.yml
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- oe_corporate_blocks
theme:
- oe_theme
id: oe_theme_site_switcher
theme: oe_theme
region: site_top_bar
weight: 0
provider: null
plugin: oe_site_switcher
settings:
id: oe_site_switcher
label: 'Site switcher block'
provider: oe_corporate_blocks
label_display: '0'
visibility: { }
3 changes: 0 additions & 3 deletions modules/oe_theme_demo/README.md
Expand Up @@ -7,9 +7,6 @@ The demo module includes:

- A custom main menu with sub-menu items
- An overview page for all Drupal-related components called "Style guide"
- Placeholder blocks like:
- Language switcher
- Site switcher

### Requirements

Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions modules/oe_theme_demo/oe_theme_demo.demo_blocks.yml

This file was deleted.

5 changes: 0 additions & 5 deletions modules/oe_theme_demo/oe_theme_demo.info.yml
Expand Up @@ -6,8 +6,3 @@ package: OpenEuropa
dependencies:
- drupal:block
- styleguide:styleguide

config_devel:
optional:
- block.block.oe_theme_demo_header_site_switcher
- block.block.oe_theme_demo_main_navigation
24 changes: 0 additions & 24 deletions modules/oe_theme_demo/oe_theme_demo.module

This file was deleted.

4 changes: 0 additions & 4 deletions modules/oe_theme_demo/oe_theme_demo.services.yml

This file was deleted.

79 changes: 0 additions & 79 deletions modules/oe_theme_demo/src/DemoBlockPluginManager.php

This file was deleted.

41 changes: 0 additions & 41 deletions modules/oe_theme_demo/src/Plugin/Block/DemoBlock.php

This file was deleted.

61 changes: 0 additions & 61 deletions modules/oe_theme_demo/src/Plugin/Derivative/DemoBlock.php

This file was deleted.

This file was deleted.

25 changes: 25 additions & 0 deletions templates/navigation/oe-corporate-blocks-site-switcher.html.twig
@@ -0,0 +1,25 @@
{#
/**
* @file
* Theme override for rendering corporate site switcher block.
*
* Available variables:
* - links: list of site switcher links.
*
* @ingroup themeable
*/
#}

{% include '@ecl/ec-component-site-switcher' with {
'variant': 'header',
'political': {
'href': links.political.href,
'label': links.political.label,
'is_active': links.political.active
},
'info': {
'href': links.info.href,
'label': links.info.label,
'is_active': links.info.active
},
} only %}
Expand Up @@ -2,31 +2,14 @@

declare(strict_types = 1);

namespace Drupal\Tests\oe_theme\Kernel;
namespace Drupal\Tests\oe_theme\Kernel\CorporateBlocks;

use Symfony\Component\DomCrawler\Crawler;

/**
* Test footer block rendering.
*/
class CorporateBlocksFooterTest extends AbstractKernelTestBase {

/**
* Modules to enable.
*
* @var array
*/
public static $modules = [
'oe_corporate_blocks',
];

/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(['oe_corporate_blocks']);
}
class CorporateBlocksFooterTest extends CorporateBlocksTestBase {

/**
* Array containing data to merge with config object.
Expand Down