From b86a26f892ef2fb43f0a0529acee17f046813ded Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 7 Jun 2021 19:02:30 +0000 Subject: [PATCH] [FIX] web: adapt debug manager profiling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit applies [1] in the wowl branch, since [1] has been developped in parallel of the conversion of the webclient in owl. Note that the former implementation is still temporarily used on the website, as it still uses the legacy DebugManager. [1] 4c4a740e0a98f92b8f520b04a99f48c55814e28c closes odoo-dev/odoo#930 Signed-off-by: Géry Debongnie (ged) --- addons/web/__manifest__.py | 1 - .../web/static/src/core/debug/debug_menu.js | 5 +- .../web/static/src/core/debug/debug_menu.xml | 1 + .../static/src/core/debug/debug_menu_items.js | 1 - .../core/debug/profiling/profiling_item.js | 24 ++++ .../core/debug/profiling/profiling_item.scss | 25 +++++ .../core/debug/profiling/profiling_item.xml | 44 ++++++++ .../core/debug/profiling/profiling_service.js | 104 ++++++++++++++++++ addons/web/static/src/legacy/debug_manager.js | 41 +++---- .../legacy/frontend/debug_manager/debug.xml | 46 +++++++- .../debug_manager/debug_manager.scss} | 1 - 11 files changed, 264 insertions(+), 29 deletions(-) create mode 100644 addons/web/static/src/core/debug/profiling/profiling_item.js create mode 100644 addons/web/static/src/core/debug/profiling/profiling_item.scss create mode 100644 addons/web/static/src/core/debug/profiling/profiling_item.xml create mode 100644 addons/web/static/src/core/debug/profiling/profiling_service.js rename addons/web/static/src/{scss/debug_profiling.scss => legacy/frontend/debug_manager/debug_manager.scss} (99%) diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index fcbc8875950..ca39386cf0b 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -61,7 +61,6 @@ This module provides the core of the Odoo Web Client. 'web.assets_common': [ ('include', 'web._assets_helpers'), - 'web/static/src/scss/debug_profiling.scss', 'web/static/lib/bootstrap/scss/_variables.scss', ('include', 'web._assets_common_styles'), diff --git a/addons/web/static/src/core/debug/debug_menu.js b/addons/web/static/src/core/debug/debug_menu.js index fad7c8562de..dbdccf2c459 100644 --- a/addons/web/static/src/core/debug/debug_menu.js +++ b/addons/web/static/src/core/debug/debug_menu.js @@ -64,7 +64,10 @@ export class DebugMenu extends Component { } onDropdownItemSelected(ev) { - ev.detail.payload.callback(); + // items of type "component" don't necessarily have a payload/callback + if (ev.detail.payload && ev.detail.payload.callback) { + ev.detail.payload.callback(); + } } onClickOnTagA(ev) { diff --git a/addons/web/static/src/core/debug/debug_menu.xml b/addons/web/static/src/core/debug/debug_menu.xml index 859cd877d83..7abfb4c5d14 100644 --- a/addons/web/static/src/core/debug/debug_menu.xml +++ b/addons/web/static/src/core/debug/debug_menu.xml @@ -17,6 +17,7 @@