[IMP] test_themes: adapt to website_preview client action
This commit removes the tooltips shown when hovering over a theme in the website switcher dropdown. This feature will be reimplemented later, patching the WebsiteSwitcherSystray component. It also adapts the ?fw= url parameter to force a website id during the tours. task-2687506 closes odoo/design-themes#572 Related: odoo/odoo#89223 Related: odoo/enterprise#28448 Related: odoo/upgrade#3464 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -9,10 +9,10 @@ class Http(models.AbstractModel):
|
|||||||
_inherit = 'ir.http'
|
_inherit = 'ir.http'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _frontend_pre_dispatch(cls):
|
def _pre_dispatch(cls, rule, args):
|
||||||
|
super()._pre_dispatch(rule, args)
|
||||||
|
|
||||||
# Allow public user to use `fw` query string in test mode to ease tests
|
# Allow public user to use `fw` query string in test mode to ease tests
|
||||||
force_website_id = request.httprequest.args.get('fw')
|
force_website_id = request.httprequest.args.get('fw')
|
||||||
if (request.registry.in_test_mode() or tools.config.options['test_enable']) and force_website_id:
|
if (request.registry.in_test_mode() or tools.config.options['test_enable']) and force_website_id:
|
||||||
request.env['website']._force_website(force_website_id)
|
request.env['website']._force_website(force_website_id)
|
||||||
|
|
||||||
super(Http, cls)._frontend_pre_dispatch()
|
|
||||||
|
|||||||
@@ -1,30 +1,33 @@
|
|||||||
odoo.define('test_themes.website_selector', function (require) {
|
// TODO: This will be reimplemented following the frontend UI being moved to
|
||||||
'use strict';
|
// the backend
|
||||||
|
|
||||||
const websiteNavbarData = require('website.navbar');
|
// odoo.define('test_themes.website_selector', function (require) {
|
||||||
const { registry } = require("@web/core/registry");
|
// 'use strict';
|
||||||
|
|
||||||
const TestThemesWebsiteSelector = websiteNavbarData.WebsiteNavbarActionWidget.extend({
|
// const websiteNavbarData = require('website.navbar');
|
||||||
/**
|
// const { registry } = require("@web/core/registry");
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
start: function () {
|
|
||||||
this.$('.js_multi_website_switch[data-toggle]').tooltip({
|
|
||||||
html: true,
|
|
||||||
placement: 'left',
|
|
||||||
delay: {show: 100, hide: 0},
|
|
||||||
});
|
|
||||||
return this._super(...arguments);
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
// const TestThemesWebsiteSelector = websiteNavbarData.WebsiteNavbarActionWidget.extend({
|
||||||
|
// /**
|
||||||
|
// * @override
|
||||||
|
// */
|
||||||
|
// start: function () {
|
||||||
|
// this.$('.js_multi_website_switch[data-toggle]').tooltip({
|
||||||
|
// html: true,
|
||||||
|
// placement: 'left',
|
||||||
|
// delay: {show: 100, hide: 0},
|
||||||
|
// });
|
||||||
|
// return this._super(...arguments);
|
||||||
|
// },
|
||||||
|
|
||||||
registry.category("website_navbar_widgets").add("TestThemesWebsiteSelector", {
|
// });
|
||||||
Widget: TestThemesWebsiteSelector,
|
|
||||||
selector: '#website_switcher',
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
// registry.category("website_navbar_widgets").add("TestThemesWebsiteSelector", {
|
||||||
TestThemesWebsiteSelector: TestThemesWebsiteSelector,
|
// Widget: TestThemesWebsiteSelector,
|
||||||
};
|
// selector: '#website_switcher',
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// TestThemesWebsiteSelector: TestThemesWebsiteSelector,
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
|||||||
@@ -51,4 +51,4 @@ class Crawler(HttpCase):
|
|||||||
Website = self.env['website']
|
Website = self.env['website']
|
||||||
websites_themes = Website.get_test_themes_websites()
|
websites_themes = Website.get_test_themes_websites()
|
||||||
for website in websites_themes:
|
for website in websites_themes:
|
||||||
self.start_tour(f"/?fw={website.id}", 'homepage', login='admin')
|
self.start_tour(f"/web?fw={website.id}", 'homepage', login='admin')
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
<!-- TODO: This will be reimplemented following the frontend UI being moved to the backend -->
|
||||||
<template id="user_navbar" inherit_id="website.user_navbar" name="User Navbar Themes">
|
<!-- <template id="user_navbar" inherit_id="website.user_navbar" name="User Navbar Themes">
|
||||||
<xpath expr="//a[hasclass('js_multi_website_switch')]" position="attributes">
|
<xpath expr="//a[hasclass('js_multi_website_switch')]" position="attributes">
|
||||||
<attribute name="t-att-title">multi_website_website['theme_img']</attribute>
|
<attribute name="t-att-title">multi_website_website['theme_img']</attribute>
|
||||||
<attribute name="data-toggle">tooltip</attribute>
|
<attribute name="data-toggle">tooltip</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template> -->
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user