Skip to content
Snippets Groups Projects
Commit 00d595af authored by Alexandre Kühn's avatar Alexandre Kühn
Browse files

[IMP] mail: turn 'MessageView/authorAvatarTitleText' into field


Task-2793280

closes odoo/odoo#86458

Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
parent d60f8e32
No related branches found
No related tags found
No related merge requests found
......@@ -169,12 +169,6 @@ export class Message extends Component {
get messageView() {
return this.messaging && this.messaging.models['MessageView'].get(this.props.localId);
}
/**
* @returns {string}
*/
get OPEN_CHAT() {
return this.env._t("Open chat");
}
/**
* Make this message viewable in its enclosing scroll environment (usually
......
......@@ -29,7 +29,7 @@
<div class="o_Message_sidebar" t-att-class="{ 'o-message-squashed align-items-start': messageView.isSquashed }">
<t t-if="!messageView.isSquashed">
<div class="o_Message_authorAvatarContainer o_Message_sidebarItem">
<img class="o_Message_authorAvatar rounded-circle" t-att-class="{ o_Message_authorRedirect: messageView.hasAuthorOpenChat, o_redirect: messageView.hasAuthorOpenChat }" t-att-src="messageView.message.avatarUrl" t-on-click="_onClickAuthorAvatar" t-att-title="messageView.hasAuthorOpenChat ? OPEN_CHAT : ''" alt="Avatar"/>
<img class="o_Message_authorAvatar rounded-circle" t-att-class="{ o_Message_authorRedirect: messageView.hasAuthorOpenChat, o_redirect: messageView.hasAuthorOpenChat }" t-att-src="messageView.message.avatarUrl" t-on-click="_onClickAuthorAvatar" t-att-title="messageView.hasAuthorOpenChat ? messageView.authorAvatarTitleText : ''" alt="Avatar"/>
<t t-if="messageView.message.author and messageView.message.author.im_status">
<PartnerImStatusIcon
className="'o_Message_partnerImStatusIcon'"
......
......@@ -107,6 +107,13 @@ registerModel({
? insertAndReplace()
: clear();
},
/**
* @private
* @returns {string}
*/
_computeAuthorAvatarTitleText() {
return this.env._t("Open chat");
},
/**
* @private
* @returns {string|FieldCommand}
......@@ -168,6 +175,9 @@ registerModel({
isCausal: true,
readonly: true,
}),
authorAvatarTitleText: attr({
compute: '_computeAuthorAvatarTitleText',
}),
/**
* States the component displaying this message view (if any).
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment