From b8435d6dad93bbd2a05e1b4e668ef6606ca37cdb Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Thu, 7 Nov 2024 17:17:48 +0200 Subject: [PATCH 1/5] UHF-10711: Added Helsinki near you hero paragraph alterations --- .../hdbt_admin_tools/hdbt_admin_tools.module | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/hdbt_admin_tools/hdbt_admin_tools.module b/modules/hdbt_admin_tools/hdbt_admin_tools.module index 2048d872b..a082d74ee 100644 --- a/modules/hdbt_admin_tools/hdbt_admin_tools.module +++ b/modules/hdbt_admin_tools/hdbt_admin_tools.module @@ -525,19 +525,22 @@ function hdbt_admin_tools_entity_bundle_field_info_alter(&$fields, EntityTypeInt } /** - * Implements hook_field_widget_WIDGET_TYPE_form_alter(). - * - * Hero designs: - * background-image = "Background image" - * diagonal = "Diagonal" - * with-image-bottom = "Image on the bottom" - * with-image-left = "Image on the left" - * with-image-right = "Image on the right" - * without-image-center = "Without image, align center" - * without-image-left = "Without image, align left" - * with-search = "With search" + * Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter(). */ -function hdbt_admin_tools_field_widget_paragraphs_form_alter(&$element, &$form_state, $context): void { +function hdbt_admin_tools_field_widget_single_element_paragraphs_form_alter(&$element, &$form_state, $context): void { + /** + * Hero designs: + * + * background-image = "Background image" + * diagonal = "Diagonal" + * with-image-bottom = "Image on the bottom" + * with-image-left = "Image on the left" + * with-image-right = "Image on the right" + * without-image-center = "Without image, align center" + * without-image-left = "Without image, align left" + * with-search = "With search" + * with-helsinki-near-me = "With Helsinki near you" + */ // Early return if paragraph type is not set. if (!isset($element['#paragraph_type'])) { @@ -565,6 +568,8 @@ function hdbt_admin_tools_field_widget_paragraphs_form_alter(&$element, &$form_s [$design_select => ['value' => 'without-image-center']], 'or', [$design_select => ['value' => 'without-image-left']], + 'or', + [$design_select => ['value' => 'with-helsinki-near-you']], ], ]; From de867743f885cdcab6307580b4e4c54d0c599f58 Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Wed, 13 Nov 2024 16:58:38 +0200 Subject: [PATCH 2/5] UHF-10771: Remove with-helsinki-near-you class from designs since it is not really a hero design --- modules/hdbt_admin_tools/hdbt_admin_tools.module | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/hdbt_admin_tools/hdbt_admin_tools.module b/modules/hdbt_admin_tools/hdbt_admin_tools.module index a082d74ee..23d2171c1 100644 --- a/modules/hdbt_admin_tools/hdbt_admin_tools.module +++ b/modules/hdbt_admin_tools/hdbt_admin_tools.module @@ -539,7 +539,6 @@ function hdbt_admin_tools_field_widget_single_element_paragraphs_form_alter(&$el * without-image-center = "Without image, align center" * without-image-left = "Without image, align left" * with-search = "With search" - * with-helsinki-near-me = "With Helsinki near you" */ // Early return if paragraph type is not set. From fd218843591095300189814d25c401e83c08d818 Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Thu, 14 Nov 2024 09:43:50 +0200 Subject: [PATCH 3/5] UHF-10771: Remove reference to with-helsinki-near-you design in hero --- modules/hdbt_admin_tools/hdbt_admin_tools.module | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/hdbt_admin_tools/hdbt_admin_tools.module b/modules/hdbt_admin_tools/hdbt_admin_tools.module index 23d2171c1..a14641dd3 100644 --- a/modules/hdbt_admin_tools/hdbt_admin_tools.module +++ b/modules/hdbt_admin_tools/hdbt_admin_tools.module @@ -567,8 +567,6 @@ function hdbt_admin_tools_field_widget_single_element_paragraphs_form_alter(&$el [$design_select => ['value' => 'without-image-center']], 'or', [$design_select => ['value' => 'without-image-left']], - 'or', - [$design_select => ['value' => 'with-helsinki-near-you']], ], ]; From 44cec84163815a73b0a7d48e5850c3a830a72f80 Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Thu, 14 Nov 2024 11:22:11 +0200 Subject: [PATCH 4/5] UHF-10771: Fix PHPCS errors --- modules/hdbt_admin_tools/hdbt_admin_tools.module | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/hdbt_admin_tools/hdbt_admin_tools.module b/modules/hdbt_admin_tools/hdbt_admin_tools.module index a14641dd3..fa8acce3d 100644 --- a/modules/hdbt_admin_tools/hdbt_admin_tools.module +++ b/modules/hdbt_admin_tools/hdbt_admin_tools.module @@ -528,8 +528,7 @@ function hdbt_admin_tools_entity_bundle_field_info_alter(&$fields, EntityTypeInt * Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter(). */ function hdbt_admin_tools_field_widget_single_element_paragraphs_form_alter(&$element, &$form_state, $context): void { - /** - * Hero designs: + /* Hero designs: * * background-image = "Background image" * diagonal = "Diagonal" From fa883fa88152108ec98b90e054700d77f79b5d7d Mon Sep 17 00:00:00 2001 From: Tero Elonen Date: Thu, 14 Nov 2024 12:55:15 +0200 Subject: [PATCH 5/5] UHF-10771: Fix PHPCS errors --- modules/hdbt_admin_tools/hdbt_admin_tools.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hdbt_admin_tools/hdbt_admin_tools.module b/modules/hdbt_admin_tools/hdbt_admin_tools.module index fa8acce3d..95fefdf16 100644 --- a/modules/hdbt_admin_tools/hdbt_admin_tools.module +++ b/modules/hdbt_admin_tools/hdbt_admin_tools.module @@ -538,7 +538,7 @@ function hdbt_admin_tools_field_widget_single_element_paragraphs_form_alter(&$el * without-image-center = "Without image, align center" * without-image-left = "Without image, align left" * with-search = "With search" - */ + */ // Early return if paragraph type is not set. if (!isset($element['#paragraph_type'])) {