diff options
| author | Thibault Delavallée <tde@odoo.com> | 2019-07-19 14:18:17 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-07-23 08:29:15 +0000 |
| commit | 0cc6390db5e759bfbfbbf2272f342eba391926fa (patch) | |
| tree | aa7c1949d0d091d9ac093a1f1223428d061d371e | |
| parent | 7ef11e3c96893dffc1bad93917c6955a38ac6002 (diff) | |
[FIX] sms: do not display popover for void notification
PURPOSE
Improve SMS UX integration. Followup of merge 4287481 .
SPECIFICATIONS
Fix recent SMS merge: do not display tooltip / popover about SMS information
in chatter if there was no recipients linked to the SMS message.
LINKS
Task 1922187
| -rw-r--r-- | addons/sms/static/src/js/message.js | 8 | ||||
| -rw-r--r-- | addons/sms/static/src/xml/thread.xml | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/addons/sms/static/src/js/message.js b/addons/sms/static/src/js/message.js index f800563fd72..b5463ae9f8f 100644 --- a/addons/sms/static/src/js/message.js +++ b/addons/sms/static/src/js/message.js @@ -33,6 +33,14 @@ Message.include({ return this._smsStatus; }, /** + * Whether message has nay SMS-related notification + * + * @returns {boolean} + */ + hasSmsData: function () { + return !!(this._smsIds && (this._smsIds.length > 0)); + }, + /** * Does the message contains at least one SMS failure * * @returns {boolean} diff --git a/addons/sms/static/src/xml/thread.xml b/addons/sms/static/src/xml/thread.xml index b01524ba609..a28e70f0fa7 100644 --- a/addons/sms/static/src/xml/thread.xml +++ b/addons/sms/static/src/xml/thread.xml @@ -3,7 +3,7 @@ <t t-extend="mail.widget.Thread.Message"> <t t-jquery=".o_thread_tooltip_container" t-operation="after"> - <span t-if="message.getType() === 'sms' and options.displaySmsIcons" class="o_thread_sms_tooltip_container"> + <span t-if="message.getType() === 'sms' and message.hasSmsData() and options.displaySmsIcons" class="o_thread_sms_tooltip_container"> <t t-set="thread_icon_class" t-value="'o_thread_sms_tooltip o_thread_message_sms o_thread_message_sms_' + message.getSmsStatus()" /> <i t-attf-class="o_thread_sms_tooltip o_thread_message_sms o_thread_message_sms_#{message.getSmsStatus()} #{message.isError() ? 'o_thread_message_sms_error' : ''} fa fa-comment" t-att-data-message-id="message.getID()"/> |
