From 9f209c55ee365b4be8838badc99e8718a03c8571 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Mon, 2 Dec 2024 10:45:43 +0100 Subject: [PATCH] [MIG] website_snippet_marginless_gallery: Migration to version 17.0 TT51978 --- .../__manifest__.py | 4 +-- .../website_snippet_marginless_gallery.esm.js | 25 +++++++++++++ .../website_snippet_marginless_gallery.js | 35 ------------------- .../views/snippets.xml | 34 +++++++++--------- 4 files changed, 45 insertions(+), 53 deletions(-) create mode 100644 website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.esm.js delete mode 100644 website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.js diff --git a/website_snippet_marginless_gallery/__manifest__.py b/website_snippet_marginless_gallery/__manifest__.py index 90b07422b9..e683ff6aa5 100644 --- a/website_snippet_marginless_gallery/__manifest__.py +++ b/website_snippet_marginless_gallery/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Marginless Gallery Snippet", "summary": "Add a snippet to have a marginless image gallery", - "version": "15.0.1.0.0", + "version": "17.0.1.0.0", "category": "Website", "license": "LGPL-3", "website": "https://github.com/OCA/website", @@ -18,7 +18,7 @@ "data": ["views/snippets.xml"], "assets": { "web.assets_tests": [ - "/website_snippet_marginless_gallery/static/src/tests/tours/*.js" + "/website_snippet_marginless_gallery/static/src/tests/tours/*.esm.js" ] }, } diff --git a/website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.esm.js b/website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.esm.js new file mode 100644 index 0000000000..7468948f4d --- /dev/null +++ b/website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.esm.js @@ -0,0 +1,25 @@ +/** @odoo-module */ + +/* Copyright 2015-2017 Tecnativa - Jairo Llopis + * Copyright 2019 Tecnativa - Cristina Martin R. + * Copyright 2020 Tecnativa - Alexandre D. Díaz + * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). */ + +import wTourUtils from '@website/js/tours/tour_utils'; + +wTourUtils.registerWebsitePreviewTour( + "marginless_gallery", + { + test: true, + url: "/", + edition: true, + }, + () => [ + wTourUtils.dragNDrop({id: "s_marginless_gallery", name: "Marginless Gallery"}), + wTourUtils.clickOnSnippet({ + id: "marginless-gallery", + name: "Marginless Gallery", + }), + ...wTourUtils.clickOnSave(), + ] +); diff --git a/website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.js b/website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.js deleted file mode 100644 index 0933c5a8a8..0000000000 --- a/website_snippet_marginless_gallery/static/src/tests/tours/website_snippet_marginless_gallery.js +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2015-2017 Tecnativa - Jairo Llopis - * Copyright 2019 Tecnativa - Cristina Martin R. - * Copyright 2020 Tecnativa - Alexandre D. Díaz - * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). */ - -odoo.define("website_snippet_marginless_gallery.tour", function (require) { - "use strict"; - const core = require("web.core"); - const tour = require("web_tour.tour"); - const base = require("web_editor.base"); - - const _t = core._t; - - tour.register( - "marginless_gallery", - { - url: "/", - wait_for: base.ready(), - }, - [ - { - trigger: "a[data-action=edit]", - content: _t("Click Edit to start designing your homepage."), - extra_trigger: ".homepage", - position: "bottom", - }, - { - trigger: "#snippet_feature .oe_snippet:contains('Marginless Gallery')", - content: _t("Drag Marginless Gallery and drop it on the page."), - position: "bottom", - run: "drag_and_drop #wrap", - }, - ] - ); -}); diff --git a/website_snippet_marginless_gallery/views/snippets.xml b/website_snippet_marginless_gallery/views/snippets.xml index 5bfabfb34e..11c94a8630 100644 --- a/website_snippet_marginless_gallery/views/snippets.xml +++ b/website_snippet_marginless_gallery/views/snippets.xml @@ -6,17 +6,19 @@