From 501c184ec0e5dc2e04a020eda2ffd05be0cc7378 Mon Sep 17 00:00:00 2001 From: Francesco Sardara <francesco.sardara@ausy.be> Date: Tue, 1 Feb 2022 18:38:06 +0100 Subject: [PATCH 01/22] OEL-779: Switch to epic branch. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 016460e1..e4833fd6 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=7.3", "cweagans/composer-patches": "^1.7", "drupal/core": "^8.9 || ^9.1", - "openeuropa/oe_bootstrap_theme": "^1.0.0-alpha6" + "openeuropa/oe_bootstrap_theme": "dev-OEL-779-part-featured-media" }, "require-dev": { "composer/installers": "^1.11", -- GitLab From 2303de2be51434ead7b1fd09d8dc4da32cb3dccf Mon Sep 17 00:00:00 2001 From: Abel Santos <abel.santos.corral@gmail.com> Date: Wed, 2 Feb 2022 10:57:37 +0100 Subject: [PATCH 02/22] OEL-779: Set release of bootstrap theme of EPIC patterns. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e4833fd6..580f1d93 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=7.3", "cweagans/composer-patches": "^1.7", "drupal/core": "^8.9 || ^9.1", - "openeuropa/oe_bootstrap_theme": "dev-OEL-779-part-featured-media" + "openeuropa/oe_bootstrap_theme": "0.779.202202020929" }, "require-dev": { "composer/installers": "^1.11", -- GitLab From 997069ee005716f045609bcfc749c1c21a09318a Mon Sep 17 00:00:00 2001 From: Abel Santos <abel.santos.corral@gmail.com> Date: Wed, 2 Feb 2022 12:20:49 +0100 Subject: [PATCH 03/22] OEL-779: Fix icon at links for authentication and language blocks. --- .../block--oe-authentication-login_block.html.twig | 6 ++---- .../overrides/navigation/links--language-block.html.twig | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/templates/overrides/navigation/block--oe-authentication-login_block.html.twig b/templates/overrides/navigation/block--oe-authentication-login_block.html.twig index 6abbfa74..ac05d0be 100644 --- a/templates/overrides/navigation/block--oe-authentication-login_block.html.twig +++ b/templates/overrides/navigation/block--oe-authentication-login_block.html.twig @@ -19,11 +19,9 @@ {{ pattern('link', { label: link_title, path: content['#url']|render, - icon: { - name: 'person-fill', - size: 'xs' - }, + icon: 'person-fill', icon_position: 'before', + standalone: true, attributes: extra_attributes }) }} </li> diff --git a/templates/overrides/navigation/links--language-block.html.twig b/templates/overrides/navigation/links--language-block.html.twig index 9cf491ea..9b92b835 100644 --- a/templates/overrides/navigation/links--language-block.html.twig +++ b/templates/overrides/navigation/links--language-block.html.twig @@ -35,11 +35,9 @@ {{ pattern('link', { label: link_title, path: _language.link.href, - icon: { - name: 'chat-left-dots-fill', - size: 'xs' - }, + icon: 'chat-left-dots-fill', icon_position: 'before', + standalone: true, attributes: extra_attributes }) }} </li> -- GitLab From de78bf8d87d8d8a9482bbeaebf020336ddd0f90b Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Wed, 2 Feb 2022 14:07:15 +0100 Subject: [PATCH 04/22] OEL-779: Adapt to offcanvas changes. --- .../search/block--facets-form.html.twig | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/templates/overrides/search/block--facets-form.html.twig b/templates/overrides/search/block--facets-form.html.twig index 749b340a..37509e14 100644 --- a/templates/overrides/search/block--facets-form.html.twig +++ b/templates/overrides/search/block--facets-form.html.twig @@ -32,38 +32,32 @@ {% if content.actions.reset['#type'] == 'link' %} {% set extra_attributes = create_attribute() %} - {% set reset = pattern('button', { + {% set reset = pattern('link', { 'label': content.actions['reset']['#title'], - 'url': content.actions['reset']['#url'].toString(), - 'style': 'secondary', - 'attributes': extra_attributes.addClass('ms-2') + 'path': content.actions['reset']['#url'].toString(), + 'variant': 'secondary', + 'attributes': extra_attributes.addClass(['ms-2', 'btn', 'btn-secondary']) }) %} {% set actions = content.actions %} {% set actions = actions|merge({('reset'): reset}) %} {% set content = content|merge({('actions'): actions}) %} {% endif %} + {% set button_attributes = create_attribute().addClass(['d-lg-none', 'mb-4']) %} +{% set toogle_button = { + 'label': label, + 'icon': 'filter', + 'icon_position': 'before', + 'attributes': button_attributes +} %} {% block content %} {{ pattern('offcanvas', { - 'title': { - 'label': label, - 'heading': 4, - 'extra_classes': "mb-lg-4", - }, - 'attributes': attributes.addClass('bcl-offcanvas'), - 'offcanvas_id': 'bcl-offcanvas', + 'variant': 'search', + 'title': label, 'body': content, 'placement': 'start', - 'with_body_scroll': false, - 'with_backdrop': true, - 'extra_classes_body': 'bcl-offcanvas p-lg-0', - 'extra_classes_close': "d-lg-none", - 'extra_classes_header': "p-lg-0", - 'with_trigger': true, - 'toggle_button_label': label, - 'icon_position': 'before', - 'icon': { - 'name': 'filter', - }, + 'body_scroll': false, + 'backdrop': true, + 'toggle': toogle_button, }) }} {% endblock %} -- GitLab From 821ffb0a93bf7ded56497e18ff8157ea3aa7ed2b Mon Sep 17 00:00:00 2001 From: Abel Santos <abel.santos.corral@gmail.com> Date: Wed, 2 Feb 2022 14:38:03 +0100 Subject: [PATCH 05/22] OEL-779: Fix badge pattern at facets-result-item.html.twig. --- templates/overrides/search/facets-result-item.html.twig | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/overrides/search/facets-result-item.html.twig b/templates/overrides/search/facets-result-item.html.twig index 1ee3de65..06be11a4 100644 --- a/templates/overrides/search/facets-result-item.html.twig +++ b/templates/overrides/search/facets-result-item.html.twig @@ -20,8 +20,6 @@ {{ pattern('badge', { 'background': 'light', 'label': value, - 'assistive_text': assistive_text, 'dismissible': true, - 'icons_path': bcl_icon_path, 'attributes': attributes }) }} -- GitLab From 21105f79935e7c0728bb4604eaf8aed5ff0790aa Mon Sep 17 00:00:00 2001 From: Abel Santos <abel.santos.corral@gmail.com> Date: Wed, 2 Feb 2022 16:35:17 +0100 Subject: [PATCH 06/22] OEL-779: Bring new release of bootstrap theme with offcanvas fixes. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 580f1d93..04252fb1 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=7.3", "cweagans/composer-patches": "^1.7", "drupal/core": "^8.9 || ^9.1", - "openeuropa/oe_bootstrap_theme": "0.779.202202020929" + "openeuropa/oe_bootstrap_theme": "0.779.202202021630" }, "require-dev": { "composer/installers": "^1.11", -- GitLab From 4055d469d679b5652daaf5f01226291dfa17c75f Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Wed, 2 Feb 2022 17:12:40 +0100 Subject: [PATCH 07/22] OEL-779: Navigation fixes. --- .../oe_whitelabel_search/src/Form/SearchForm.php | 5 +---- .../patterns/header/pattern-header.html.twig | 15 +++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/oe_whitelabel_search/src/Form/SearchForm.php b/modules/oe_whitelabel_search/src/Form/SearchForm.php index 34a59a04..ed7aca9b 100644 --- a/modules/oe_whitelabel_search/src/Form/SearchForm.php +++ b/modules/oe_whitelabel_search/src/Form/SearchForm.php @@ -81,10 +81,7 @@ class SearchForm extends FormBase { '#id' => 'button', '#variant' => 'light', '#fields' => [ - 'icon' => [ - 'name' => 'search', - 'size' => 'xs', - ], + 'icon' => 'search', 'settings' => [ 'type' => 'submit', ], diff --git a/templates/patterns/header/pattern-header.html.twig b/templates/patterns/header/pattern-header.html.twig index d30ade52..5e894ea9 100644 --- a/templates/patterns/header/pattern-header.html.twig +++ b/templates/patterns/header/pattern-header.html.twig @@ -17,7 +17,7 @@ {% set _header_attributes = create_attribute() %} {% block header %} <header {{ _header_attributes }}> -{% endblock %} + {% endblock %} <nav {{ _nav_attributes }}> <div class="container"> {{ navbar_branding }} @@ -28,9 +28,9 @@ </nav> {% set _project_attributes = create_attribute().addClass([ - 'bcl-header__project', - bcl_header_style == 'light' ? bcl_header_style, - ]) + 'bcl-header__project', + bcl_header_style == 'light' ? bcl_header_style, + ]) %} <div {{ _project_attributes }}> <div class="container"> @@ -38,10 +38,9 @@ </div> </div> {{ pattern('navbar', { - navbar_left: header_left, - navbar_right: header_right, - color_set: 'dark', - collapse_id: 'navbarNavDropdown', + navigation: header_left, + right: header_right, + color_scheme: 'dark', attributes: navbar_attributes, }) }} <div class="container"> -- GitLab From f500528da4f4b1e0627daaae9482cf0f352e9cf7 Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Wed, 2 Feb 2022 17:19:17 +0100 Subject: [PATCH 08/22] OEL-779: Recover icon size. --- .../block--oe-authentication-login_block.html.twig | 5 ++++- .../overrides/navigation/links--language-block.html.twig | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/overrides/navigation/block--oe-authentication-login_block.html.twig b/templates/overrides/navigation/block--oe-authentication-login_block.html.twig index ac05d0be..f32cf983 100644 --- a/templates/overrides/navigation/block--oe-authentication-login_block.html.twig +++ b/templates/overrides/navigation/block--oe-authentication-login_block.html.twig @@ -19,7 +19,10 @@ {{ pattern('link', { label: link_title, path: content['#url']|render, - icon: 'person-fill', + icon: { + name: 'person-fill', + size: 'xs', + }, icon_position: 'before', standalone: true, attributes: extra_attributes diff --git a/templates/overrides/navigation/links--language-block.html.twig b/templates/overrides/navigation/links--language-block.html.twig index 9b92b835..c236d89e 100644 --- a/templates/overrides/navigation/links--language-block.html.twig +++ b/templates/overrides/navigation/links--language-block.html.twig @@ -35,7 +35,10 @@ {{ pattern('link', { label: link_title, path: _language.link.href, - icon: 'chat-left-dots-fill', + icon: { + name: 'chat-left-dots-fill', + size: 'xs', + }, icon_position: 'before', standalone: true, attributes: extra_attributes -- GitLab From 26c85b406ab0aa612e104bd95c659e20309fe6ea Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Wed, 2 Feb 2022 17:19:49 +0100 Subject: [PATCH 09/22] OEL-779: Fix header navbar. --- templates/patterns/header/pattern-header.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/patterns/header/pattern-header.html.twig b/templates/patterns/header/pattern-header.html.twig index 5e894ea9..eea2c4cf 100644 --- a/templates/patterns/header/pattern-header.html.twig +++ b/templates/patterns/header/pattern-header.html.twig @@ -23,7 +23,8 @@ {{ navbar_branding }} <ul class="nav"> {{ navbar_right }} - </ul> + </ul>testBlockRendering + </div> </nav> {% -- GitLab From cc55b9491a9b26eeb097f85041dce70f5f12671b Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Wed, 2 Feb 2022 17:20:06 +0100 Subject: [PATCH 10/22] OEL-779: Update to last pattern release. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 04252fb1..34ed37ad 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=7.3", "cweagans/composer-patches": "^1.7", "drupal/core": "^8.9 || ^9.1", - "openeuropa/oe_bootstrap_theme": "0.779.202202021630" + "openeuropa/oe_bootstrap_theme": "0.779.202202021710" }, "require-dev": { "composer/installers": "^1.11", -- GitLab From 532286674f7a621e8d44ed4af413e45d1b431942 Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Wed, 2 Feb 2022 17:58:18 +0100 Subject: [PATCH 11/22] OEL-779: Fix typo. --- templates/patterns/header/pattern-header.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/patterns/header/pattern-header.html.twig b/templates/patterns/header/pattern-header.html.twig index eea2c4cf..5a516861 100644 --- a/templates/patterns/header/pattern-header.html.twig +++ b/templates/patterns/header/pattern-header.html.twig @@ -23,7 +23,7 @@ {{ navbar_branding }} <ul class="nav"> {{ navbar_right }} - </ul>testBlockRendering + </ul> </div> </nav> -- GitLab From bb7601eb61ec76c18cc9b8e1d22da970105e5975 Mon Sep 17 00:00:00 2001 From: drishu <aszilagyi@live.com> Date: Thu, 3 Feb 2022 10:47:10 +0200 Subject: [PATCH 12/22] OEL-779: Disable navbar background in header. --- templates/patterns/header/pattern-header.html.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/patterns/header/pattern-header.html.twig b/templates/patterns/header/pattern-header.html.twig index 5a516861..681683d4 100644 --- a/templates/patterns/header/pattern-header.html.twig +++ b/templates/patterns/header/pattern-header.html.twig @@ -42,6 +42,7 @@ navigation: header_left, right: header_right, color_scheme: 'dark', + background: false, attributes: navbar_attributes, }) }} <div class="container"> -- GitLab From 052f159f8f0504e2ab9ecb47c088a704ca688b60 Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Thu, 3 Feb 2022 09:49:20 +0100 Subject: [PATCH 13/22] OEL-779: Add class and variant to button. --- templates/overrides/search/block--facets-form.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/overrides/search/block--facets-form.html.twig b/templates/overrides/search/block--facets-form.html.twig index 37509e14..d5687894 100644 --- a/templates/overrides/search/block--facets-form.html.twig +++ b/templates/overrides/search/block--facets-form.html.twig @@ -43,9 +43,11 @@ {% set actions = actions|merge({('reset'): reset}) %} {% set content = content|merge({('actions'): actions}) %} {% endif %} - {% set button_attributes = create_attribute().addClass(['d-lg-none', 'mb-4']) %} + {% set button_attributes = create_attribute().addClass(['d-lg-none', 'w-100', 'mb-4']) %} {% set toogle_button = { 'label': label, + 'variant': 'light', + 'size': 'lg', 'icon': 'filter', 'icon_position': 'before', 'attributes': button_attributes -- GitLab From 40da943306cf198f8c952a55cb09944bff653a23 Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Thu, 3 Feb 2022 09:50:28 +0100 Subject: [PATCH 14/22] OEL-779: Update oe_bootstrap_theme release. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 34ed37ad..ec439a08 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=7.3", "cweagans/composer-patches": "^1.7", "drupal/core": "^8.9 || ^9.1", - "openeuropa/oe_bootstrap_theme": "0.779.202202021710" + "openeuropa/oe_bootstrap_theme": "0.779.202202030945" }, "require-dev": { "composer/installers": "^1.11", -- GitLab From 171026ba4b406b7c4a32daf227984f76ff6ac0d9 Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Thu, 3 Feb 2022 11:39:07 +0100 Subject: [PATCH 15/22] OEL-779: Update to the 1.x oe_bootstrap_theme release. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ec439a08..f70e13b9 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=7.3", "cweagans/composer-patches": "^1.7", "drupal/core": "^8.9 || ^9.1", - "openeuropa/oe_bootstrap_theme": "0.779.202202030945" + "openeuropa/oe_bootstrap_theme": "0.1.202202031130" }, "require-dev": { "composer/installers": "^1.11", -- GitLab From 9c000cea06d1fa0bfca31803986b039b92270c1b Mon Sep 17 00:00:00 2001 From: escuriola <escuriola@gmail.com> Date: Thu, 3 Feb 2022 11:44:43 +0100 Subject: [PATCH 16/22] OEL-779: Reformat code. --- .../search/block--facets-form.html.twig | 2 +- .../patterns/header/pattern-header.html.twig | 29 ++++++++----------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/templates/overrides/search/block--facets-form.html.twig b/templates/overrides/search/block--facets-form.html.twig index d5687894..3729c625 100644 --- a/templates/overrides/search/block--facets-form.html.twig +++ b/templates/overrides/search/block--facets-form.html.twig @@ -43,7 +43,7 @@ {% set actions = actions|merge({('reset'): reset}) %} {% set content = content|merge({('actions'): actions}) %} {% endif %} - {% set button_attributes = create_attribute().addClass(['d-lg-none', 'w-100', 'mb-4']) %} +{% set button_attributes = create_attribute().addClass(['d-lg-none', 'w-100', 'mb-4']) %} {% set toogle_button = { 'label': label, 'variant': 'light', diff --git a/templates/patterns/header/pattern-header.html.twig b/templates/patterns/header/pattern-header.html.twig index 681683d4..8562e3ed 100644 --- a/templates/patterns/header/pattern-header.html.twig +++ b/templates/patterns/header/pattern-header.html.twig @@ -4,35 +4,30 @@ * Template for header pattern. */ #} -{% - set _nav_attributes = create_attribute().addClass([ - 'w-100', - 'shadow-sm', - 'navbar', - 'navbar-expand-lg', - 'navbar-light', - ]) -%} +{% set _nav_attributes = create_attribute().addClass([ + 'w-100', + 'shadow-sm', + 'navbar', + 'navbar-expand-lg', + 'navbar-light', +]) %} {% set navbar_attributes = create_attribute().addClass(['bcl-header__navbar']) %} {% set _header_attributes = create_attribute() %} +{% set _project_attributes = create_attribute().addClass([ + 'bcl-header__project', + bcl_header_style == 'light' ? bcl_header_style, +]) %} {% block header %} <header {{ _header_attributes }}> - {% endblock %} +{% endblock %} <nav {{ _nav_attributes }}> <div class="container"> {{ navbar_branding }} <ul class="nav"> {{ navbar_right }} </ul> - </div> </nav> - {% - set _project_attributes = create_attribute().addClass([ - 'bcl-header__project', - bcl_header_style == 'light' ? bcl_header_style, - ]) - %} <div {{ _project_attributes }}> <div class="container"> {{ header_top }} -- GitLab From f72421c6105b9e6872ffe1cddf20fdabef9f6abf Mon Sep 17 00:00:00 2001 From: Gilmar Lima <gilmar.lima@novacomm-europa.eu> Date: Wed, 10 Nov 2021 12:22:25 +0000 Subject: [PATCH 17/22] OEL-476: Create the User Profile submodule. --- modules/oe_whitelabel_user_profile/README.md | 3 +++ .../oe_whitelabel_user_profile.info.yml | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 modules/oe_whitelabel_user_profile/README.md create mode 100644 modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml diff --git a/modules/oe_whitelabel_user_profile/README.md b/modules/oe_whitelabel_user_profile/README.md new file mode 100644 index 00000000..c01c78a9 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/README.md @@ -0,0 +1,3 @@ +# OpenEuropa Whitelabel User Profile + +The scope of this module is to provide templates for theming the User Profile. diff --git a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml new file mode 100644 index 00000000..8a9bbfb4 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml @@ -0,0 +1,5 @@ +name: OpenEuropa Whitelabel User Profile +type: module +description: OpenEuropa Whitelabel Theme User Profile. +package: OpenEuropa Whitelabel Theme +core_version_requirement: ^8.9 || ^9.1 -- GitLab From 74cb27f90b2ff675712c181a51f90020e4f18462 Mon Sep 17 00:00:00 2001 From: drishu <aszilagyi@live.com> Date: Thu, 18 Nov 2021 13:31:02 +0200 Subject: [PATCH 18/22] OEL-476: Improve texts, add to runner. --- modules/oe_whitelabel_user_profile/README.md | 2 +- .../oe_whitelabel_user_profile.info.yml | 2 +- runner.yml.dist | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/oe_whitelabel_user_profile/README.md b/modules/oe_whitelabel_user_profile/README.md index c01c78a9..8c4b7950 100644 --- a/modules/oe_whitelabel_user_profile/README.md +++ b/modules/oe_whitelabel_user_profile/README.md @@ -1,3 +1,3 @@ # OpenEuropa Whitelabel User Profile -The scope of this module is to provide templates for theming the User Profile. +The scope of this module is to provide alterations and additional functionality for the theming of the OpenEuropa Library User Profile feature. diff --git a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml index 8a9bbfb4..1ac38d3a 100644 --- a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml +++ b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml @@ -1,5 +1,5 @@ name: OpenEuropa Whitelabel User Profile type: module -description: OpenEuropa Whitelabel Theme User Profile. +description: Adds additional functionality to the User Profile feature. package: OpenEuropa Whitelabel Theme core_version_requirement: ^8.9 || ^9.1 diff --git a/runner.yml.dist b/runner.yml.dist index 407e5c73..628b9cfa 100644 --- a/runner.yml.dist +++ b/runner.yml.dist @@ -17,6 +17,7 @@ drupal: # Prepare the instance. - "./vendor/bin/drush en oe_whitelabel_helper -y" - "./vendor/bin/drush en oe_whitelabel_search -y" + - "./vendor/bin/drush en oe_whitelabel_user_profile -y" - "./vendor/bin/drush en field_ui -y" - "./vendor/bin/drush en toolbar -y" - "./vendor/bin/drush theme:enable oe_whitelabel -y" -- GitLab From b04f44e81cfadfc8ba95959ad2b22d8efe2ab4ed Mon Sep 17 00:00:00 2001 From: drishu <aszilagyi@live.com> Date: Wed, 12 Jan 2022 09:15:02 +0200 Subject: [PATCH 19/22] OEL-484: Add language concept subset. --- .../src/Plugin/ConceptSubset/LanguagesWeb.php | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 modules/oe_whitelabel_user_profile/src/Plugin/ConceptSubset/LanguagesWeb.php diff --git a/modules/oe_whitelabel_user_profile/src/Plugin/ConceptSubset/LanguagesWeb.php b/modules/oe_whitelabel_user_profile/src/Plugin/ConceptSubset/LanguagesWeb.php new file mode 100644 index 00000000..daba08ae --- /dev/null +++ b/modules/oe_whitelabel_user_profile/src/Plugin/ConceptSubset/LanguagesWeb.php @@ -0,0 +1,75 @@ +<?php + +declare(strict_types = 1); + +namespace Drupal\oe_whitelabel_user_profile\Plugin\ConceptSubset; + +use Drupal\Core\Entity\Query\QueryInterface; +use Drupal\rdf_skos\ConceptSubsetPluginBase; + +/** + * Creates a subset of the languages vocabulary. + * + * @see https://github.com/ec-europa/ewcms/blob/develop/modules/ewcms_vocabularies/src/Plugin/ConceptSubset/LanguagesWeb.php + * + * @ConceptSubset( + * id = "languages_web", + * label = @Translation("WEB Languages"), + * description = @Translation("Languages to be used for the WEB presence."), + * concept_schemes = { + * "http://publications.europa.eu/resource/authority/language" + * } + * ) + */ +class LanguagesWeb extends ConceptSubsetPluginBase { + + /** + * {@inheritdoc} + */ + public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void { + $languages = [ + 'Bulgarian' => 'http://publications.europa.eu/resource/authority/language/BUL', + 'Spanish' => 'http://publications.europa.eu/resource/authority/language/SPA', + 'Czech' => 'http://publications.europa.eu/resource/authority/language/CES', + 'Danish' => 'http://publications.europa.eu/resource/authority/language/DAN', + 'German' => 'http://publications.europa.eu/resource/authority/language/DEU', + 'Estonian' => 'http://publications.europa.eu/resource/authority/language/EST', + 'Greek' => 'http://publications.europa.eu/resource/authority/language/ELL', + 'English' => 'http://publications.europa.eu/resource/authority/language/ENG', + 'French' => 'http://publications.europa.eu/resource/authority/language/FRA', + 'Irish' => 'http://publications.europa.eu/resource/authority/language/GLE', + 'Croatian' => 'http://publications.europa.eu/resource/authority/language/HRV', + 'Italian' => 'http://publications.europa.eu/resource/authority/language/ITA', + 'Latvian' => 'http://publications.europa.eu/resource/authority/language/LAV', + 'Lithuanian' => 'http://publications.europa.eu/resource/authority/language/LIT', + 'Hungarian' => 'http://publications.europa.eu/resource/authority/language/HUN', + 'Maltese' => 'http://publications.europa.eu/resource/authority/language/MLT', + 'Dutch' => 'http://publications.europa.eu/resource/authority/language/NLD', + 'Polish' => 'http://publications.europa.eu/resource/authority/language/POL', + 'Portuguese' => 'http://publications.europa.eu/resource/authority/language/POR', + 'Romanian' => 'http://publications.europa.eu/resource/authority/language/RON', + 'Slovak' => 'http://publications.europa.eu/resource/authority/language/SLK', + 'Slovenian' => 'http://publications.europa.eu/resource/authority/language/SLV', + 'Finnish' => 'http://publications.europa.eu/resource/authority/language/FIN', + 'Swedish' => 'http://publications.europa.eu/resource/authority/language/SWE', + 'Arabic' => 'http://publications.europa.eu/resource/authority/language/ARA', + 'Belorussian' => 'http://publications.europa.eu/resource/authority/language/BEL', + 'Hebrew' => 'http://publications.europa.eu/resource/authority/language/HEB', + 'Hindi' => 'http://publications.europa.eu/resource/authority/language/HIN', + 'Armenian' => 'http://publications.europa.eu/resource/authority/language/HYE', + 'Icelandic' => 'http://publications.europa.eu/resource/authority/language/ISL', + 'Japanese' => 'http://publications.europa.eu/resource/authority/language/JPN', + 'Macedonian' => 'http://publications.europa.eu/resource/authority/language/MKD', + 'Norwegian' => 'http://publications.europa.eu/resource/authority/language/NOR', + 'Russian' => 'http://publications.europa.eu/resource/authority/language/RUS', + 'Albanian' => 'http://publications.europa.eu/resource/authority/language/SQI', + 'Turkish' => 'http://publications.europa.eu/resource/authority/language/TUR', + 'Urdu' => 'http://publications.europa.eu/resource/authority/language/URD', + 'Vietnamese' => 'http://publications.europa.eu/resource/authority/language/VIE', + 'Chinese' => 'http://publications.europa.eu/resource/authority/language/ZHO', + ]; + + $query->condition('id', array_values($languages), 'IN'); + } + +} -- GitLab From 2797db0ead7a7d71718b694992a53bee1b55036c Mon Sep 17 00:00:00 2001 From: drishu <aszilagyi@live.com> Date: Tue, 25 Jan 2022 09:42:05 +0200 Subject: [PATCH 20/22] OEL-484: Add ecas field mapping. --- .../oe_whitelabel_user_profile.info.yml | 2 + .../oe_whitelabel_user_profile.services.yml | 5 ++ ...uLoginAttributesToUserFieldsSubscriber.php | 82 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.services.yml create mode 100644 modules/oe_whitelabel_user_profile/src/EventSubscriber/EuLoginAttributesToUserFieldsSubscriber.php diff --git a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml index 1ac38d3a..f7dc68a0 100644 --- a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml +++ b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.info.yml @@ -3,3 +3,5 @@ type: module description: Adds additional functionality to the User Profile feature. package: OpenEuropa Whitelabel Theme core_version_requirement: ^8.9 || ^9.1 +dependencies: + - cas:cas diff --git a/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.services.yml b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.services.yml new file mode 100644 index 00000000..e76fbb58 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/oe_whitelabel_user_profile.services.yml @@ -0,0 +1,5 @@ +services: + oe_whitelabel_user_profile.event_subscriber: + class: Drupal\oe_whitelabel_user_profile\EventSubscriber\EuLoginAttributesToUserFieldsSubscriber + tags: + - { name: event_subscriber } diff --git a/modules/oe_whitelabel_user_profile/src/EventSubscriber/EuLoginAttributesToUserFieldsSubscriber.php b/modules/oe_whitelabel_user_profile/src/EventSubscriber/EuLoginAttributesToUserFieldsSubscriber.php new file mode 100644 index 00000000..caad07b5 --- /dev/null +++ b/modules/oe_whitelabel_user_profile/src/EventSubscriber/EuLoginAttributesToUserFieldsSubscriber.php @@ -0,0 +1,82 @@ +<?php + +declare(strict_types = 1); + +namespace Drupal\oe_whitelabel_user_profile\EventSubscriber; + +use Drupal\cas\Event\CasPostLoginEvent; +use Drupal\cas\Event\CasPreRegisterEvent; +use Drupal\cas\Service\CasHelper; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * Copies the EU Login attributes to user fields. + */ +class EuLoginAttributesToUserFieldsSubscriber implements EventSubscriberInterface { + + /** + * Array mapping of EU Login attributes with user account fields. + */ + const USER_EU_LOGIN_ATTRIBUTE_MAPPING = [ + 'mail' => 'email', + 'field_first_name' => 'firstName', + 'field_last_name' => 'lastName', + 'field_organization' => 'domain', + ]; + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() { + return [ + CasHelper::EVENT_POST_LOGIN => 'updateUserData', + CasHelper::EVENT_PRE_REGISTER => 'processUserProperties', + ]; + } + + /** + * Updates the user data based on the information taken from EU Login. + * + * @param \Drupal\cas\Event\CasPostLoginEvent $event + * The triggered event. + */ + public function updateUserData(CasPostLoginEvent $event): void { + $properties = self::convertEuLoginAttributesToFieldValues($event->getCasPropertyBag()->getAttributes()); + $account = $event->getAccount(); + foreach ($properties as $name => $value) { + $account->set($name, $value); + } + $account->save(); + } + + /** + * Adds user properties based on the information taken from EU Login. + * + * @param \Drupal\cas\Event\CasPreRegisterEvent $event + * The triggered event. + */ + public function processUserProperties(CasPreRegisterEvent $event): void { + $attributes = $event->getCasPropertyBag()->getAttributes(); + $event->setPropertyValues(self::convertEuLoginAttributesToFieldValues($attributes)); + } + + /** + * Converts the EU Login attributes into a Drupal field/values array. + * + * @param array $attributes + * An array containing a series of EU Login attributes. + * + * @return array + * An associative array of field values indexed by the field name. + */ + protected static function convertEuLoginAttributesToFieldValues(array $attributes): array { + $values = []; + foreach (static::USER_EU_LOGIN_ATTRIBUTE_MAPPING as $field_name => $property_name) { + if (!empty($attributes[$property_name])) { + $values[$field_name] = $attributes[$property_name]; + } + } + return $values; + } + +} -- GitLab From 307052e3b79af9ce22cc86a3ee21e879da68f545 Mon Sep 17 00:00:00 2001 From: Gilmar Lima <gilmar.lima@novacomm-europa.eu> Date: Wed, 10 Nov 2021 12:22:25 +0000 Subject: [PATCH 21/22] OEL-476: Create the User Profile submodule. --- modules/oe_whitelabel_user_profile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/oe_whitelabel_user_profile/README.md b/modules/oe_whitelabel_user_profile/README.md index 8c4b7950..c01c78a9 100644 --- a/modules/oe_whitelabel_user_profile/README.md +++ b/modules/oe_whitelabel_user_profile/README.md @@ -1,3 +1,3 @@ # OpenEuropa Whitelabel User Profile -The scope of this module is to provide alterations and additional functionality for the theming of the OpenEuropa Library User Profile feature. +The scope of this module is to provide templates for theming the User Profile. -- GitLab From 37dc87d499ff9978fb6ec36a7e77024e9c5c8b18 Mon Sep 17 00:00:00 2001 From: drishu <aszilagyi@live.com> Date: Thu, 18 Nov 2021 13:31:02 +0200 Subject: [PATCH 22/22] OEL-476: Improve texts, add to runner. --- modules/oe_whitelabel_user_profile/README.md | 2 +- runner.yml.dist | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/oe_whitelabel_user_profile/README.md b/modules/oe_whitelabel_user_profile/README.md index c01c78a9..8c4b7950 100644 --- a/modules/oe_whitelabel_user_profile/README.md +++ b/modules/oe_whitelabel_user_profile/README.md @@ -1,3 +1,3 @@ # OpenEuropa Whitelabel User Profile -The scope of this module is to provide templates for theming the User Profile. +The scope of this module is to provide alterations and additional functionality for the theming of the OpenEuropa Library User Profile feature. diff --git a/runner.yml.dist b/runner.yml.dist index 628b9cfa..b782da46 100644 --- a/runner.yml.dist +++ b/runner.yml.dist @@ -21,6 +21,9 @@ drupal: - "./vendor/bin/drush en field_ui -y" - "./vendor/bin/drush en toolbar -y" - "./vendor/bin/drush theme:enable oe_whitelabel -y" + - "./vendor/bin/drush en oe_bootstrap_theme_helper -y" + - "./vendor/bin/drush en oe_whitelabel_helper -y" + - "./vendor/bin/drush en oe_whitelabel_search -y" - "./vendor/bin/drush theme:enable seven -y" - "./vendor/bin/drush config-set system.theme default oe_whitelabel -y" - "./vendor/bin/drush config-set system.theme admin seven -y" -- GitLab