summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/chatter.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-12-21 12:29:50 +0100
committerAlexandre Kühn <alex.e.kuhn@gmail.com>2018-02-01 14:51:58 +0100
commit02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498 (patch)
tree10d91136786b13666e78cfb94b12f1609d6f883d /addons/mail/static/src/js/chatter.js
parent0cd656b5af38051df3f7d6319e99705150bb1cd8 (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/mail/static/src/js/chatter.js')
-rw-r--r--addons/mail/static/src/js/chatter.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js
index 649a7381f7c..dfc041325d9 100644
--- a/addons/mail/static/src/js/chatter.js
+++ b/addons/mail/static/src/js/chatter.js
@@ -2,7 +2,6 @@ odoo.define('mail.Chatter', function (require) {
"use strict";
var Activity = require('mail.Activity');
-var chat_mixin = require('mail.chat_mixin');
var ChatterComposer = require('mail.ChatterComposer');
var Followers = require('mail.Followers');
var ThreadField = require('mail.ThreadField');
@@ -22,7 +21,7 @@ var QWeb = core.qweb;
// with each other.
// It synchronizes the rendering of those widgets (as they may be asynchronous), to limitate
// the flickering when switching between records
-var Chatter = Widget.extend(chat_mixin, {
+var Chatter = Widget.extend({
template: 'mail.Chatter',
custom_events: {
reload_mail_fields: '_onReloadMailFields',
@@ -52,7 +51,7 @@ var Chatter = Widget.extend(chat_mixin, {
// mention: get the prefetched partners and use them as mention suggestions
// if there is a follower widget, the followers will be added to the
// suggestions as well once fetched
- this.mentionPartnerSuggestions = this._getMentionPartnerSuggestions();
+ this.mentionPartnerSuggestions = this.call('chat_manager', 'getMentionPartnerSuggestions');
this.mentionSuggestions = this.mentionPartnerSuggestions;
this.fields = {};