From 0a452c528d48218e8be8732b8eadaf78846b40ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 13 Jul 2021 16:42:26 +0000 Subject: [PATCH] [IMP] mail: use thread displayName instead of name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More often than not these 2 fields have the same value, but when they are different it is `displayName` that holds the expected value (eg. for a DM, `displayName` would be the custom name or the name of the correspondent). This commit updates them to avoid confusion and having bad examples in the code. closes odoo/odoo#73659 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/components/composer/composer.js | 2 +- addons/mail/static/src/components/composer/composer.xml | 4 ++-- .../components/discuss_sidebar_item/discuss_sidebar_item.xml | 2 +- addons/mail/static/src/components/message/message.js | 2 +- addons/mail/static/src/components/message/message.xml | 4 ++-- addons/mail/static/src/models/thread/thread.js | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/mail/static/src/components/composer/composer.js b/addons/mail/static/src/components/composer/composer.js index c7d77fc6e2c..6af02da85eb 100644 --- a/addons/mail/static/src/components/composer/composer.js +++ b/addons/mail/static/src/components/composer/composer.js @@ -57,7 +57,7 @@ export class Composer extends Component { threadChannelType: thread && thread.channel_type, // for livechat override threadDisplayName: thread && thread.displayName, threadModel: thread && thread.model, - threadName: thread && thread.name, + threadDisplayName: thread && thread.displayName, }; }, { compareDepth: { diff --git a/addons/mail/static/src/components/composer/composer.xml b/addons/mail/static/src/components/composer/composer.xml index 40997518eaf..f7155a58712 100644 --- a/addons/mail/static/src/components/composer/composer.xml +++ b/addons/mail/static/src/components/composer/composer.xml @@ -38,8 +38,8 @@ To: Followers of - - "" + + "" this document diff --git a/addons/mail/static/src/components/discuss_sidebar_item/discuss_sidebar_item.xml b/addons/mail/static/src/components/discuss_sidebar_item/discuss_sidebar_item.xml index 8158e4fc838..4015da276ff 100644 --- a/addons/mail/static/src/components/discuss_sidebar_item/discuss_sidebar_item.xml +++ b/addons/mail/static/src/components/discuss_sidebar_item/discuss_sidebar_item.xml @@ -16,7 +16,7 @@
notif.__state) : [], originThread, originThreadModel: originThread && originThread.model, - originThreadName: originThread && originThread.name, + originThreadDisplayName: originThread && originThread.displayName, originThreadUrl: originThread && originThread.url, partnerRoot, thread, diff --git a/addons/mail/static/src/components/message/message.xml b/addons/mail/static/src/components/message/message.xml index 9d95060021e..2c8cb4fc31a 100644 --- a/addons/mail/static/src/components/message/message.xml +++ b/addons/mail/static/src/components/message/message.xml @@ -88,10 +88,10 @@
- (from #channel) + (from #channel) - on document + on document
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js index a2ae757b611..49064204772 100644 --- a/addons/mail/static/src/models/thread/thread.js +++ b/addons/mail/static/src/models/thread/thread.js @@ -636,8 +636,8 @@ function factory(dependencies) { !thread.isTemporary && thread.model === 'mail.channel' && thread.channel_type === 'channel' && - thread.name && - cleanSearchTerm(thread.name).includes(cleanedSearchTerm) + thread.displayName && + cleanSearchTerm(thread.displayName).includes(cleanedSearchTerm) )]; }