diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-12-21 12:29:50 +0100 |
|---|---|---|
| committer | Alexandre Kühn <alex.e.kuhn@gmail.com> | 2018-02-01 14:51:58 +0100 |
| commit | 02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498 (patch) | |
| tree | 10d91136786b13666e78cfb94b12f1609d6f883d /addons/web/static/src/js/chrome | |
| parent | 0cd656b5af38051df3f7d6319e99705150bb1cd8 (diff) | |
[REF][IMP] *: mail js refactoring
This commit improves the JS code of the mail module,
which comes maily from the new coding guidelines
and the addition of "JS services".
JS services are important objects that do not fit
well in the component tree, such as chat_manager
or ajax.
The benefits of JS services are improved readability
of the code, reduced coupling, and more testable
modules. In particular, discuss was hard to
Summary of the changes:
- ClientAction has been renamed into Discuss
- Clear instantiation of chatManager
- New coding guidelines in most mail modules
- JS Services can interact with each other
- Chat Manager and Window Manager are services
- Window Manager renamed to Chat Window Manager
- bus.bus is now encapsulated in Bus Service (a service)
- The test infrastructure has been tweaked with JS Services
- Chat Mixin has been removed
A future improvement would be to translate some 'trigger' into 'trigger_up'.
Diffstat (limited to 'addons/web/static/src/js/chrome')
| -rw-r--r-- | addons/web/static/src/js/chrome/abstract_web_client.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager_report.js | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_web_client.js b/addons/web/static/src/js/chrome/abstract_web_client.js index 58c068fecb1..2dd69d7426c 100644 --- a/addons/web/static/src/js/chrome/abstract_web_client.js +++ b/addons/web/static/src/js/chrome/abstract_web_client.js @@ -20,16 +20,16 @@ var data_manager = require('web.data_manager'); var Dialog = require('web.Dialog'); var dom = require('web.dom'); var Loading = require('web.Loading'); -var mixins = require('web.mixins'); var NotificationManager = require('web.NotificationManager'); var RainbowMan = require('web.RainbowMan'); +var ServiceProviderMixin = require('web.ServiceProviderMixin'); var session = require('web.session'); var Widget = require('web.Widget'); var _t = core._t; var qweb = core.qweb; -var AbstractWebClient = Widget.extend(mixins.ServiceProvider, { +var AbstractWebClient = Widget.extend(ServiceProviderMixin, { custom_events: { clear_uncommitted_changes: function (e) { this.clear_uncommitted_changes().then(e.data.callback); @@ -90,8 +90,8 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, { }, init: function (parent) { this.client_options = {}; - mixins.ServiceProvider.init.call(this); this._super(parent); + ServiceProviderMixin.init.call(this); this.origin = undefined; this._current_state = null; this.menu_dm = new concurrency.DropMisordered(); diff --git a/addons/web/static/src/js/chrome/action_manager_report.js b/addons/web/static/src/js/chrome/action_manager_report.js index bfdfa15f8b6..8975fea2628 100644 --- a/addons/web/static/src/js/chrome/action_manager_report.js +++ b/addons/web/static/src/js/chrome/action_manager_report.js @@ -12,6 +12,7 @@ var crash_manager = require('web.crash_manager'); var framework = require('web.framework'); var session = require('web.session'); + var _t = core._t; var _lt = core._lt; |
