Skip to content

Commit

Permalink
Merge pull request #956 from openeuropa/update-EPIC-News
Browse files Browse the repository at this point in the history
Update epic news
  • Loading branch information
upchuk authored Sep 24, 2021
2 parents 18d7637 + ec7c416 commit f178eda
Show file tree
Hide file tree
Showing 76 changed files with 1,233 additions and 151 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Change Log

## [3.0.0-beta3](https://github.com/openeuropa/oe_theme/tree/3.0.0-beta3) (2021-09-23)
[Full Changelog](https://github.com/openeuropa/oe_theme/compare/3.0.0-beta2...3.0.0-beta3)

**Merged pull requests:**

- EWPP-1495: Make sure that event registration button is displayed as an inline block. [\#950](https://github.com/openeuropa/oe_theme/pull/950) ([ademarco](https://github.com/ademarco))
- EWPP-1514: Wrong Irish translation in language switcher. [\#947](https://github.com/openeuropa/oe_theme/pull/947) ([yenyasinn](https://github.com/yenyasinn))
- EWPP-1467: Fix font name issue. [\#946](https://github.com/openeuropa/oe_theme/pull/946) ([sergepavle](https://github.com/sergepavle))
- EWPP-1458: Events render correctly when a non-existing event type is specified. [\#943](https://github.com/openeuropa/oe_theme/pull/943) ([brummbar](https://github.com/brummbar))
- EWPP-1472: Fix output of image \(avportal\) inside news content type. [\#942](https://github.com/openeuropa/oe_theme/pull/942) ([yenyasinn](https://github.com/yenyasinn))
- EWPP-0000: Version 2.0 of typed\_link is required by oe\_paragraphs. [\#941](https://github.com/openeuropa/oe_theme/pull/941) ([brummbar](https://github.com/brummbar))
- EWPP-873: Text with featured media paragraph type V2 [\#939](https://github.com/openeuropa/oe_theme/pull/939) ([yenyasinn](https://github.com/yenyasinn))
- EWPP-1470: Content item title styling is not consistent. [\#934](https://github.com/openeuropa/oe_theme/pull/934) ([yenyasinn](https://github.com/yenyasinn))
- EWPP-1312: Translate "I have read and agree with the data protection terms" string [\#932](https://github.com/openeuropa/oe_theme/pull/932) ([yenyasinn](https://github.com/yenyasinn))
- EWPP-847: Add optional oe\_theme\_main\_content view display for JS asset media [\#896](https://github.com/openeuropa/oe_theme/pull/896) ([brummbar](https://github.com/brummbar))
- EWPP-1206: Update grid classes for list item block pattern. [\#882](https://github.com/openeuropa/oe_theme/pull/882) ([sergepavle](https://github.com/sergepavle))
- EWPP-1046: Change label from "Open gallery" to "See all" in the gallery [\#881](https://github.com/openeuropa/oe_theme/pull/881) ([yenyasinn](https://github.com/yenyasinn))
- EWPP-1162: Update event rendering test. [\#866](https://github.com/openeuropa/oe_theme/pull/866) ([22Alexandra](https://github.com/22Alexandra))
- EWPP-866: Use extend in list-item templates. [\#817](https://github.com/openeuropa/oe_theme/pull/817) ([nagyad](https://github.com/nagyad))

## [3.0.0-beta2](https://github.com/openeuropa/oe_theme/tree/3.0.0-beta2) (2021-08-25)
[Full Changelog](https://github.com/openeuropa/oe_theme/compare/3.0.0-beta1...3.0.0-beta2)

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ templates/compositions/ec-component-content-item/content-item.html.twig

Consider using the [List item](/templates/patterns/list_item/list_item.ui_patterns.yml) pattern and its variants instead.

#### Text with Featured media pattern

The pattern [Text with Featured media](/templates/patterns/text_featured_media/text_featured_media.ui_patterns.yml) now
supports the following 4 variants:

- Left simple / `left_simple`: text on the left, simple call to action. This is the default behaviour.
- Right simple / `right_simple`: text on the right, simple call to action.
- Left featured / `left_featured`: text on the left, featured call to action.
- Right featured / `right_featured`: text on the right, featured call to action.

If no variant is set, then the pattern will be visualized using the default one. This guarantees backward compatibility.

#### Site header

ECL v3 supports the horizontal menu in both Core and Standardised branding. In order to accommodate this, we removed the
Expand Down
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ default:
project funding header: "#project-funding .ecl-u-type-heading-2"
FriendsOfBehat\ServiceContainerExtension:
imports:
- 'build/modules/contrib/oe_content/tests/Behat/config/services.yml'
- 'build/modules/contrib/oe_content/tests/src/Behat/config/services.yml'
formatters:
progress: ~
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"drupal/json_field": "^1.0.0-rc2",
"drupal/renderviz": "^1.0@alpha",
"drupal/styleguide": "~1.0-alpha3",
"drupal/typed_link": "~1.1",
"drupal/typed_link": "^2.0",
"drush/drush": "~9.0",
"easyrdf/easyrdf": "1.0.0 as 0.9.1",
"friends-of-behat/service-container-extension": "^1.0",
Expand All @@ -47,15 +47,15 @@
"openeuropa/behat-transformation-context": "~0.1",
"openeuropa/code-review": "~1.5",
"openeuropa/drupal-core-require-dev": "^8.9.14",
"openeuropa/oe_content": "dev-EPIC-EWPP-1360-News-v3",
"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": "dev-master",
"openeuropa/oe_search": "~1.0",
"openeuropa/oe_webtools": "~1.10",
"openeuropa/oe_contact_forms": "~1.0",
"openeuropa/oe_contact_forms": "dev-master",
"openeuropa/rdf_skos": "~1.0",
"openeuropa/task-runner-drupal-project-symlink": "^1.0",
"phpunit/phpunit": "~6.0",
Expand All @@ -81,7 +81,7 @@
"autoload-dev": {
"psr-4": {
"Drupal\\Tests\\oe_theme\\": "./tests/",
"Drupal\\Tests\\oe_content\\": "./build/modules/contrib/oe_content/tests/",
"Drupal\\Tests\\oe_content\\": "./build/modules/contrib/oe_content/tests/src/",
"Drupal\\Tests\\oe_media\\": "./build/modules/contrib/oe_media/tests/src/"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- media.type.av_portal_photo
- responsive_image.styles.oe_theme_main_content
module:
- media_avportal
- oe_media_avportal
id: media.av_portal_photo.oe_theme_main_content
targetEntityType: media
bundle: av_portal_photo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- field.field.media.av_portal_video.oe_media_avportal_video
- media.type.av_portal_video
module:
- media_avportal
- oe_media_avportal
id: media.av_portal_video.oe_theme_main_content
targetEntityType: media
bundle: av_portal_video
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- field.field.media.document.oe_media_file
- media.type.document
module:
- file
- oe_media
id: media.document.oe_theme_main_content
targetEntityType: media
bundle: document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- media.type.image
- responsive_image.styles.oe_theme_main_content
module:
- oe_media
- responsive_image
id: media.image.oe_theme_main_content
targetEntityType: media
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.media.oe_theme_main_content
- field.field.media.javascript_asset.oe_media_js_asset_url
- media.type.javascript_asset
module:
- oe_media_embed
- oe_media_js_asset
third_party_settings:
oe_media_embed:
embeddable: true
id: media.javascript_asset.oe_theme_main_content
targetEntityType: media
bundle: javascript_asset
mode: oe_theme_main_content
content:
oe_media_js_asset_url:
type: oe_media_js_asset_url
weight: 0
region: content
label: hidden
settings: { }
third_party_settings: { }
hidden:
created: true
ewcms_available_translations: true
langcode: true
name: true
search_api_excerpt: true
thumbnail: true
uid: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- field.field.media.remote_video.oe_media_oembed_video
- media.type.remote_video
module:
- media
- oe_media
id: media.remote_video.oe_theme_main_content
targetEntityType: media
bundle: remote_video
Expand Down
9 changes: 7 additions & 2 deletions modules/oe_theme_contact_forms/oe_theme_contact_forms.module
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ function oe_theme_contact_forms_form_contact_message_form_alter(&$form, FormStat

// Add ecl link classes to the privacy link.
$privacy_policy = $contact_form->getThirdPartySetting('oe_contact_forms', 'privacy_policy');
$privacy_link = Link::fromTextAndUrl('data protection terms', Url::fromUri($privacy_policy, [
$privacy_link = Link::fromTextAndUrl(t('data protection terms'), Url::fromUri($privacy_policy, [
'absolute' => TRUE,
'attributes' => [
'target' => '_blank',
'class' => ['ecl-u-ml-2xs', 'ecl-link', 'ecl-link--default'],
'class' => [
'ecl-u-ml-2xs',
'ecl-u-mr-2xs',
'ecl-link',
'ecl-link--default',
],
],
]));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Drupal\oe_theme_content_event\Plugin\ExtraField\Display;

use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
Expand Down Expand Up @@ -79,8 +80,12 @@ public function viewElements(ContentEntityInterface $entity) {
// Add the event type.
/** @var \Drupal\rdf_skos\Entity\ConceptInterface $type */
$type = $entity->get('oe_event_type')->entity;
$type = $this->entityRepository->getTranslationFromContext($type);
$elements[] = ['#markup' => $type->label()];
if ($type) {
$type = $this->entityRepository->getTranslationFromContext($type);
$elements[] = ['#markup' => $type->label()];
CacheableMetadata::createFromObject($type)
->applyTo($elements);
}

// Add the event status, only if it doesn't go as planned.
$status = $entity->get('oe_event_status')->value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Drupal\oe_theme_content_event\Plugin\PageHeaderMetadata;

use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Entity\EntityRepositoryInterface;
use Drupal\oe_theme_helper\Plugin\PageHeaderMetadata\NodeViewRoutesBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down Expand Up @@ -76,10 +77,18 @@ public function getMetadata(): array {
$metadata = parent::getMetadata();

$node = $this->getNode();
$translated_value = $this->entityRepository->getTranslationFromContext($node->get('oe_event_type')->entity);
$type = $node->get('oe_event_type')->entity;
if (!$type) {
return $metadata;
}

$translated_value = $this->entityRepository->getTranslationFromContext($type);
$metadata['metas'] = [
$translated_value->label(),
];
CacheableMetadata::createFromRenderArray($metadata)
->addCacheableDependency($translated_value)
->applyTo($metadata);

return $metadata;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div id="event-registration-block">
{% if show_button %}
{% if enabled %}
<a href="{{ url }}" class="ecl-u-mt-2xl ecl-link ecl-link--cta">{{ label }}</a>
<a href="{{ url }}" class="ecl-u-mt-2xl ecl-link ecl-link--cta ecl-u-d-inline-block">{{ label }}</a>
{% else %}
<button type="submit" class="ecl-button ecl-button--call ecl-u-mt-2xl ecl-link ecl-link--cta" disabled="">{{ label }}</button>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ dependencies:
- field.field.node.oe_publication.oe_author
- field.field.node.oe_publication.oe_departments
- field.field.node.oe_publication.oe_documents
- field.field.node.oe_publication.oe_publication_collection
- field.field.node.oe_publication.oe_publication_contacts
- field.field.node.oe_publication.oe_publication_countries
- field.field.node.oe_publication.oe_publication_date
- field.field.node.oe_publication.oe_publication_last_updated
- field.field.node.oe_publication.oe_publication_publications
- field.field.node.oe_publication.oe_publication_thumbnail
- field.field.node.oe_publication.oe_publication_type
- field.field.node.oe_publication.oe_reference_codes
Expand All @@ -32,7 +34,7 @@ third_party_settings:
- group_item_files
- group_item_contacts
parent_name: ''
weight: 0
weight: 1
format_type: oe_theme_helper_in_page_navigation
region: content
format_settings:
Expand Down Expand Up @@ -64,6 +66,7 @@ third_party_settings:
group_item_files:
children:
- oe_documents
- oe_publication_publications
parent_name: group_in_page_navigation
weight: 24
format_type: oe_theme_helper_in_page_navigation_item
Expand All @@ -86,6 +89,7 @@ third_party_settings:
group_details:
children:
- oe_reference_codes
- extra_field_oe_theme_content_publication_collection
- extra_field_oe_theme_content_publication_date
- oe_departments
- oe_publication_countries
Expand All @@ -103,19 +107,24 @@ targetEntityType: node
bundle: oe_publication
mode: full
content:
extra_field_oe_theme_content_publication_date:
extra_field_oe_theme_content_publication_collection:
weight: 1
region: content
settings: { }
third_party_settings: { }
extra_field_oe_theme_content_publication_date:
weight: 2
region: content
settings: { }
third_party_settings: { }
extra_field_oe_theme_content_publication_description:
weight: 0
region: content
settings: { }
third_party_settings: { }
oe_departments:
type: skos_concept_entity_reference_label
weight: 2
weight: 3
region: content
label: above
settings:
Expand All @@ -141,12 +150,21 @@ content:
third_party_settings: { }
oe_publication_countries:
type: skos_concept_entity_reference_label
weight: 3
weight: 4
region: content
label: above
settings:
link: false
third_party_settings: { }
oe_publication_publications:
type: entity_reference_entity_view
weight: 2
region: content
label: hidden
settings:
view_mode: teaser
link: false
third_party_settings: { }
oe_reference_codes:
type: string
weight: 0
Expand All @@ -165,6 +183,7 @@ hidden:
oe_content_legacy_link: true
oe_content_navigation_title: true
oe_content_short_title: true
oe_publication_collection: true
oe_publication_date: true
oe_publication_last_updated: true
oe_publication_thumbnail: true
Expand Down
Loading

0 comments on commit f178eda

Please sign in to comment.