Skip to content

Commit

Permalink
TA#66892 [MIG][16.0] resize_observer_error_catcher
Browse files Browse the repository at this point in the history
  • Loading branch information
lanto-razafindrabe committed Jun 24, 2024
1 parent 01bea0e commit 737d21c
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2023 Numigi
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
Expand All @@ -12,6 +12,7 @@
"summary": "Install all addons required for testing.",
"depends": [
"web",
"resize_observer_error_catcher",
],
"installable": True,
}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ RUN pip3 install -r test-requirements.txt

USER odoo

COPY resize_observer_error_catcher /mnt/extra-addons/resize_observer_error_catcher

COPY .docker_files/main /mnt/extra-addons/main
COPY .docker_files/odoo.conf /etc/odoo
20 changes: 20 additions & 0 deletions resize_observer_error_catcher/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
=============================
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 @@
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
19 changes: 19 additions & 0 deletions resize_observer_error_catcher/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024-today Numigi and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{

Check warning on line 3 in resize_observer_error_catcher/__manifest__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

resize_observer_error_catcher/__manifest__.py#L3

Statement seems to have no effect
"name": "Resize Observer Error Catcher",
"summary": "Skip Resize Observer interface error when zooming.",
"version": "16.0.1.0.0",
"website": "https://bit.ly/numigi-com",
"author": "Numigi",
"maintainer": "Numigi",
"license": "AGPL-3",
"depends": ["base_setup"],
"data": [],
"assets": {
"web.assets_backend": [
"resize_observer_error_catcher/static/src/js/resize_observer_catcher.js",
],
},
"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();
}
});

});

0 comments on commit 737d21c

Please sign in to comment.