mirror of
https://github.com/odoo/design-themes.git
synced 2025-10-07 01:18:52 +07:00
e50cc5032b
This adapts the WebsiteSwitcherSystray's DropdownItem tooltips dataset to the changed API brought in the community repository. closes odoo/design-themes#765 Task: 3266145 Related: odoo/enterprise#48452 Related: odoo/odoo#137691 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import { patch } from "@web/core/utils/patch";
|
|
import { useService } from '@web/core/utils/hooks';
|
|
import { WebsiteSwitcherSystray } from '@website/systray_items/website_switcher';
|
|
import { onMounted, useState } from "@odoo/owl";
|
|
|
|
patch(WebsiteSwitcherSystray.prototype, {
|
|
setup() {
|
|
super.setup();
|
|
|
|
this.orm = useService('orm');
|
|
this.tooltips = useState({});
|
|
// Disable the notification service to avoid having a notification for each theme.
|
|
this.notificationService = { add: () => () => null };
|
|
|
|
onMounted(async () => {
|
|
const themesWebsites = await this.orm.call('website', 'get_test_themes_websites_theme_preview');
|
|
for (const themeId in themesWebsites) {
|
|
this.tooltips[themeId] = {
|
|
"data-tooltip-template": 'test_themes.ThemeTooltip',
|
|
"data-tooltip-position": 'left',
|
|
"data-tooltip-delay": 100,
|
|
"data-tooltip-info": JSON.stringify({url: themesWebsites[themeId]}),
|
|
};
|
|
}
|
|
});
|
|
},
|
|
template: 'test_themes.WebsiteSwitcherSystray',
|
|
});
|