diff --git a/website_mass_mailing_name/__manifest__.py b/website_mass_mailing_name/__manifest__.py
index 019fc542..9a4316ed 100644
--- a/website_mass_mailing_name/__manifest__.py
+++ b/website_mass_mailing_name/__manifest__.py
@@ -4,9 +4,9 @@
{
"name": "Mass Mailing Subscription Snippet With Name",
"summary": "Ask for name when subscribing, and create and/or link partner",
- "version": "10.0.1.0.0",
+ "version": "10.0.1.0.1",
"category": "Website",
- "website": "https://tecnativa.com/",
+ "website": "https://github.com/OCA/social",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
diff --git a/website_mass_mailing_name/demo/assets.xml b/website_mass_mailing_name/demo/assets.xml
index b569efc6..68ff1c75 100644
--- a/website_mass_mailing_name/demo/assets.xml
+++ b/website_mass_mailing_name/demo/assets.xml
@@ -8,9 +8,7 @@
inherit_id="website.assets_frontend">
-
+ src="/website_mass_mailing_name/static/src/js/editor_and_public_tour.js"/>
diff --git a/website_mass_mailing_name/static/src/js/public_tour.js b/website_mass_mailing_name/static/src/js/editor_and_public_tour.js
similarity index 58%
rename from website_mass_mailing_name/static/src/js/public_tour.js
rename to website_mass_mailing_name/static/src/js/editor_and_public_tour.js
index 6236747b..c13b2268 100644
--- a/website_mass_mailing_name/static/src/js/public_tour.js
+++ b/website_mass_mailing_name/static/src/js/editor_and_public_tour.js
@@ -1,19 +1,60 @@
/* Copyright 2016-2017 Jairo Llopis
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
-odoo.define("website_mass_mailing_name.public_tour", function (require) {
+odoo.define("website_mass_mailing_name.editor_and_public_tour", function (require) {
"use strict";
var base = require("web_editor.base");
var tour = require("web_tour.tour");
tour.register(
- "mass_mailing_name_public",
+ "mass_mailing_name_editor_and_public",
{
test: true,
wait_for: base.ready(),
},
[
+ // Admin edits home page and adds subscription snippet
+ {
+ content: "Edit the homepage",
+ trigger: ".o_menu_systray a[data-action=edit]",
+ },
+ {
+ content: "Drag and drop a text snippet",
+ trigger: ".oe_snippet[name='Text Block'] .oe_snippet_thumbnail",
+ run: "drag_and_drop #wrap",
+ },
+ {
+ content: "Drag and drop a newsletter snippet",
+ trigger: ".oe_snippet[name='Newsletter'] .oe_snippet_thumbnail",
+ run: "drag_and_drop #wrap .s_text_block",
+ },
+ {
+ content: "Let the default mailing list",
+ trigger: ".modal-dialog button:contains('Continue')",
+ },
+ {
+ content: "Save changes",
+ extra_trigger: "body:not(:has(.modal:visible))",
+ trigger: "#web_editor-top-edit button[data-action=save]",
+ },
+ {
+ content: "Subscribe Administrator",
+ extra_trigger: "body:not(:has(#web_editor-top-edit))",
+ trigger: ".js_subscribe_btn",
+ },
+ // Log out
+ {
+ content: "Open user menu",
+ extra_trigger: ".js_subscribe .alert-success",
+ trigger: "#top_menu span:contains('Administrator')",
+ },
+ {
+ content: "Logout",
+ trigger: "#o_logout a",
+ },
+ // Now use the widget as a random public user
{
content: "Try to subscribe without data",
+ extra_trigger: "a:contains('Sign in')",
trigger: ".js_subscribe_btn",
},
{
diff --git a/website_mass_mailing_name/static/src/js/editor_tour.js b/website_mass_mailing_name/static/src/js/editor_tour.js
deleted file mode 100644
index b6fe1c95..00000000
--- a/website_mass_mailing_name/static/src/js/editor_tour.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright 2016-2017 Jairo Llopis
- * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
-odoo.define("website_mass_mailing_name.editor_tour", function (require) {
- "use strict";
- var base = require("web_editor.base");
- var tour = require("web_tour.tour");
-
- tour.register(
- "mass_mailing_name_editor",
- {
- test: true,
- wait_for: base.ready(),
- },
- [
- {
- content: "Edit the homepage",
- trigger: ".o_menu_systray a[data-action=edit]",
- },
- {
- content: "Drag and drop a text snippet",
- trigger: ".oe_snippet[name='Text Block'] .oe_snippet_thumbnail",
- run: "drag_and_drop #wrap",
- },
- {
- content: "Drag and drop a newsletter snippet",
- trigger: ".oe_snippet[name='Newsletter'] .oe_snippet_thumbnail",
- run: "drag_and_drop #wrap .s_text_block",
- },
- {
- content: "Let the default mailing list",
- trigger: ".modal-dialog button:contains('Continue')",
- },
- {
- content: "Save changes",
- extra_trigger: "body:not(:has(.modal:visible))",
- trigger: "#web_editor-top-edit button[data-action=save]",
- },
- {
- content: "Subscribe Administrator",
- extra_trigger: "body:not(:has(#web_editor-top-edit))",
- trigger: ".js_subscribe_btn",
- },
- {
- content: "Open user menu",
- extra_trigger: ".js_subscribe .alert-success",
- trigger: "#top_menu span:contains('Administrator')",
- },
- ]
- );
-});
diff --git a/website_mass_mailing_name/tests/test_ui.py b/website_mass_mailing_name/tests/test_ui.py
index f0ad2105..abc51dba 100644
--- a/website_mass_mailing_name/tests/test_ui.py
+++ b/website_mass_mailing_name/tests/test_ui.py
@@ -2,24 +2,14 @@
# Copyright 2016-2017 Jairo Llopis
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
-from odoo.http import root
from odoo.tests.common import HttpCase
class UICase(HttpCase):
def test_ui(self):
"""Test snippet behavior."""
- tour = "odoo.__DEBUG__.services['web_tour.tour'].%s"
- # Admin edits home page and adds subscription snippet
- self.phantom_js(
- "/",
- tour % "run('mass_mailing_name_editor')",
- tour % "tours.mass_mailing_name_editor.ready",
- login="admin")
- # Forced log out
- root.session_store.delete(self.session)
- # Public user uses subscription snippet
- self.phantom_js(
- "/",
- tour % "run('mass_mailing_name_public')",
- tour % "tours.mass_mailing_name_public.ready")
+ base = "odoo.__DEBUG__.services['web_tour.tour'].%s"
+ run = base % "run('%s')"
+ ready = base % "tours.%s.ready"
+ tour = "mass_mailing_name_editor_and_public"
+ self.phantom_js("/", run % tour, ready % tour, login="admin")