mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
@@ -373,30 +373,35 @@ ul.auto-toc {
|
||||
<p>This module adds responsiveness to web backend.</p>
|
||||
<p><strong>Features for all devices</strong>:</p>
|
||||
<ul>
|
||||
<li><p class="first">Redirect to the dashboard after logging in. Users will only be
|
||||
redirected to the home page after login if they have enabled the
|
||||
‘Redirect to Home’ option in their profile settings.</p>
|
||||
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/redirecthome.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">New navigation with the fullscreen app menu</p>
|
||||
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/appmenu.gif" /></p>
|
||||
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/appmenu.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">Quick menu search inside the app menu</p>
|
||||
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/appsearch.gif" /></p>
|
||||
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/appsearch.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">Sticky header & footer in list view</p>
|
||||
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/listview.gif" /></p>
|
||||
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/listview.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">Sticky statusbar in form view</p>
|
||||
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/formview.gif" /></p>
|
||||
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/formview.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">Bigger checkboxes in list view</p>
|
||||
<p><img alt="image4" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/listview.gif" /></p>
|
||||
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/listview.gif" /></p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>Features for mobile</strong>: * View type picker dropdown displays
|
||||
comfortably</p>
|
||||
<ul>
|
||||
<li><p class="first">Control panel buttons use icons to save space.</p>
|
||||
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/form_buttons.gif" /></p>
|
||||
<p><img alt="image6" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/form_buttons.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">Followers and send button is displayed on mobile. Avatar is hidden.</p>
|
||||
<p><img alt="image6" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/chatter.png" /></p>
|
||||
<p><img alt="image7" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/chatter.png" /></p>
|
||||
</li>
|
||||
<li><p class="first">Big inputs on form in edit mode</p>
|
||||
</li>
|
||||
@@ -408,20 +413,20 @@ comfortably</p>
|
||||
with Firefox Tab switching. Standard Odoo keyboard hotkeys changed to
|
||||
be more intuitive or accessible by fingers of one hand. F.x. Alt + S
|
||||
for Save</p>
|
||||
<p><img alt="image7" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/shortcuts.gif" /></p>
|
||||
<p><img alt="image8" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/shortcuts.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">Autofocus on search menu box when opening the app menu</p>
|
||||
<p><img alt="image8" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/appsearch.gif" /></p>
|
||||
<p><img alt="image9" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/appsearch.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">When the chatter is on the side part, the document viewer fills that
|
||||
part for side-by-side reading instead of full screen. You can still
|
||||
put it on full width preview clicking on the new maximize button.</p>
|
||||
<p><img alt="image9" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/document_viewer.gif" /></p>
|
||||
<p><img alt="image10" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/document_viewer.gif" /></p>
|
||||
</li>
|
||||
<li><p class="first">When the user chooses to send a public message the color of the
|
||||
composer is different from the one when the message is an internal
|
||||
log.</p>
|
||||
<p><img alt="image10" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/chatter-colors.png" /></p>
|
||||
<p><img alt="image11" src="https://raw.githubusercontent.com/OCA/web/17.0/web_responsive/static/img/chatter-colors.png" /></p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
@@ -490,6 +495,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<li>Sergey Shebanin <<a class="reference external" href="mailto:sergey@shebanin.ru">sergey@shebanin.ru</a>></li>
|
||||
<li>David Vidal <<a class="reference external" href="mailto:david.vidal@tecnativa.com">david.vidal@tecnativa.com</a>></li>
|
||||
<li>Taras Shabaranskyi <<a class="reference external" href="mailto:shabaranskij@gmail.com">shabaranskij@gmail.com</a>></li>
|
||||
<li>Angel Patel <<a class="reference external" href="mailto:patelangel1414@gmail.com">patelangel1414@gmail.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
||||
BIN
web_responsive/static/img/redirecthome.gif
Normal file
BIN
web_responsive/static/img/redirecthome.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 MiB |
@@ -5,7 +5,7 @@
|
||||
* Copyright 2023 Taras Shabaranskyi
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
import {Component, useState} from "@odoo/owl";
|
||||
import {Component, onWillStart, useState} from "@odoo/owl";
|
||||
import {session} from "@web/session";
|
||||
import {useBus, useService} from "@web/core/utils/hooks";
|
||||
import {AppMenuItem} from "@web_responsive/components/apps_menu_item/apps_menu_item.esm";
|
||||
@@ -14,6 +14,7 @@ import {NavBar} from "@web/webclient/navbar/navbar";
|
||||
import {WebClient} from "@web/webclient/webclient";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
import {useHotkey} from "@web/core/hotkeys/hotkey_hook";
|
||||
import {browser} from "@web/core/browser/browser";
|
||||
|
||||
// Patch WebClient to show AppsMenu instead of default app
|
||||
patch(WebClient.prototype, {
|
||||
@@ -22,6 +23,25 @@ patch(WebClient.prototype, {
|
||||
useBus(this.env.bus, "APPS_MENU:STATE_CHANGED", ({detail: state}) => {
|
||||
document.body.classList.toggle("o_apps_menu_opened", state);
|
||||
});
|
||||
this.user = useService("user");
|
||||
onWillStart(async () => {
|
||||
const is_redirect_home = await this.orm.searchRead(
|
||||
"res.users",
|
||||
[["id", "=", this.user.userId]],
|
||||
["is_redirect_home"]
|
||||
);
|
||||
this.env.services.user.updateContext({
|
||||
is_redirect_to_home: is_redirect_home[0].is_redirect_home,
|
||||
});
|
||||
});
|
||||
this.redirect = false;
|
||||
},
|
||||
_loadDefaultApp() {
|
||||
if (this.env.services.user.context.is_redirect_to_home) {
|
||||
this.env.bus.trigger("APPS_MENU:STATE_CHANGED", true);
|
||||
} else {
|
||||
super._loadDefaultApp();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -31,6 +51,12 @@ export class AppsMenu extends Component {
|
||||
this.state = useState({open: false});
|
||||
this.theme = session.apps_menu.theme || "milk";
|
||||
this.menuService = useService("menu");
|
||||
browser.localStorage.setItem("redirect_menuId", "");
|
||||
if (this.env.services.user.context.is_redirect_to_home) {
|
||||
this.router = useService("router");
|
||||
const menuId = Number(this.router.current.hash.menu_id || 0);
|
||||
this.state = useState({open: menuId === 0});
|
||||
}
|
||||
useBus(this.env.bus, "ACTION_MANAGER:UI-UPDATED", () => {
|
||||
this.setOpenState(false);
|
||||
});
|
||||
@@ -106,7 +132,30 @@ export class AppsMenu extends Component {
|
||||
}
|
||||
|
||||
onMenuClick() {
|
||||
this.setOpenState(!this.state.open);
|
||||
if (!this.env.services.user.context.is_redirect_to_home) {
|
||||
this.setOpenState(!this.state.open);
|
||||
} else {
|
||||
const redirect_menuId =
|
||||
browser.localStorage.getItem("redirect_menuId") || "";
|
||||
if (!redirect_menuId) {
|
||||
this.setOpenState(true);
|
||||
} else {
|
||||
this.setOpenState(!this.state.open);
|
||||
}
|
||||
const {href, hash} = location;
|
||||
const menuId = this.router.current.hash.menu_id;
|
||||
if (menuId && menuId != redirect_menuId) {
|
||||
console.log(this.router.current.hash.menu_id);
|
||||
browser.localStorage.setItem(
|
||||
"redirect_menuId",
|
||||
this.router.current.hash.menu_id
|
||||
);
|
||||
}
|
||||
|
||||
if (href.includes(hash)) {
|
||||
window.history.replaceState(null, "", href.replace(hash, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user