From 8699142f650148e6c615c7c66a4ad667bfd79b24 Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Fri, 8 Sep 2023 14:59:16 +0200 Subject: [PATCH] [IMP] mail: remove legacy code in `patch_ui_size` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As the comment says: > This function must be removed when the WOWL env will be available in > the form_renderer. This code seems not needed anymore. closes odoo/odoo#135273 Signed-off-by: Adrien Dieudonné (adr) --- .../static/tests/helpers/patch_ui_size.js | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/addons/mail/static/tests/helpers/patch_ui_size.js b/addons/mail/static/tests/helpers/patch_ui_size.js index 46f4c984651..a141e3da468 100644 --- a/addons/mail/static/tests/helpers/patch_ui_size.js +++ b/addons/mail/static/tests/helpers/patch_ui_size.js @@ -3,7 +3,6 @@ import { browser } from "@web/core/browser/browser"; import { MEDIAS_BREAKPOINTS, SIZES, utils } from "@web/core/ui/ui_service"; import { patchWithCleanup } from "@web/../tests/helpers/utils"; -import { Component } from "@odoo/owl"; /** * Return the width corresponding to the given size. If an upper and lower bound @@ -37,25 +36,6 @@ function getSizeFromWidth(width) { }); } -/** - * Patch legacy objects referring to the ui size. This function must be removed - * when the wowl env will be available in the form_renderer (currently the form - * renderer relies on config). This will impact env.browser.innerWidth. - * - * @param {number} size - * @param {number} width - */ -function legacyPatchUiSize(height, width) { - const legacyEnv = Component.env; - patchWithCleanup(legacyEnv, { - browser: { - ...legacyEnv.browser, - innerWidth: width, - innerHeight: height || browser.innerHeight, - }, - }); -} - /** * Adjust ui size either from given size (mapped to window breakpoints) or * width. This will impact uiService.{isSmall/size}, (wowl/legacy) @@ -83,7 +63,6 @@ function patchUiSize({ height, size, width }) { return size; }, }); - legacyPatchUiSize(height, width); } export { patchUiSize, SIZES };