Skip to content

Commit

Permalink
TA#62826 [ADD][MIG] resize_observer_error_catcher : migration to 14.0 (
Browse files Browse the repository at this point in the history
…#111)

* TA#62826 [ADD][MIG] resize_observer_error_catcher : migration to 14.0
  • Loading branch information
lanto-razafindrabe authored Mar 15, 2024
1 parent 3c029f4 commit 1899922
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"depends": [
"disable_quick_create",
"google_attachment",
"resize_observer_error_catcher",
"web_contextual_search_favorite",
"web_custom_label",
"web_custom_modifier",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ USER odoo

COPY disable_quick_create /mnt/extra-addons/disable_quick_create
COPY google_attachment /mnt/extra-addons/google_attachment
COPY resize_observer_error_catcher /mnt/extra-addons/resize_observer_error_catcher
COPY web_contextual_search_favorite /mnt/extra-addons/web_contextual_search_favorite
COPY web_custom_label /mnt/extra-addons/web_custom_label
COPY web_custom_modifier /mnt/extra-addons/web_custom_modifier
Expand Down
19 changes: 19 additions & 0 deletions resize_observer_error_catcher/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Resize Observer Error Catcher
=============================

This module prevent the raising of an error when resizing the window (by zoom in or zoom out).
Here are the errors that the module skipped :
- `ResizeObserver loop completed with undelivered notifications`
- `ResizeObserver loop limit exceeded`

.. image:: static/description/resize_observer_error.png

Contributors
------------

* Numigi (tm) and all its contributors (https://bit.ly/numigiens)

More information
----------------

* Meet us at https://bit.ly/numigi-com
2 changes: 2 additions & 0 deletions resize_observer_error_catcher/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# © 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
16 changes: 16 additions & 0 deletions resize_observer_error_catcher/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# © 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Resize Observer Error Catcher",
"summary": "Skip Resize Observer interface error when zooming.",
"version": "14.0.1.0.0",
"website": "https://bit.ly/numigi-com",
"author": "Numigi",
"maintainer": "Numigi",
"license": "AGPL-3",
"depends": ["web"],
"data": [
"views/assets.xml",
],
"installable": True,
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
odoo.define('resize_observer_error_catcher.handling_error', function (require) {
"use strict";

window.addEventListener('error', (e) => {
if (
[
'ResizeObserver loop completed with undelivered notifications.',
'ResizeObserver loop limit exceeded',
/* add more if needed */
].includes(e.message)
) {
e.stopImmediatePropagation();
}
});

});
10 changes: 10 additions & 0 deletions resize_observer_error_catcher/views/assets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" name="sms_assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/resize_observer_error_catcher/static/src/js/resize_observer_catcher.js"></script>
</xpath>
</template>
</data>
</odoo>

0 comments on commit 1899922

Please sign in to comment.