* = im_livechat, test_mail_full Display the rating changes that generate a notification under the systray. Using the rating faces to represent the result. task-2794182 closes odoo/odoo#89537 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
29 lines
937 B
JavaScript
29 lines
937 B
JavaScript
/** @odoo-module **/
|
|
|
|
import '@mail/../tests/helpers/mock_server'; // ensure mail overrides are applied first
|
|
|
|
import { patch } from "@web/core/utils/patch";
|
|
import { MockServer } from "@web/../tests/helpers/mock_server";
|
|
|
|
patch(MockServer.prototype, 'rating', {
|
|
/**
|
|
* @override
|
|
*/
|
|
_mockMailMessageMessageFormat(ids) {
|
|
const formattedMessages = this._super(...arguments);
|
|
for (const formattedMessage of formattedMessages) {
|
|
const [rating] = this.getRecords('rating.rating', [
|
|
['message_id', '=', formattedMessage.id],
|
|
]);
|
|
if (rating) {
|
|
formattedMessage['rating'] = [['insert-and-replace', {
|
|
'id': rating.id,
|
|
'ratingImageUrl': rating.rating_image_url,
|
|
'ratingText': rating.rating_text,
|
|
}]];
|
|
}
|
|
}
|
|
return formattedMessages;
|
|
},
|
|
});
|