summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread/thread.js
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2020-08-28 10:16:37 +0000
committerSébastien Theys <seb@odoo.com>2020-08-28 13:43:54 +0000
commitf9ee1cf5f904116e4d1d70a8eaf4ee1d58b18a3a (patch)
tree89425d0677083bb9489e42d47521c4bcf1e4ff44 /addons/mail/static/src/models/thread/thread.js
parent98e12901c97a67dc87f21647473754cd6f384d4a (diff)
[FIX] mail, *: rename thread viewer to thread view
The "viewer" should be the "parent" not the view itself. This distinction will become important in a future commit to allow viewers to not display the view in some situations. Rename done as a standalone commit to ease diff readability. Part of task-2310623 closes odoo/odoo#56737 X-original-commit: 1b811e6a972d72de02965adda67c5b039bee023f Related: odoo/enterprise#12756 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
-rw-r--r--addons/mail/static/src/models/thread/thread.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js
index e3d48d54e35..d34d295223a 100644
--- a/addons/mail/static/src/models/thread/thread.js
+++ b/addons/mail/static/src/models/thread/thread.js
@@ -502,9 +502,9 @@ function factory(dependencies) {
(device.isMobile && this.model === 'mail.box')
) {
if (resetDiscussDomain) {
- discuss.threadViewer.update({ stringifiedDomain: '[]' });
+ discuss.threadView.update({ stringifiedDomain: '[]' });
}
- discuss.threadViewer.update({ thread: [['link', this]] });
+ discuss.threadView.update({ thread: [['link', this]] });
} else {
this.env.messaging.chatWindowManager.openThread(this, { mode: chatWindowMode });
}
@@ -519,7 +519,7 @@ function factory(dependencies) {
openExpanded() {
const discuss = this.env.messaging.discuss;
if (['mail.channel', 'mail.box'].includes(this.model)) {
- discuss.threadViewer.update({ thread: [['link', this]] });
+ discuss.threadView.update({ thread: [['link', this]] });
this.env.bus.trigger('do-action', {
action: 'mail.action_discuss',
options: {
@@ -763,8 +763,8 @@ function factory(dependencies) {
* @returns {mail.chat_window[]}
*/
_computeChatWindows() {
- const chatWindowViewers = this.viewers.filter(viewer => !!viewer.chatWindow);
- return [['replace', chatWindowViewers.map(viewer => viewer.chatWindow)]];
+ const chatWindowThreadViews = this.threadViews.filter(threadView => !!threadView.chatWindow);
+ return [['replace', chatWindowThreadViews.map(threadView => threadView.chatWindow)]];
}
/**
@@ -1194,7 +1194,7 @@ function factory(dependencies) {
channel_type: attr(),
chatWindows: one2many('mail.chat_window', {
compute: '_computeChatWindows',
- dependencies: ['viewersChatWindow'],
+ dependencies: ['threadViewsChatWindow'],
}),
composer: one2one('mail.composer', {
/**
@@ -1472,11 +1472,11 @@ function factory(dependencies) {
dependencies: ['orderedOtherTypingMembers'],
}),
uuid: attr(),
- viewers: one2many('mail.thread_viewer', {
+ threadViews: one2many('mail.thread_view', {
inverse: 'thread',
}),
- viewersChatWindow: many2many('mail.chat_window', {
- related: 'viewers.chatWindow',
+ threadViewsChatWindow: many2many('mail.chat_window', {
+ related: 'threadViews.chatWindow',
}),
};