*: website, test_website Before this commit, the LinkPopoverWidget element was not positioned correctly in mobile edition. With [1] that introduced the website edition using an iframe, the element was appended on the global document, outside of the iframe, so that it was not overlapped by the snippets manipulators (that were also in the global document). But Bootstrap popovers are not meant to be used "on top" of iframes. Bootstrap uses the container's ownerDocument to compute placements, and does not take into account whether or not the target is located inside an iframe (therefore, skipping the iframe's offset and dimensions in the placements computations). This was leading to a visual bug in mobile edition: the iframe top, left values were not computed by the popover, and it was not positioned correctly. Since [2] moved the manipulators inside the iframe, the popover can be initialised using its target ownerDocument body, without being overlapped by the manipulators. Styles are adapted so that the popover stays consistent in the frontend and the backend, and a container option is added to the widget so that the element can be placed with other snippets manipulators from the website builder. [1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b [2]: https://github.com/odoo/odoo/commit/872bb20b3ac08cf82613e15e6634a2e7593ccf7a task-2687506 closes odoo/odoo#103562 X-original-commit: 931d488af0d4dce529e4ea4ab3c8b827bda0d699 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Younn Olivier (yol) <yol@odoo.com>
86 lines
3.1 KiB
JavaScript
86 lines
3.1 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import wTourUtils from 'website.tour_utils';
|
|
|
|
/**
|
|
* The purpose of this tour is to check the link on image flow.
|
|
*/
|
|
|
|
const selectImageSteps = [{
|
|
content: "select block",
|
|
trigger: "iframe #wrapwrap .s_text_image",
|
|
}, {
|
|
content: "check link popover disappeared",
|
|
trigger: "iframe body:not(:has(.o_edit_menu_popover))",
|
|
run: () => {}, // check
|
|
}, {
|
|
content: "select image",
|
|
trigger: "iframe #wrapwrap .s_text_image img",
|
|
}];
|
|
|
|
wTourUtils.registerWebsitePreviewTour('test_image_link', {
|
|
test: true,
|
|
url: '/',
|
|
edition: true,
|
|
}, [
|
|
wTourUtils.dragNDrop({
|
|
id: 's_text_image',
|
|
name: 'Text - Image',
|
|
}),
|
|
...selectImageSteps,
|
|
{
|
|
content: "enable link",
|
|
trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-customizeblock-option:has(we-title:contains(Media)) we-button.fa-link",
|
|
}, {
|
|
content: "enter site URL",
|
|
trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input",
|
|
run: "text odoo.com",
|
|
},
|
|
...selectImageSteps,
|
|
{
|
|
content: "check popover content has site URL",
|
|
trigger: "iframe .o_edit_menu_popover a.o_we_url_link[href='http://odoo.com/']:contains(http://odoo.com/)",
|
|
run: () => {}, // check
|
|
}, {
|
|
content: "remove URL",
|
|
trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input",
|
|
run: "remove_text",
|
|
},
|
|
...selectImageSteps,
|
|
{
|
|
content: "check popover content has no URL",
|
|
trigger: "iframe .o_edit_menu_popover a.o_we_url_link:not([href]):contains(No URL specified)",
|
|
run: () => {}, // check
|
|
}, {
|
|
content: "enter email URL",
|
|
trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input",
|
|
run: "text mailto:test@test.com",
|
|
},
|
|
...selectImageSteps,
|
|
{
|
|
content: "check popover content has mail URL",
|
|
trigger: "iframe .o_edit_menu_popover:has(.fa-envelope-o) a.o_we_url_link[href='mailto:test@test.com']:contains(mailto:test@test.com)",
|
|
run: () => {}, // check
|
|
}, {
|
|
content: "enter phone URL",
|
|
trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input",
|
|
run: "text tel:555-2368",
|
|
},
|
|
...selectImageSteps,
|
|
{
|
|
content: "check popover content has phone URL",
|
|
trigger: "iframe .o_edit_menu_popover:has(.fa-phone) a.o_we_url_link[href='tel:555-2368']:contains(tel:555-2368)",
|
|
run: () => {}, // check
|
|
}, {
|
|
content: "remove URL",
|
|
trigger: "#oe_snippets we-customizeblock-options:has(we-title:contains('Image')) we-input:contains(Your URL) input",
|
|
run: "remove_text",
|
|
},
|
|
...selectImageSteps,
|
|
{
|
|
content: "check popover content has no URL",
|
|
trigger: "iframe .o_edit_menu_popover a.o_we_url_link:not([href]):contains(No URL specified)",
|
|
run: () => {}, // check
|
|
},
|
|
]);
|