mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
fix issue with navbar in home menu with no active app
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div t-name="web.navbar" class="o_navbar" t-att-class="props.inHome ? 'o_navbar o_in_home' : 'o_navbar'">
|
<div t-name="web.navbar" class="o_navbar" t-att-class="props.inHome ? 'o_navbar o_in_home' : 'o_navbar'">
|
||||||
<a aria-label="Applications" t-att-class="props.inHome ? 'o_title fa fa-chevron-left' : 'o_title fa fa-th'" href="#" title="Applications" accesskey="h" t-on-click="toggleHome"/>
|
<a aria-label="Applications" t-if="!props.inHome || props.app" t-att-class="props.inHome ? 'o_title fa fa-chevron-left' : 'o_title fa fa-th'" href="#" title="Applications" accesskey="h" t-on-click="toggleHome"/>
|
||||||
<t t-if="!props.inHome && props.app">
|
<t t-if="!props.inHome && props.app">
|
||||||
<a class="o_menu_brand" t-att-href="getUrl(props.app)" role="button" t-on-click="openMenu(props.app)">
|
<a class="o_menu_brand" t-att-href="getUrl(props.app)" role="button" t-on-click="openMenu(props.app)">
|
||||||
<t t-esc="props.app.name"/>
|
<t t-esc="props.app.name"/>
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`can be rendered 1`] = `
|
exports[`can be rendered (in home menu, no app) 1`] = `
|
||||||
"<div class=\\"o_navbar\\">
|
"<div class=\\"o_navbar o_in_home\\">
|
||||||
<a aria-label=\\"Applications\\" class=\\"o_title fa fa-th\\" href=\\"#\\" title=\\"Applications\\" accesskey=\\"h\\"></a>
|
|
||||||
|
|
||||||
|
</div>"
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`can be rendered (in home menu, one active app) 1`] = `
|
||||||
|
"<div class=\\"o_navbar o_in_home\\">
|
||||||
|
<a aria-label=\\"Applications\\" class=\\"o_title fa fa-chevron-left\\" href=\\"#\\" title=\\"Applications\\" accesskey=\\"h\\"></a>
|
||||||
|
|
||||||
</div>"
|
</div>"
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
exports[`can be rendered (in home menu) 1`] = `
|
exports[`can be rendered (in home menu) 1`] = `
|
||||||
"<div class=\\"o_web_client\\">
|
"<div class=\\"o_web_client\\">
|
||||||
<div class=\\"o_navbar o_in_home\\">
|
<div class=\\"o_navbar o_in_home\\">
|
||||||
<a aria-label=\\"Applications\\" class=\\"o_title fa fa-chevron-left\\" href=\\"#\\" title=\\"Applications\\" accesskey=\\"h\\"></a>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,15 @@ afterEach(() => {
|
|||||||
// Tests
|
// Tests
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
test("can be rendered", async () => {
|
test("can be rendered (in home menu, no app)", async () => {
|
||||||
|
props.inHome = true;
|
||||||
|
const navbar = new Navbar(env, props);
|
||||||
|
await navbar.mount(fixture);
|
||||||
|
expect(fixture.innerHTML).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("can be rendered (in home menu, one active app)", async () => {
|
||||||
|
props = { inHome: true, app: menuInfo.menus[96]! };
|
||||||
const navbar = new Navbar(env, props);
|
const navbar = new Navbar(env, props);
|
||||||
await navbar.mount(fixture);
|
await navbar.mount(fixture);
|
||||||
expect(fixture.innerHTML).toMatchSnapshot();
|
expect(fixture.innerHTML).toMatchSnapshot();
|
||||||
|
|||||||
Reference in New Issue
Block a user