[FIX] mail: set href on notification link.
This allow the user to open link in new tabs with middle click task-2387837 closes odoo/odoo#62738 X-original-commit: 7a57cf0b68b3a1dce4276c6456a94b05eec20f28 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -82,10 +82,10 @@
|
||||
<t t-if="threadView and message.originThread and message.originThread !== threadView.thread">
|
||||
<div class="o_Message_originThread" t-att-class="{ 'o-message-selected': props.isSelected }">
|
||||
<t t-if="message.originThread.model === 'mail.channel'">
|
||||
(from <a class="o_Message_originThreadLink" href="#" t-on-click="_onClickOriginThread">#<t t-esc="message.originThread.name"/></a>)
|
||||
(from <a class="o_Message_originThreadLink" t-att-href="message.originThread.url" t-on-click="_onClickOriginThread">#<t t-esc="message.originThread.name"/></a>)
|
||||
</t>
|
||||
<t t-else="">
|
||||
on <a class="o_Message_originThreadLink" href="#" t-on-click="_onClickOriginThread"><t t-esc="message.originThread.name"/></a>
|
||||
on <a class="o_Message_originThreadLink" t-att-href="message.originThread.url" t-on-click="_onClickOriginThread"><t t-esc="message.originThread.name"/></a>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
@@ -1400,6 +1400,20 @@ function factory(dependencies) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute an url string that can be used inside a href attribute
|
||||
*
|
||||
* @private
|
||||
* @returns {string}
|
||||
*/
|
||||
_computeUrl() {
|
||||
const baseHref = this.env.session.url('/web');
|
||||
if (this.model === 'mail.channel') {
|
||||
return `${baseHref}#action=mail.action_discuss&active_id=${this.model}_${this.id}`;
|
||||
}
|
||||
return `${baseHref}#model=${this.model}&id=${this.id}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Object} param0
|
||||
@@ -2092,6 +2106,17 @@ function factory(dependencies) {
|
||||
default: '',
|
||||
dependencies: ['orderedOtherTypingMembers'],
|
||||
}),
|
||||
/**
|
||||
* URL to access to the conversation.
|
||||
*/
|
||||
url: attr({
|
||||
compute: '_computeUrl',
|
||||
default: '',
|
||||
dependencies: [
|
||||
'id',
|
||||
'model',
|
||||
]
|
||||
}),
|
||||
uuid: attr(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user