From 94b304263450a510d77aad9f7bf67ea02f79bdea Mon Sep 17 00:00:00 2001 From: "Pierre Pulinckx (pipu)" Date: Mon, 31 Jul 2023 13:58:17 +0000 Subject: [PATCH] [REF] website_*: Change registerTours of tour_utils As steps are encapsuled in an arrow function from 69a5d8e3ce47238 for steps tour definition to avoid direct Markup(_t()) interpretation, the same is done for registerWebsitePreviewTour() of "odoo/addons/website/static/src/js/tours/tour_utils.js" in this commit. This is done in anticipation of the use of _t() (import from @web/core/l10n/translation) with registerWebsitePreviewTour(). task-3292454 closes odoo/design-themes#678 Related: odoo/odoo#130248 Signed-off-by: Luca Vitali (luvi) --- theme_anelusia/static/src/js/tour.js | 2 +- theme_artists/static/src/js/tour.js | 2 +- theme_avantgarde/static/src/js/tour.js | 2 +- theme_aviato/static/src/js/tour.js | 4 ++-- theme_beauty/static/src/js/tour.js | 2 +- theme_bewise/static/src/js/tour.js | 4 ++-- theme_bistro/static/src/js/tour.js | 2 +- theme_bookstore/static/src/js/tour.js | 4 ++-- theme_buzzy/static/src/js/tour.js | 2 +- theme_clean/static/src/js/tour.js | 4 ++-- theme_cobalt/static/src/js/tour.js | 2 +- theme_enark/static/src/js/tour.js | 2 +- theme_graphene/static/src/js/tour.js | 2 +- theme_kea/static/src/js/tour.js | 2 +- theme_kiddo/static/src/js/tour.js | 4 ++-- theme_loftspace/static/src/js/tour.js | 2 +- theme_monglia/static/src/js/tour.js | 2 +- theme_nano/static/src/js/tour.js | 2 +- theme_notes/static/src/js/tour.js | 4 ++-- theme_odoo_experts/static/src/js/tour.js | 4 ++-- theme_orchid/static/src/js/tour.js | 4 ++-- theme_paptic/static/src/js/tour.js | 2 +- theme_real_estate/static/src/js/tour.js | 2 +- theme_test_custo/static/tests/tours/theme_menu_hierarchies.js | 2 +- theme_treehouse/static/src/js/tour.js | 2 +- theme_vehicle/static/src/js/tour.js | 2 +- theme_yes/static/src/js/tour.js | 2 +- theme_zap/static/src/js/tour.js | 2 +- 28 files changed, 36 insertions(+), 36 deletions(-) diff --git a/theme_anelusia/static/src/js/tour.js b/theme_anelusia/static/src/js/tour.js index 210d3b153..f48edeaf4 100644 --- a/theme_anelusia/static/src/js/tour.js +++ b/theme_anelusia/static/src/js/tour.js @@ -33,7 +33,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("anelusia_tour", [ +wTourUtils.registerThemeHomepageTour("anelusia_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"generic-17"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_artists/static/src/js/tour.js b/theme_artists/static/src/js/tour.js index a42494c39..3ef1bd871 100644 --- a/theme_artists/static/src/js/tour.js +++ b/theme_artists/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("artists_tour", [ +wTourUtils.registerThemeHomepageTour("artists_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"artists-1"'), wTourUtils.dragNDrop(snippets[0], 'top'), wTourUtils.dragNDrop(snippets[1]), diff --git a/theme_avantgarde/static/src/js/tour.js b/theme_avantgarde/static/src/js/tour.js index 0806e9cfd..707146eb1 100644 --- a/theme_avantgarde/static/src/js/tour.js +++ b/theme_avantgarde/static/src/js/tour.js @@ -24,7 +24,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("avantgarde_tour", [ +wTourUtils.registerThemeHomepageTour("avantgarde_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"avantgarde-3"'), wTourUtils.dragNDrop(snippets[0], 'top'), wTourUtils.clickOnText(snippets[0], 'h1', 'left'), diff --git a/theme_aviato/static/src/js/tour.js b/theme_aviato/static/src/js/tour.js index 17409fa8d..6ee67dad4 100644 --- a/theme_aviato/static/src/js/tour.js +++ b/theme_aviato/static/src/js/tour.js @@ -1,7 +1,7 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -30,7 +30,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("aviato_tour", [ +wTourUtils.registerThemeHomepageTour("aviato_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"treehouse-5"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_beauty/static/src/js/tour.js b/theme_beauty/static/src/js/tour.js index 2a557ac61..361cc83e4 100644 --- a/theme_beauty/static/src/js/tour.js +++ b/theme_beauty/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("beauty_tour", [ +wTourUtils.registerThemeHomepageTour("beauty_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"beauty-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_bewise/static/src/js/tour.js b/theme_bewise/static/src/js/tour.js index 8782a7479..0750b1776 100644 --- a/theme_bewise/static/src/js/tour.js +++ b/theme_bewise/static/src/js/tour.js @@ -1,6 +1,6 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -33,7 +33,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("bewise_tour", [ +wTourUtils.registerThemeHomepageTour("bewise_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"bewise-1"'), wTourUtils.dragNDrop(snippets[0], 'top'), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_bistro/static/src/js/tour.js b/theme_bistro/static/src/js/tour.js index b225b0365..c08c7e1c2 100644 --- a/theme_bistro/static/src/js/tour.js +++ b/theme_bistro/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("bistro_tour", [ +wTourUtils.registerThemeHomepageTour("bistro_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"bistro-5"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_bookstore/static/src/js/tour.js b/theme_bookstore/static/src/js/tour.js index 24aefbab8..b8e4a4210 100644 --- a/theme_bookstore/static/src/js/tour.js +++ b/theme_bookstore/static/src/js/tour.js @@ -1,7 +1,7 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -30,7 +30,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("bookstore_tour", [ +wTourUtils.registerThemeHomepageTour("bookstore_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"generic-8"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_buzzy/static/src/js/tour.js b/theme_buzzy/static/src/js/tour.js index 82a13fcfa..d4e9d37a4 100644 --- a/theme_buzzy/static/src/js/tour.js +++ b/theme_buzzy/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("buzzy_tour", [ +wTourUtils.registerThemeHomepageTour("buzzy_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"kiddo-2"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_clean/static/src/js/tour.js b/theme_clean/static/src/js/tour.js index c6772eb35..0a44fffe3 100644 --- a/theme_clean/static/src/js/tour.js +++ b/theme_clean/static/src/js/tour.js @@ -1,7 +1,7 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -38,7 +38,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("clean_tour", [ +wTourUtils.registerThemeHomepageTour("clean_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"clean-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_cobalt/static/src/js/tour.js b/theme_cobalt/static/src/js/tour.js index 332afdecb..7442be010 100644 --- a/theme_cobalt/static/src/js/tour.js +++ b/theme_cobalt/static/src/js/tour.js @@ -30,7 +30,7 @@ const snippets = [ ]; -wTourUtils.registerThemeHomepageTour("cobalt_tour", [ +wTourUtils.registerThemeHomepageTour("cobalt_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"cobalt-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_enark/static/src/js/tour.js b/theme_enark/static/src/js/tour.js index 1505e9bd3..6b0a5164d 100644 --- a/theme_enark/static/src/js/tour.js +++ b/theme_enark/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("enark_tour", [ +wTourUtils.registerThemeHomepageTour("enark_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"enark-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_graphene/static/src/js/tour.js b/theme_graphene/static/src/js/tour.js index 8b729a1cf..0f94605b4 100644 --- a/theme_graphene/static/src/js/tour.js +++ b/theme_graphene/static/src/js/tour.js @@ -26,7 +26,7 @@ const snippets = [ ]; -wTourUtils.registerThemeHomepageTour("graphene_tour", [ +wTourUtils.registerThemeHomepageTour("graphene_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"graphene-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_kea/static/src/js/tour.js b/theme_kea/static/src/js/tour.js index 16dbc449a..b4c910eb3 100644 --- a/theme_kea/static/src/js/tour.js +++ b/theme_kea/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("kea_tour", [ +wTourUtils.registerThemeHomepageTour("kea_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"bewise-2"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_kiddo/static/src/js/tour.js b/theme_kiddo/static/src/js/tour.js index 26b0b7845..aef7e73d7 100644 --- a/theme_kiddo/static/src/js/tour.js +++ b/theme_kiddo/static/src/js/tour.js @@ -1,6 +1,6 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -25,7 +25,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("kiddo_tour", [ +wTourUtils.registerThemeHomepageTour("kiddo_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"default-16"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_loftspace/static/src/js/tour.js b/theme_loftspace/static/src/js/tour.js index 2c122f3ad..3ac50d99f 100644 --- a/theme_loftspace/static/src/js/tour.js +++ b/theme_loftspace/static/src/js/tour.js @@ -25,7 +25,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("loftspace_tour", [ +wTourUtils.registerThemeHomepageTour("loftspace_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"graphene-2"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_monglia/static/src/js/tour.js b/theme_monglia/static/src/js/tour.js index a927f948e..23bec33a6 100644 --- a/theme_monglia/static/src/js/tour.js +++ b/theme_monglia/static/src/js/tour.js @@ -37,7 +37,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("monglia_tour", [ +wTourUtils.registerThemeHomepageTour("monglia_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"monglia-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_nano/static/src/js/tour.js b/theme_nano/static/src/js/tour.js index 3d379c225..0060c7392 100644 --- a/theme_nano/static/src/js/tour.js +++ b/theme_nano/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("nano_tour", [ +wTourUtils.registerThemeHomepageTour("nano_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"nano-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_notes/static/src/js/tour.js b/theme_notes/static/src/js/tour.js index c2c5b5da8..b3237e8ba 100644 --- a/theme_notes/static/src/js/tour.js +++ b/theme_notes/static/src/js/tour.js @@ -1,7 +1,7 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -30,7 +30,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("notes_tour", [ +wTourUtils.registerThemeHomepageTour("notes_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"notes-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_odoo_experts/static/src/js/tour.js b/theme_odoo_experts/static/src/js/tour.js index de4396907..c5ad83272 100644 --- a/theme_odoo_experts/static/src/js/tour.js +++ b/theme_odoo_experts/static/src/js/tour.js @@ -1,7 +1,7 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -34,7 +34,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("odoo_experts_tour", [ +wTourUtils.registerThemeHomepageTour("odoo_experts_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"odoo-experts-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.dragNDrop(snippets[1]), diff --git a/theme_orchid/static/src/js/tour.js b/theme_orchid/static/src/js/tour.js index 07b6dfb24..4871f9f92 100644 --- a/theme_orchid/static/src/js/tour.js +++ b/theme_orchid/static/src/js/tour.js @@ -1,7 +1,7 @@ /** @odoo-module */ import wTourUtils from '@website/js/tours/tour_utils'; -import { _t } from '@web/legacy/js/services/core'; +import { _t } from "@web/core/l10n/translation"; const snippets = [ { @@ -30,7 +30,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("orchid_tour", [ +wTourUtils.registerThemeHomepageTour("orchid_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"orchid-7"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_paptic/static/src/js/tour.js b/theme_paptic/static/src/js/tour.js index 476909330..1cfd6ad3b 100644 --- a/theme_paptic/static/src/js/tour.js +++ b/theme_paptic/static/src/js/tour.js @@ -30,7 +30,7 @@ const snippets = [ ]; -wTourUtils.registerThemeHomepageTour("paptic_tour", [ +wTourUtils.registerThemeHomepageTour("paptic_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"paptic-1"'), wTourUtils.dragNDrop(snippets[0], 'top'), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_real_estate/static/src/js/tour.js b/theme_real_estate/static/src/js/tour.js index 9050ad9e2..5df19bf91 100644 --- a/theme_real_estate/static/src/js/tour.js +++ b/theme_real_estate/static/src/js/tour.js @@ -45,7 +45,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("real_estate_tour", [ +wTourUtils.registerThemeHomepageTour("real_estate_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"real-estate-4"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1'), diff --git a/theme_test_custo/static/tests/tours/theme_menu_hierarchies.js b/theme_test_custo/static/tests/tours/theme_menu_hierarchies.js index 0ecaf56c2..f8fce0667 100644 --- a/theme_test_custo/static/tests/tours/theme_menu_hierarchies.js +++ b/theme_test_custo/static/tests/tours/theme_menu_hierarchies.js @@ -5,7 +5,7 @@ import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('theme_menu_hierarchies', { url: '/example', test: true, -}, [ +}, () => [ { content: 'Check Mega Menu is correctly created', trigger: 'iframe #top_menu a.o_mega_menu_toggle', diff --git a/theme_treehouse/static/src/js/tour.js b/theme_treehouse/static/src/js/tour.js index bf02dcdf1..ed6e7ee1e 100644 --- a/theme_treehouse/static/src/js/tour.js +++ b/theme_treehouse/static/src/js/tour.js @@ -25,7 +25,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("treehouse_tour", [ +wTourUtils.registerThemeHomepageTour("treehouse_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"treehouse-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_vehicle/static/src/js/tour.js b/theme_vehicle/static/src/js/tour.js index 6c5efa3e9..92bb5c40c 100644 --- a/theme_vehicle/static/src/js/tour.js +++ b/theme_vehicle/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("vehicle_tour", [ +wTourUtils.registerThemeHomepageTour("vehicle_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"vehicle-1"'), wTourUtils.dragNDrop(snippets[0], 'top'), wTourUtils.clickOnText(snippets[0], 'h1', 'top'), diff --git a/theme_yes/static/src/js/tour.js b/theme_yes/static/src/js/tour.js index 669e884a5..7dd72ae33 100644 --- a/theme_yes/static/src/js/tour.js +++ b/theme_yes/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("yes_tour", [ +wTourUtils.registerThemeHomepageTour("yes_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"yes-3"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.dragNDrop(snippets[1]), diff --git a/theme_zap/static/src/js/tour.js b/theme_zap/static/src/js/tour.js index 326b2cb3e..e6f578fc2 100644 --- a/theme_zap/static/src/js/tour.js +++ b/theme_zap/static/src/js/tour.js @@ -29,7 +29,7 @@ const snippets = [ }, ]; -wTourUtils.registerThemeHomepageTour("zap_tour", [ +wTourUtils.registerThemeHomepageTour("zap_tour", () => [ wTourUtils.assertCssVariable('--color-palettes-name', '"zap-1"'), wTourUtils.dragNDrop(snippets[0]), wTourUtils.clickOnText(snippets[0], 'h1', 'top'),