Commit [1] fixed the editor not being able to start when clicking on a link that triggers a download. This was caused by the websiteRootInstance being undefined when a page is about to be unloaded (beforeunload). Unfortunately, this event can be canceled. This means that the websiteRootInstance had to be undefined when we are certain that a navigation is going to happen within the iframe. However, the condition introduced by [1] does not take into account multiple factors, which lead to the websiteRootInstance being undefined during edition. This commit fixes that and introduces a test to make sure this behaviour is not easily broken again. Steps to reproduce: - In edit mode, on the Home page, go in the footer and click on any link (except "Contact Us") under "Useful Links" or on the house icon in the Social Media snippet. - Change the footer height with the Height option. => The option is applied correctly (because the link stays on the same page). - Click on "Contact Us" or another Social Media icon. - Try to change the footer height again. => The preview works but when we leave it, we see that the option was not applied. - Drop a snippet and click on it. => Infinite loading. [1]: https://github.com/odoo/odoo/commit/e47a9900e4a7842774d33a332b325e1f08c3ca45 opw-3196324 task-3212501 closes odoo/odoo#114366 X-original-commit: 15a17656b42442b40f4476efe8c985a9ba28ff93 Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com> Signed-off-by: Arthur Detroux (ard) <ard@odoo.com> Co-authored-by: Soukéina Bojabza <sobo@odoo.com>
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import wTourUtils from 'website.tour_utils';
|
|
|
|
const cover = {
|
|
id: 's_cover',
|
|
name: 'Cover',
|
|
};
|
|
|
|
wTourUtils.registerWebsitePreviewTour('website_click_tour', {
|
|
test: true,
|
|
url: '/',
|
|
}, [
|
|
{
|
|
content: "trigger a page navigation",
|
|
trigger: 'iframe a[href="/contactus"]',
|
|
},
|
|
{
|
|
content: "wait for the page to be loaded",
|
|
trigger: '.o_website_preview[data-view-xmlid="website.contactus"]',
|
|
run: () => null, // it's a check
|
|
},
|
|
wTourUtils.clickOnEdit(),
|
|
{
|
|
content: "wait for edition to be started",
|
|
trigger: 'iframe body.editor_enable',
|
|
run: () => null, // it's a check
|
|
},
|
|
{
|
|
content: "click on a link that would trigger navigation",
|
|
trigger: 'iframe a[href="/"]',
|
|
},
|
|
wTourUtils.goBackToBlocks(),
|
|
wTourUtils.dragNDrop(cover),
|
|
wTourUtils.clickOnSnippet(cover),
|
|
...wTourUtils.clickOnSave(),
|
|
{
|
|
content: "wait for the iframe to be ready",
|
|
trigger: 'iframe body:not(.editor_enable)',
|
|
run: () => null, // it's a check
|
|
}
|
|
]);
|