From c4786fccfd23360a02e442c48ae2fb9f1e70aa4c Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Fri, 12 Jun 2020 09:01:44 +0000 Subject: [IMP] *: update notifications to optional title closes odoo/odoo#52826 Related: odoo/enterprise#11084 Signed-off-by: Aaron Bohy (aab) --- addons/mail/static/src/js/attachment_box.js | 2 +- addons/mail/static/src/js/composers/basic_composer.js | 2 +- addons/mail/static/src/js/discuss.js | 4 ++-- addons/mail/static/src/js/many2one_avatar_user.js | 3 +-- addons/mail/static/src/js/services/mail_notification_manager.js | 4 ++-- addons/mail/static/src/js/thread_field.js | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) (limited to 'addons/mail/static/src/js') diff --git a/addons/mail/static/src/js/attachment_box.js b/addons/mail/static/src/js/attachment_box.js index f0bf5801108..507bb38ce49 100644 --- a/addons/mail/static/src/js/attachment_box.js +++ b/addons/mail/static/src/js/attachment_box.js @@ -129,7 +129,7 @@ var AttachmentBox = Widget.extend({ */ _onUploaded: function(ev, response) { if (response.error) { - this.do_warn(_t("Error"), _t("You are not allowed to upload an attachment here.")); + this.do_warn(false, _t("Attachment upload not authorized here")); } else { this.trigger_up('reload_attachment_box'); } diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js index a38586f0da7..ffde77eac9a 100644 --- a/addons/mail/static/src/js/composers/basic_composer.js +++ b/addons/mail/static/src/js/composers/basic_composer.js @@ -265,7 +265,7 @@ var BasicComposer = Widget.extend({ */ _doCheckAttachmentUpload: function () { if (_.find(this.get('attachment_ids'), function (file) { return file.upload; })) { - this.do_warn(_t("Uploading error"), _t("Please, wait while the file is uploading.")); + this.do_warn(false, _t("Please wait while the file is uploading...")); return false; } return true; diff --git a/addons/mail/static/src/js/discuss.js b/addons/mail/static/src/js/discuss.js index 29a02738f66..5e17ce86d67 100644 --- a/addons/mail/static/src/js/discuss.js +++ b/addons/mail/static/src/js/discuss.js @@ -96,10 +96,10 @@ var PartnerInviteDialog = Dialog.extend({ var names = _.escape(_.pluck(data, 'text').join(', ')); var notification = _.str.sprintf( - _t("You added %s to the conversation."), + _t("You added %s to the conversation"), names ); - self.do_notify(_t("New people"), notification); + self.do_notify(false, notification); // Update list of members with the invited user, so that // we can mention this user in this channel right away. var channel = self.call('mail_service', 'getChannel', self._channelID); diff --git a/addons/mail/static/src/js/many2one_avatar_user.js b/addons/mail/static/src/js/many2one_avatar_user.js index fe768b089c1..ba92fdc3d5c 100644 --- a/addons/mail/static/src/js/many2one_avatar_user.js +++ b/addons/mail/static/src/js/many2one_avatar_user.js @@ -63,8 +63,7 @@ odoo.define('mail.Many2OneAvatarUser', function (require) { */ _displayWarning() { this.displayNotification({ - title: _t('Cannot chat with yourself'), - message: _t('Click on the avatar of other users to chat with them.'), + message: _t('You cannot chat with yourself'), type: 'info', }); }, diff --git a/addons/mail/static/src/js/services/mail_notification_manager.js b/addons/mail/static/src/js/services/mail_notification_manager.js index ef91155c9db..c7c5a03e6bf 100644 --- a/addons/mail/static/src/js/services/mail_notification_manager.js +++ b/addons/mail/static/src/js/services/mail_notification_manager.js @@ -250,7 +250,7 @@ MailManager.include({ channelData.info !== 'creation' ) { this.do_notify( - _t("Invitation"), + false, _t("You have been invited to: ") + channelData.name); } } @@ -530,7 +530,7 @@ MailManager.include({ } this._removeChannel(channel); this._mailBus.trigger('unsubscribe_from_channel', data.id); - this.do_notify(_t("Unsubscribed"), message); + this.do_notify(false, message); } }, /** diff --git a/addons/mail/static/src/js/thread_field.js b/addons/mail/static/src/js/thread_field.js index 2d809def129..a34582c1dde 100644 --- a/addons/mail/static/src/js/thread_field.js +++ b/addons/mail/static/src/js/thread_field.js @@ -95,7 +95,7 @@ var ThreadField = AbstractField.extend({ self.trigger_up('reload_mail_fields', { followers: true }); } }).guardedCatch(function () { - self.do_notify(_t("Sending Error"), _t("Your message has not been sent.")); + self.do_notify(false, _t("Message not sent")); return Promise.reject(); }); }, -- cgit v1.2.3