From e5ef19b730143321d6c9902a241aa8bf29b546fd Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Tue, 28 Apr 2020 08:05:55 +0000 Subject: [PATCH] [IMP] web: improve explanatory comment in owl_compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit after this commit, to update legacy widget from owl component, one need to override renderWidget and updateWidget instead of render and update method, this has been changed from commit https://github.com/odoo/odoo/commit/f2de55322e4d417815e6757517163dd0cff544cc but comment were still has render and update method to override, so with this commit update comments as well. task-2238551 closes odoo/odoo#54763 X-original-commit: 16713aaacbd4f4a25bed435bfa9045fab29a8c53 Signed-off-by: Alexandre Kühn (aku) --- addons/web/static/src/js/owl_compatibility.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/owl_compatibility.js b/addons/web/static/src/js/owl_compatibility.js index 103c62dd3ba..b5ff2a026d1 100644 --- a/addons/web/static/src/js/owl_compatibility.js +++ b/addons/web/static/src/js/owl_compatibility.js @@ -56,18 +56,18 @@ odoo.define('web.OwlCompatibility', function () { * * * If the legacy widget has to be updated when props change, one must define - * a subclass of ComponentAdapter to override 'update' and 'render'. The - * 'update' function takes the nextProps as argument, and should update the + * a subclass of ComponentAdapter to override 'updateWidget' and 'renderWidget'. The + * 'updateWidget' function takes the nextProps as argument, and should update the * internal state of the widget (might be async, and return a Promise). * However, to ensure that the DOM is updated all at once, it shouldn't do - * a re-rendering. This is the role of function 'render', which will be + * a re-rendering. This is the role of function 'renderWidget', which will be * called just before patching the DOM, and which thus must be synchronous. * For instance: * class SpecificAdapter extends ComponentAdapter { - * update(nextProps) { + * updateWidget(nextProps) { * return this.widget.updateState(nextProps); * } - * render() { + * renderWidget() { * return this.widget.render(); * } * }