From e0cc28dcee977c4aa0c6a7e4ff6c463ab12e55a2 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 26 Oct 2020 14:51:38 +0000 Subject: [FIX] web_editor, website, *: improve post install theme and start tour Before this commit, once you install website_* module, the ir.actions.todo from the installed module was overidded by the 'choose a theme' action. Now, when we consume this ir_act_todo, we re-open the open_menu that contains most of the time the expected next action from new module installed. Since we can also install module from the '+ new' button, in frontend, we considere that it first step of tour is to click on it, it is already done and we skip it. Install website_event Before: -> not redirected to /event (the ir.action.todo) -> no tour, if you don't click manually on '+ new' After: -> you are redirected to /event -> you can launch tour from '+ new' if you are already on the new panel, start direclty to the second step 'create event' --- addons/website/static/src/js/menu/new_content.js | 10 ++++++++++ addons/website/static/src/js/tours/homepage.js | 1 + 2 files changed, 11 insertions(+) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/menu/new_content.js b/addons/website/static/src/js/menu/new_content.js index e52801bd123..13de4a27794 100644 --- a/addons/website/static/src/js/menu/new_content.js +++ b/addons/website/static/src/js/menu/new_content.js @@ -5,6 +5,7 @@ var core = require('web.core'); var Dialog = require('web.Dialog'); var websiteNavbarData = require('website.navbar'); var wUtils = require('website.utils'); +var tour = require('web_tour.tour'); var qweb = core.qweb; var _t = core._t; @@ -56,6 +57,15 @@ var NewContentMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ this.$lastLink = this.$newContentMenuChoices.find('a:last'); if ($.deparam.querystring()[enableFlag] !== undefined) { + Object.keys(tour.tours).forEach( + el => { + let element = tour.tours[el]; + if (element.steps[0].trigger == '#new-content-menu > a' + && !element.steps[0].extra_trigger) { + element.steps[0].auto = true; + } + } + ); this._showMenu(); } return this._super.apply(this, arguments); diff --git a/addons/website/static/src/js/tours/homepage.js b/addons/website/static/src/js/tours/homepage.js index f7da2401ed1..56d40a0d42e 100644 --- a/addons/website/static/src/js/tours/homepage.js +++ b/addons/website/static/src/js/tours/homepage.js @@ -8,6 +8,7 @@ var _t = core._t; tour.register("homepage", { url: "/", + sequence: 1010, }, [{ trigger: "a[data-action=edit]", content: _t("Click Edit to start designing your homepage."), -- cgit v1.2.3