diff --git a/web_responsive/README.rst b/web_responsive/README.rst
index a07297d60..00261a274 100644
--- a/web_responsive/README.rst
+++ b/web_responsive/README.rst
@@ -14,13 +14,13 @@ Web Responsive
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
- :target: https://github.com/OCA/web/tree/15.0/web_responsive
+ :target: https://github.com/OCA/web/tree/16.0/web_responsive
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_responsive
+ :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_responsive
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/162/15.0
+ :target: https://runbot.odoo-community.org/runbot/162/16.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -31,83 +31,83 @@ This module adds responsiveness to web backend.
* New navigation with the fullscreen app menu
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/appmenu.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/appmenu.gif
* Quick menu search inside the app menu
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/appsearch.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/appsearch.gif
* Sticky header & footer in list view
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/listview.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/listview.gif
* Sticky statusbar in form view
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/formview.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/formview.gif
* Bigger checkboxes in list view
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/listview.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/listview.gif
* Increase the size of the labels in extra large screens
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/label_size_small.png
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/label_size_small.png
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/label_size_large.png
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/label_size_large.png
**Features for mobile**:
* App-specific submenus are shown on full screen when toggling them from the
"hamburger" menu
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/hamburger.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/hamburger.gif
* User-specific submenus are shown on full screen when toggling them from the
"avatar" menu
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/usermenu.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/usermenu.gif
* View type picker dropdown displays comfortably
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/viewtype.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/viewtype.gif
* Top app bar is always visible, but the control panel is hidden when
scrolling down, to save some valuable vertical space
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/navbar.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/navbar.gif
* Form status bar action and status buttons are collapsed in dropdowns.
Other control panel buttons use icons to save space.
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/form_buttons.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/form_buttons.gif
* Breadcrumbs navigation is collapsed with a "back arrow" button.
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/breadcrumbs.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/breadcrumbs.gif
* Search panel is collapsed to mobile version on small screens.
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/search_panel.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/search_panel.gif
* Followers and send button is displayed on mobile. Avatar is hidden.
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/chatter.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/chatter.gif
* Scrollable dropdowns
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/dropdown_scroll.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/dropdown_scroll.gif
* Kanban interface adopted to mobile
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/kanban.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/kanban.gif
* Calendar interface adopted to mobile
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/calendar.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/calendar.gif
* Interface is adapted dynamically on device rotation
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/device_rotation.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/device_rotation.gif
* Big inputs on form in edit mode
@@ -120,29 +120,29 @@ This module adds responsiveness to web backend.
accessible by fingers of one hand.
F.x. `Alt + S` for `Save`
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/shortcuts.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/shortcuts.gif
* Autofocus on search menu box when opening the app menu
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/appsearch.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/appsearch.gif
* Full width form sheets
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/formview.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/formview.gif
* Set chatter on the side of the screen, optional per user
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/chatter_sided.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/chatter_sided.gif
* Sticky chatter topbar
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/chatter_topbar.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/chatter_topbar.gif
* When the chatter is configured 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.
- .. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_responsive/static/img/document_viewer.gif
+ .. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_responsive/static/img/document_viewer.gif
**Table of contents**
@@ -170,7 +170,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -223,6 +223,6 @@ Current `maintainers `__:
|maintainer-Yajo| |maintainer-Tardo| |maintainer-SplashS|
-This module is part of the `OCA/web `_ project on GitHub.
+This module is part of the `OCA/web `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/web_responsive/__init__.py b/web_responsive/__init__.py
index 0650744f6..e69de29bb 100644
--- a/web_responsive/__init__.py
+++ b/web_responsive/__init__.py
@@ -1 +0,0 @@
-from . import models
diff --git a/web_responsive/__manifest__.py b/web_responsive/__manifest__.py
index befa094e3..482a018e6 100644
--- a/web_responsive/__manifest__.py
+++ b/web_responsive/__manifest__.py
@@ -2,52 +2,47 @@
# Copyright 2017-2018 Tecnativa - Jairo Llopis
# Copyright 2018-2019 Tecnativa - Alexandre Díaz
# Copyright 2021 ITerra - Sergey Shebanin
+# Copyright 2023 Onestein - Anjeel Haria
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Web Responsive",
"summary": "Responsive web client, community-supported",
- "version": "15.0.1.1.6",
+ "version": "16.0.1.0.0",
"category": "Website",
"website": "https://github.com/OCA/web",
- "author": "LasLabs, Tecnativa, ITerra, " "Odoo Community Association (OCA)",
+ "author": "LasLabs, Tecnativa, ITerra, Onestein, "
+ "Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": True,
"depends": ["web", "mail"],
"development_status": "Production/Stable",
"maintainers": ["Yajo", "Tardo", "SplashS"],
"excludes": ["web_enterprise"],
- "data": ["views/res_users.xml", "views/web.xml"],
+ "data": ["views/web.xml"],
"assets": {
- "web.assets_frontend": [
- "/web_responsive/static/src/legacy/js/website_apps_menu.js",
- "/web_responsive/static/src/legacy/scss/website_apps_menu.scss",
- ],
"web.assets_backend": [
+ "/web_responsive/static/src/views/form/form_controller.esm.js",
"/web_responsive/static/src/legacy/scss/web_responsive.scss",
"/web_responsive/static/src/legacy/js/web_responsive.js",
- "/web_responsive/static/src/legacy/scss/kanban_view_mobile.scss",
- "/web_responsive/static/src/legacy/js/kanban_renderer_mobile.js",
"/web_responsive/static/src/components/ui_context.esm.js",
"/web_responsive/static/src/components/apps_menu/apps_menu.scss",
"/web_responsive/static/src/components/apps_menu/apps_menu.esm.js",
- "/web_responsive/static/src/components/navbar/main_navbar.scss",
"/web_responsive/static/src/components/control_panel/control_panel.scss",
"/web_responsive/static/src/components/control_panel/control_panel.esm.js",
"/web_responsive/static/src/components/search_panel/search_panel.scss",
"/web_responsive/static/src/components/search_panel/search_panel.esm.js",
- "/web_responsive/static/src/components/attachment_viewer/attachment_viewer.scss",
- "/web_responsive/static/src/components/attachment_viewer/attachment_viewer.esm.js",
"/web_responsive/static/src/components/hotkey/hotkey.scss",
- ],
- "web.assets_qweb": [
"/web_responsive/static/src/legacy/xml/form_buttons.xml",
"/web_responsive/static/src/components/apps_menu/apps_menu.xml",
"/web_responsive/static/src/components/control_panel/control_panel.xml",
- "/web_responsive/static/src/components/navbar/main_navbar.xml",
"/web_responsive/static/src/components/search_panel/search_panel.xml",
- "/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml",
"/web_responsive/static/src/components/hotkey/hotkey.xml",
+ "/web_responsive/static/src/components/chatter_topbar/chatter_topbar.esm.js",
+ "/web_responsive/static/src/components/chatter_topbar/chatter_topbar.xml",
+ "/web_responsive/static/src/components/attachment_viewer/attachment_viewer.scss",
+ "/web_responsive/static/src/components/attachment_viewer/attachment_viewer.esm.js",
+ "/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml",
],
"web.assets_tests": [
"/web_responsive/static/tests/test_patch.js",
diff --git a/web_responsive/models/__init__.py b/web_responsive/models/__init__.py
deleted file mode 100644
index 883516533..000000000
--- a/web_responsive/models/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from . import res_users
diff --git a/web_responsive/models/res_users.py b/web_responsive/models/res_users.py
deleted file mode 100644
index ef1fc947c..000000000
--- a/web_responsive/models/res_users.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2018-2019 Alexandre Díaz
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-
-from odoo import fields, models
-
-
-class ResUsers(models.Model):
- _inherit = "res.users"
-
- chatter_position = fields.Selection(
- [("normal", "Normal"), ("sided", "Sided")],
- default="sided",
- )
-
- """Override to add access rights.
- Access rights are disabled by default, but allowed on some specific
- fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
- """
-
- @property
- def SELF_READABLE_FIELDS(self):
- return super().SELF_READABLE_FIELDS + ["chatter_position"]
-
- @property
- def SELF_WRITEABLE_FIELDS(self):
- return super().SELF_WRITEABLE_FIELDS + ["chatter_position"]
diff --git a/web_responsive/readme/CONTRIBUTORS.rst b/web_responsive/readme/CONTRIBUTORS.rst
index ca52594ac..a28b2f384 100644
--- a/web_responsive/readme/CONTRIBUTORS.rst
+++ b/web_responsive/readme/CONTRIBUTORS.rst
@@ -1,6 +1,8 @@
* Dave Lasley
* Jairo Llopis
-* Dennis Sluijk
+* `Onestein `_:
+ * Dennis Sluijk
+ * Anjeel Haria
* Sergio Teruel
* Alexandre Díaz
* Mathias Markl
diff --git a/web_responsive/readme/DESCRIPTION.rst b/web_responsive/readme/DESCRIPTION.rst
index e4b6960d7..9012daa13 100644
--- a/web_responsive/readme/DESCRIPTION.rst
+++ b/web_responsive/readme/DESCRIPTION.rst
@@ -22,42 +22,16 @@ This module adds responsiveness to web backend.
.. image:: ../static/img/listview.gif
-* Increase the size of the labels in extra large screens
-
- .. image:: ../static/img/label_size_small.png
-
- .. image:: ../static/img/label_size_large.png
**Features for mobile**:
-
-* App-specific submenus are shown on full screen when toggling them from the
- "hamburger" menu
-
- .. image:: ../static/img/hamburger.gif
-
-* User-specific submenus are shown on full screen when toggling them from the
- "avatar" menu
-
- .. image:: ../static/img/usermenu.gif
-
* View type picker dropdown displays comfortably
.. image:: ../static/img/viewtype.gif
-* Top app bar is always visible, but the control panel is hidden when
- scrolling down, to save some valuable vertical space
-
- .. image:: ../static/img/navbar.gif
-
-* Form status bar action and status buttons are collapsed in dropdowns.
- Other control panel buttons use icons to save space.
+* Control panel buttons use icons to save space.
.. image:: ../static/img/form_buttons.gif
-* Breadcrumbs navigation is collapsed with a "back arrow" button.
-
- .. image:: ../static/img/breadcrumbs.gif
-
* Search panel is collapsed to mobile version on small screens.
.. image:: ../static/img/search_panel.gif
@@ -66,22 +40,6 @@ This module adds responsiveness to web backend.
.. image:: ../static/img/chatter.gif
-* Scrollable dropdowns
-
- .. image:: ../static/img/dropdown_scroll.gif
-
-* Kanban interface adopted to mobile
-
- .. image:: ../static/img/kanban.gif
-
-* Calendar interface adopted to mobile
-
- .. image:: ../static/img/calendar.gif
-
-* Interface is adapted dynamically on device rotation
-
- .. image:: ../static/img/device_rotation.gif
-
* Big inputs on form in edit mode
**Features for desktop computers**:
@@ -103,15 +61,7 @@ This module adds responsiveness to web backend.
.. image:: ../static/img/formview.gif
-* Set chatter on the side of the screen, optional per user
-
- .. image:: ../static/img/chatter_sided.gif
-
-* Sticky chatter topbar
-
- .. image:: ../static/img/chatter_topbar.gif
-
-* When the chatter is configured on the side part, the document viewer fills that
+* 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.
diff --git a/web_responsive/static/description/index.html b/web_responsive/static/description/index.html
index 780ecebc1..2416f33f6 100644
--- a/web_responsive/static/description/index.html
+++ b/web_responsive/static/description/index.html
@@ -367,71 +367,40 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module adds responsiveness to web backend.
Features for all devices:
Features for mobile:
-App-specific submenus are shown on full screen when toggling them from the
-“hamburger” menu
-
-
-User-specific submenus are shown on full screen when toggling them from the
-“avatar” menu
-
-
View type picker dropdown displays comfortably
-
+
-Top app bar is always visible, but the control panel is hidden when
-scrolling down, to save some valuable vertical space
-
-
-Form status bar action and status buttons are collapsed in dropdowns.
-Other control panel buttons use icons to save space.
-
-
-Breadcrumbs navigation is collapsed with a “back arrow” button.
-
+Control panel buttons use icons to save space.
+
+
Search panel is collapsed to mobile version on small screens.
-
+
Followers and send button is displayed on mobile. Avatar is hidden.
-
-
-Scrollable dropdowns
-
-
-Kanban interface adopted to mobile
-
-
-Calendar interface adopted to mobile
-
-
-Interface is adapted dynamically on device rotation
-
+
Big inputs on form in edit mode
@@ -444,21 +413,18 @@ just Alt + [NUM] to avoid conflict 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
-
+
Autofocus on search menu box when opening the app menu
-
+
Full width form sheets
-
-
-Set chatter on the side of the screen, optional per user
-
+
Sticky chatter topbar
-
+
-When the chatter is configured on the side part, the document viewer fills that
+
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.
@@ -499,7 +465,7 @@ width preview clicking on the new maximize button.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
diff --git a/web_responsive/static/img/appsearch.gif b/web_responsive/static/img/appsearch.gif
index 06592fefa..4817916b3 100644
Binary files a/web_responsive/static/img/appsearch.gif and b/web_responsive/static/img/appsearch.gif differ
diff --git a/web_responsive/static/img/calendar.gif b/web_responsive/static/img/calendar.gif
index 73a5c1aff..6168e1919 100644
Binary files a/web_responsive/static/img/calendar.gif and b/web_responsive/static/img/calendar.gif differ
diff --git a/web_responsive/static/img/default_icon_app.png b/web_responsive/static/img/default_icon_app.png
new file mode 100644
index 000000000..8fc87e959
Binary files /dev/null and b/web_responsive/static/img/default_icon_app.png differ
diff --git a/web_responsive/static/img/kanban.gif b/web_responsive/static/img/kanban.gif
index 777e89ced..217ac0d15 100644
Binary files a/web_responsive/static/img/kanban.gif and b/web_responsive/static/img/kanban.gif differ
diff --git a/web_responsive/static/src/components/apps_menu/apps_menu.esm.js b/web_responsive/static/src/components/apps_menu/apps_menu.esm.js
index 7b95bd836..0b74a6eec 100644
--- a/web_responsive/static/src/components/apps_menu/apps_menu.esm.js
+++ b/web_responsive/static/src/components/apps_menu/apps_menu.esm.js
@@ -1,6 +1,7 @@
/** @odoo-module **/
/* Copyright 2018 Tecnativa - Jairo Llopis
* Copyright 2021 ITerra - Sergey Shebanin
+ * Copyright 2023 Onestein - Anjeel Haria
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
import {NavBar} from "@web/webclient/navbar/navbar";
@@ -11,16 +12,16 @@ 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";
+import {escapeRegExp} from "@web/core/utils/strings";
-const {Component} = owl;
-const {useState, useRef} = owl.hooks;
+const {Component, useState, onPatched, onWillPatch} = owl;
// Patch WebClient to show AppsMenu instead of default app
patch(WebClient.prototype, "web_responsive.DefaultAppsMenu", {
setup() {
this._super();
- useBus(this.env.bus, "APPS_MENU:STATE_CHANGED", (payload) => {
- this.el.classList.toggle("o_apps_menu_opened", payload);
+ useBus(this.env.bus, "APPS_MENU:STATE_CHANGED", ({detail: state}) => {
+ document.body.classList.toggle("o_apps_menu_opened", state);
});
},
});
@@ -32,16 +33,96 @@ export class AppsMenu extends Component {
setup() {
super.setup();
this.state = useState({open: false});
+ this.menuService = useService("menu");
useBus(this.env.bus, "ACTION_MANAGER:UI-UPDATED", () => {
- this.setState(false);
+ this.setOpenState(false, false);
});
- useBus(this.env.bus, "APPS_MENU:CLOSE", () => {
- this.setState(false);
+ this._setupKeyNavigation();
+ }
+ setOpenState(open_state, from_home_menu_click) {
+ this.state.open = open_state;
+ // Load home page with proper systray when opening it from website
+ if (from_home_menu_click) {
+ var currentapp = this.menuService.getCurrentApp();
+ if (currentapp && currentapp.name == "Website") {
+ if (window.location.pathname != "/web") {
+ const icon = $(
+ document.querySelector(".o_navbar_apps_menu button > i")
+ );
+ icon.removeClass("fa fa-th-large").append(
+ $("", {class: "fa fa-spin fa-spinner"})
+ );
+ }
+ window.location.href = "/web#home";
+ } else {
+ this.env.bus.trigger("APPS_MENU:STATE_CHANGED", open_state);
+ }
+ } else {
+ this.env.bus.trigger("APPS_MENU:STATE_CHANGED", open_state);
+ }
+ }
+
+ /**
+ * Setup navigation among app menus
+ */
+ _setupKeyNavigation() {
+ const repeatable = {
+ allowRepeat: true,
+ };
+ useHotkey(
+ "ArrowRight",
+ () => {
+ this._onWindowKeydown("next");
+ },
+ repeatable
+ );
+ useHotkey(
+ "ArrowLeft",
+ () => {
+ this._onWindowKeydown("prev");
+ },
+ repeatable
+ );
+ useHotkey(
+ "ArrowDown",
+ () => {
+ this._onWindowKeydown("next");
+ },
+ repeatable
+ );
+ useHotkey(
+ "ArrowUp",
+ () => {
+ this._onWindowKeydown("prev");
+ },
+ repeatable
+ );
+ useHotkey("Escape", () => {
+ this.env.bus.trigger("ACTION_MANAGER:UI-UPDATED");
});
}
- setState(state) {
- this.state.open = state;
- this.env.bus.trigger("APPS_MENU:STATE_CHANGED", state);
+
+ _onWindowKeydown(direction) {
+ const focusableInputElements = document.querySelectorAll(`.o_app`);
+ if (focusableInputElements.length) {
+ const focusable = [...focusableInputElements];
+ const index = focusable.indexOf(document.activeElement);
+ let nextIndex = 0;
+ if (direction == "prev" && index >= 0) {
+ if (index > 0) {
+ nextIndex = index - 1;
+ } else {
+ nextIndex = focusable.length - 1;
+ }
+ } else if (direction == "next") {
+ if (index + 1 < focusable.length) {
+ nextIndex = index + 1;
+ } else {
+ nextIndex = 0;
+ }
+ }
+ focusableInputElements[nextIndex].focus();
+ }
}
}
@@ -86,6 +167,16 @@ export class AppsMenu extends Component {
*/
function findNames(memo, menu) {
if (menu.actionID) {
+ var result = "";
+ if (menu.webIconData) {
+ const prefix = menu.webIconData.startsWith("P")
+ ? "data:image/svg+xml;base64,"
+ : "data:image/png;base64,";
+ result = menu.webIconData.startsWith("data:image")
+ ? menu.webIconData
+ : prefix + menu.webIconData.replace(/\s/g, "");
+ }
+ menu.webIconData = result;
memo[menu.name.trim()] = menu;
}
if (menu.childrenTree) {
@@ -108,8 +199,7 @@ export class AppsMenuSearchBar extends Component {
offset: 0,
hasResults: false,
});
- useAutofocus({selector: "input"});
- this.searchBarInput = useRef("SearchBarInput");
+ this.searchBarInput = useAutofocus({refName: "SearchBarInput"});
this._searchMenus = debounce(this._searchMenus, 100);
// Store menu data in a format searchable by fuzzy.js
this._searchableMenus = [];
@@ -122,26 +212,24 @@ export class AppsMenuSearchBar extends Component {
}
// Set up key navigation
this._setupKeyNavigation();
- }
-
- willPatch() {
- // Allow looping on results
- if (this.state.offset < 0) {
- this.state.offset = this.state.results.length + this.state.offset;
- } else if (this.state.offset >= this.state.results.length) {
- this.state.offset -= this.state.results.length;
- }
- }
-
- patched() {
- // Scroll to selected element on keyboard navigation
- if (this.state.results.length) {
- const listElement = this.el.querySelector(".search-results");
- const activeElement = this.el.querySelector(".highlight");
- if (activeElement) {
- scrollTo(activeElement, listElement);
+ onWillPatch(() => {
+ // Allow looping on results
+ if (this.state.offset < 0) {
+ this.state.offset = this.state.results.length + this.state.offset;
+ } else if (this.state.offset >= this.state.results.length) {
+ this.state.offset -= this.state.results.length;
}
- }
+ });
+ onPatched(() => {
+ // Scroll to selected element on keyboard navigation
+ if (this.state.results.length) {
+ const listElement = document.querySelector(".search-results");
+ const activeElement = listElement.querySelector(".highlight");
+ if (activeElement) {
+ scrollTo(activeElement, listElement);
+ }
+ }
+ });
}
/**
@@ -168,48 +256,12 @@ export class AppsMenuSearchBar extends Component {
* Setup navigation among search results
*/
_setupKeyNavigation() {
- const repeatable = {
- allowRepeat: true,
- };
- useHotkey(
- "ArrowDown",
- () => {
- this.state.offset++;
- },
- repeatable
- );
- useHotkey(
- "ArrowUp",
- () => {
- this.state.offset--;
- },
- repeatable
- );
- useHotkey(
- "Tab",
- () => {
- this.state.offset++;
- },
- repeatable
- );
- useHotkey(
- "Shift+Tab",
- () => {
- this.state.offset--;
- },
- repeatable
- );
useHotkey("Home", () => {
this.state.offset = 0;
});
useHotkey("End", () => {
this.state.offset = this.state.results.length - 1;
});
- useHotkey("Enter", () => {
- if (this.state.results.length) {
- this.el.querySelector(".highlight").click();
- }
- });
}
_onKeyDown(ev) {
@@ -224,9 +276,60 @@ export class AppsMenuSearchBar extends Component {
} else {
this.env.bus.trigger("ACTION_MANAGER:UI-UPDATED");
}
+ } else if (ev.code === "Tab") {
+ if (document.querySelector(".search-results")) {
+ ev.preventDefault();
+ if (event.shiftKey) {
+ this.state.offset--;
+ } else {
+ this.state.offset++;
+ }
+ }
+ } else if (ev.code === "ArrowUp") {
+ if (document.querySelector(".search-results")) {
+ ev.preventDefault();
+ this.state.offset--;
+ }
+ } else if (ev.code === "ArrowDown") {
+ if (document.querySelector(".search-results")) {
+ ev.preventDefault();
+ this.state.offset++;
+ }
+ } else if (ev.code === "Enter") {
+ if (this.state.results.length) {
+ ev.preventDefault();
+ document.querySelector(".search-results .highlight").click();
+ }
}
}
+
+ _splitName(name) {
+ const searchValue = this.searchBarInput.el.value;
+ if (name) {
+ const splitName = name.split(
+ new RegExp(`(${escapeRegExp(searchValue)})`, "ig")
+ );
+ return searchValue.length && splitName.length > 1 ? splitName : [name];
+ }
+ return [];
+ }
}
+
+// Patch Navbar to add proper icon for apps
+patch(NavBar.prototype, "web_responsive.navbar", {
+ getWebIconData(menu) {
+ var result = "/web_responsive/static/img/default_icon_app.png";
+ if (menu.webIconData) {
+ const prefix = menu.webIconData.startsWith("P")
+ ? "data:image/svg+xml;base64,"
+ : "data:image/png;base64,";
+ result = menu.webIconData.startsWith("data:image")
+ ? menu.webIconData
+ : prefix + menu.webIconData.replace(/\s/g, "");
+ }
+ return result;
+ },
+});
AppsMenu.template = "web_responsive.AppsMenu";
AppsMenuSearchBar.template = "web_responsive.AppsMenuSearchResults";
Object.assign(NavBar.components, {AppsMenu, AppsMenuSearchBar});
diff --git a/web_responsive/static/src/components/apps_menu/apps_menu.scss b/web_responsive/static/src/components/apps_menu/apps_menu.scss
index a26f001fe..49960d324 100644
--- a/web_responsive/static/src/components/apps_menu/apps_menu.scss
+++ b/web_responsive/static/src/components/apps_menu/apps_menu.scss
@@ -12,13 +12,12 @@
width: 100vw;
z-index: 200;
left: 0 !important;
- top: $o-navbar-height !important;
}
.o_apps_menu_opened .o_main_navbar {
.o_menu_brand,
.o_menu_sections {
- display: none;
+ display: none !important;
}
}
@@ -32,7 +31,7 @@
.fade-leave-to {
opacity: 0;
}
- .dropdown-menu {
+ .dropdown-menu-custom {
@include full-screen-dropdown();
cursor: pointer;
background: url("../../img/home-menu-bg-overlay.svg"),
@@ -62,7 +61,24 @@
}
.o_app {
- background: none;
+ outline: 0;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ text-align: center;
+ flex-direction: column;
+ justify-content: flex-start;
+ white-space: normal;
+ color: $white !important;
+ padding: 15px 0 10px;
+ font-size: 1.25rem;
+ text-shadow: 1px 1px 1px rgba($black, 0.4);
+ border-radius: 4px;
+ transition: 300ms ease;
+ transition-property: background-color;
+ &:focus {
+ background-color: rgba($white, 0.05) !important;
+ }
img {
box-shadow: none;
margin-bottom: 5px;
@@ -70,31 +86,10 @@
transition-property: box-shadow, transform;
}
- a {
- outline: 0;
- height: 100%;
- display: flex;
- align-items: center;
- text-align: center;
- flex-direction: column;
- justify-content: flex-start;
- white-space: normal;
- color: gray("white") !important;
- padding: 15px 0 10px;
- font-size: 1.25rem;
- text-shadow: 1px 1px 1px rgba(gray("black"), 0.4);
- border-radius: 4px;
- transition: 300ms ease;
- transition-property: background-color;
- background: none;
- &:focus {
- background-color: rgba(gray("white"), 0.05);
- }
- }
&:hover img,
a:focus img {
transform: translateY(-3px);
- box-shadow: 0 9px 12px -4px rgba(gray("black"), 0.3);
+ box-shadow: 0 9px 12px -4px rgba($black, 0.3);
}
// Size depends on screen
@@ -129,21 +124,20 @@
.search-input {
display: flex;
- justify-items: middle;
- box-shadow: inset 0 1px 0 rgba(gray("white"), 0.1),
- 0 1px 0 rgba(gray("black"), 0.1);
- text-shadow: 0 1px 0 rgba(gray("black"), 0.5);
+ justify-items: center;
+ box-shadow: inset 0 1px 0 rgba($white, 0.1), 0 1px 0 rgba($black, 0.1);
+ text-shadow: 0 1px 0 rgba($black, 0.5);
border-radius: 4px;
padding: 0.4rem 0.8rem;
margin-bottom: 1rem;
- background-color: rgba(gray("white"), 0.1);
+ background-color: rgba($white, 0.1);
@include media-breakpoint-up(md) {
padding: 0.8rem 1.2rem;
}
.search-icon {
- color: gray("white");
+ color: $white;
font-size: 1.5rem;
margin-right: 1rem;
padding-top: 1px;
@@ -153,19 +147,27 @@
height: 2rem;
background: none;
border: none;
- color: gray("white");
+ color: $white;
display: block;
padding: 1px 2px 2px 2px;
box-shadow: none;
&::placeholder {
- color: gray("white");
+ color: $white;
opacity: 0.5;
}
}
}
// Allow to scroll only on results, keeping static search box above
.search-results {
+ .text-ellipsis {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+ .text-primary {
+ color: red !important;
+ }
margin-top: 1rem;
max-height: calc(100vh - #{$o-navbar-height} - 8rem) !important;
overflow: auto;
@@ -177,7 +179,7 @@
background-position: left;
background-repeat: no-repeat;
background-size: contain;
- color: gray("white");
+ color: $white;
cursor: pointer;
line-height: 2.5rem;
padding-left: 3.5rem;
@@ -185,7 +187,7 @@
font-weight: 100;
&.highlight,
&:hover {
- background-color: rgba(gray("black"), 0.11);
+ background-color: rgba($black, 0.11);
}
b {
font-weight: 700;
@@ -194,3 +196,10 @@
}
}
}
+
+.dropdown-menu-custom {
+ max-height: 70vh;
+ overflow: auto;
+ background-clip: border-box;
+ box-shadow: $o-dropdown-box-shadow;
+}
diff --git a/web_responsive/static/src/components/apps_menu/apps_menu.xml b/web_responsive/static/src/components/apps_menu/apps_menu.xml
index 1ecaa5af6..7813ba179 100644
--- a/web_responsive/static/src/components/apps_menu/apps_menu.xml
+++ b/web_responsive/static/src/components/apps_menu/apps_menu.xml
@@ -1,6 +1,7 @@
@@ -8,23 +9,22 @@
-
+
@@ -35,16 +35,11 @@
class="dropdown-toggle"
title="Home Menu"
data-hotkey="a"
- t-on-click.stop="setState(!state.open)"
+ t-on-click.stop="() => this.setOpenState(!state.open,true)"
>
-
@@ -70,17 +65,31 @@
/>
diff --git a/web_responsive/static/src/components/attachment_viewer/attachment_viewer.esm.js b/web_responsive/static/src/components/attachment_viewer/attachment_viewer.esm.js
index 6edaa0e5d..52068df25 100644
--- a/web_responsive/static/src/components/attachment_viewer/attachment_viewer.esm.js
+++ b/web_responsive/static/src/components/attachment_viewer/attachment_viewer.esm.js
@@ -1,11 +1,12 @@
/** @odoo-module **/
/* Copyright 2021 ITerra - Sergey Shebanin
+ * Copyright 2023 Onestein - Anjeel Haria
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
import {AttachmentViewer} from "@mail/components/attachment_viewer/attachment_viewer";
import {patch} from "web.utils";
-
-const {useState} = owl.hooks;
+import {registerPatch} from "@mail/model/model_core";
+const {useState} = owl;
// Patch attachment viewer to add min/max buttons capability
patch(AttachmentViewer.prototype, "web_responsive.AttachmentViewer", {
@@ -15,8 +16,22 @@ patch(AttachmentViewer.prototype, "web_responsive.AttachmentViewer", {
maximized: false,
});
},
- // Disable auto-close to allow to use form in edit mode.
- isCloseable() {
- return false;
+});
+
+registerPatch({
+ name: "Dialog",
+ fields: {
+ isCloseable: {
+ compute() {
+ if (this.attachmentViewer) {
+ /**
+ * Prevent closing the dialog when clicking on the mask when the user is
+ * currently dragging the image.
+ */
+ return false;
+ }
+ return this._super();
+ },
+ },
},
});
diff --git a/web_responsive/static/src/components/attachment_viewer/attachment_viewer.scss b/web_responsive/static/src/components/attachment_viewer/attachment_viewer.scss
index 81ebecf30..c92690adb 100644
--- a/web_responsive/static/src/components/attachment_viewer/attachment_viewer.scss
+++ b/web_responsive/static/src/components/attachment_viewer/attachment_viewer.scss
@@ -3,10 +3,12 @@
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
// Attachment Viewer
-.o_web_client.o_chatter_position_sided .o_DialogManager_dialog {
+.o_web_client .o_DialogManager_dialog {
/* Show sided viewer on large screens */
- @include media-breakpoint-up(lg) {
- position: static;
+ @media (min-width: 1533px) {
+ &:not(:has(.o_AttachmentDeleteConfirm)) {
+ position: static;
+ }
.o_AttachmentViewer_main {
padding-bottom: 20px;
}
@@ -22,7 +24,7 @@
width: $chatter_zone_width;
&.o_AttachmentViewer_maximized {
- width: 100%;
+ width: 100% !important;
}
/* Show/Hide control buttons (next, prev, etc..) */
@@ -39,18 +41,21 @@
}
}
}
- @include media-breakpoint-down(md) {
+ @media (max-width: 1533px) {
.o_AttachmentViewer_headerItemButtonMinimize,
.o_AttachmentViewer_headerItemButtonMaximize {
- display: none;
+ display: none !important;
}
}
}
-
/* Attachment Viewer Max/Min buttons only are useful in sided mode */
-.o_web_client:not(.o_chatter_position_sided) {
+.o_FormRenderer_chatterContainer:not(.o-aside) {
.o_AttachmentViewer_headerItemButtonMinimize,
.o_AttachmentViewer_headerItemButtonMaximize {
- display: none;
+ display: none !important;
}
}
+
+.o_apps_menu_opened .o_AttachmentViewer {
+ display: none !important;
+}
diff --git a/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml b/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml
index 3d26ff4e1..57f3b6c99 100644
--- a/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml
+++ b/web_responsive/static/src/components/attachment_viewer/attachment_viewer.xml
@@ -16,8 +16,8 @@
>