[IMP] show AppsMenu by default after login

also redirect to backend from website AppsMenu
This commit is contained in:
Sergey Shebanin
2021-11-03 16:14:25 +03:00
parent 310c7156f4
commit a9daa2aea7
5 changed files with 126 additions and 0 deletions

View File

@@ -10,10 +10,34 @@ import {useHotkey} from "@web/core/hotkeys/hotkey_hook";
import {scrollTo} from "@web/core/utils/scrolling";
import {debounce} from "@web/core/utils/timing";
import {fuzzyLookup} from "@web/core/utils/search";
import {WebClient} from "@web/webclient/webclient";
import {patch} from "web.utils";
const {Component} = owl;
const {useState, useRef} = owl.hooks;
// Patch WebClient to show AppsMenu instead of default app
patch(WebClient.prototype, "web_responsive.DefaultAppsMenu", {
setup() {
this._super();
useBus(Dropdown.bus, "state-changed", (payload) => {
if (payload.emitter.el.classList.contains("o_navbar_apps_menu")) {
this.el.classList.toggle("o_apps_menu_opened", payload.newState.open);
this.el.classList.toggle("o_first_app", false);
}
});
},
_loadDefaultApp() {
var menu_apps_dropdown = document.querySelector(
".o_navbar_apps_menu .dropdown-toggle"
);
menu_apps_dropdown.click();
this.el.classList.toggle("o_apps_menu_opened", true);
this.el.classList.toggle("o_first_app", true);
return true;
},
});
/**
* @extends Dropdown
*/