From 69e951d47e87c93ff82a1cdfa6e55848f9ec2908 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 11 Jul 2025 13:55:49 +0200 Subject: [PATCH] [IMP] test_themes, theme_*: adapt themes for new parallax structure This commit adapts the themes to the new Parallax effect structure. We now wrap the parallax element in another element with "overflow: hidden" to avoid setting "overflow: hidden" on sections. That was causing elements like the dropdown of the search bar to be cut off and not fully visible. task-4926420 closes odoo/design-themes#1114 Related: odoo/odoo#218296 Signed-off-by: Quentin Smetz (qsm) --- test_themes/tests/test_new_page_templates.py | 12 +++++++++++- .../views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_artists/views/snippets/s_cover.xml | 4 ++-- theme_artists/views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_artists/views/snippets/s_title.xml | 6 ++++-- theme_avantgarde/views/customizations.xml | 3 ++- theme_bewise/views/customizations.xml | 2 +- theme_bistro/views/snippets/s_image_title.xml | 4 +++- theme_bistro/views/snippets/s_product_catalog.xml | 4 +++- theme_bookstore/views/snippets/s_cover.xml | 2 +- .../views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_buzzy/views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_clean/views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_clean/views/snippets/s_product_catalog.xml | 4 +++- theme_cobalt/views/customizations.xml | 4 ++-- theme_enark/views/snippets/s_banner.xml | 4 +++- theme_graphene/views/customizations.xml | 14 ++++++++------ theme_kea/views/snippets/s_cover.xml | 2 +- theme_kea/views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_kiddo/views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_loftspace/views/snippets/s_title.xml | 4 +++- theme_monglia/views/customizations.xml | 4 ++-- theme_nano/views/snippets/s_cover.xml | 2 +- theme_notes/views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_notes/views/snippets/s_product_catalog.xml | 6 ++++-- .../views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_orchid/views/snippets/s_kickoff.xml | 2 +- theme_paptic/views/customizations.xml | 4 ++-- .../views/snippets/s_pricelist_boxed.xml | 4 ++-- theme_treehouse/views/snippets/s_title.xml | 4 +++- theme_yes/views/snippets/s_kickoff.xml | 4 ++-- theme_zap/views/snippets/s_banner.xml | 4 +++- theme_zap/views/snippets/s_pricelist_boxed.xml | 4 ++-- 33 files changed, 87 insertions(+), 56 deletions(-) diff --git a/test_themes/tests/test_new_page_templates.py b/test_themes/tests/test_new_page_templates.py index 9709ab7c6..00ca9d0a9 100644 --- a/test_themes/tests/test_new_page_templates.py +++ b/test_themes/tests/test_new_page_templates.py @@ -96,7 +96,7 @@ S_CLASSES_WHITELIST = [ # Classes that rightfully belong here at the moment 's_col_no_bgcolor', 's_col_no_resize', 's_allow_columns', 's_nb_column_fixed', 's_dialog_preview', - 's_parallax_is_fixed', 's_parallax_bg', 's_parallax_no_overflow_hidden', + 's_parallax_is_fixed', 's_parallax_bg', 's_parallax_bg_wrap', 's_carousel_cards_card', 's_timeline_card', 's_blog_posts', 's_events', 's_appointments', @@ -347,6 +347,16 @@ class TestNewPageTemplates(TransactionCase): "Using %r, view %r defines a row count on a non-grid mode row" % (theme_name, view.key) ) + + for el in html_tree.xpath(".//*[contains(concat(' ', normalize-space(@class), ' '), ' s_parallax_bg ')]"): + parent = el.getparent() + parent_classes = parent.attrib.get('class') + if parent_classes != 's_parallax_bg_wrap': + errors.append( + "Using %r, view %r: element with class 's_parallax_bg' must have a direct " + "parent with 's_parallax_bg_wrap', found parent classes: %r" + % (theme_name, view.key, parent_classes) + ) except Exception as e: # noqa: BLE001 _logger.error("Using %r, view %r cannot be rendered (%r)", theme_name, view.key, e) errors.append("Using %r, view %r cannot be rendered (%r)" % (theme_name, view.key, e)) diff --git a/theme_anelusia/views/snippets/s_pricelist_boxed.xml b/theme_anelusia/views/snippets/s_pricelist_boxed.xml index bb91ab70d..ba021c14f 100644 --- a/theme_anelusia/views/snippets/s_pricelist_boxed.xml +++ b/theme_anelusia/views/snippets/s_pricelist_boxed.xml @@ -5,10 +5,10 @@ - + {'shape':'html_builder/Floats/12','flip':[],'showOnMobile':false,'shapeAnimationSpeed':'0','animated':'true'} - +
diff --git a/theme_artists/views/snippets/s_cover.xml b/theme_artists/views/snippets/s_cover.xml index c59f59565..1e28bbe86 100644 --- a/theme_artists/views/snippets/s_cover.xml +++ b/theme_artists/views/snippets/s_cover.xml @@ -4,7 +4,7 @@ diff --git a/theme_avantgarde/views/customizations.xml b/theme_avantgarde/views/customizations.xml index 0f2337b81..5ab756bc0 100644 --- a/theme_avantgarde/views/customizations.xml +++ b/theme_avantgarde/views/customizations.xml @@ -12,7 +12,8 @@ diff --git a/theme_cobalt/views/customizations.xml b/theme_cobalt/views/customizations.xml index 2ea04a885..70773e5b6 100644 --- a/theme_cobalt/views/customizations.xml +++ b/theme_cobalt/views/customizations.xml @@ -344,13 +344,13 @@ - + {'shape':'html_builder/Bold/01_001','colors':{'c5':'o-color-1'},'flip':[],'showOnMobile':false,'shapeAnimationSpeed':'0'}
- + diff --git a/theme_enark/views/snippets/s_banner.xml b/theme_enark/views/snippets/s_banner.xml index 9a2c2a504..88d0b69bb 100644 --- a/theme_enark/views/snippets/s_banner.xml +++ b/theme_enark/views/snippets/s_banner.xml @@ -8,7 +8,9 @@ 1 - + + + diff --git a/theme_graphene/views/customizations.xml b/theme_graphene/views/customizations.xml index 8562b2542..29deb2fd8 100644 --- a/theme_graphene/views/customizations.xml +++ b/theme_graphene/views/customizations.xml @@ -4,11 +4,11 @@