mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-14 01:41:26 -06:00
[FIX] document_url: Fix Download attachment component
Fix download atachment widget.
Document_url when activated causes error when opening attachment link on the chatter window
This commit (366676cafd
) move download buttons into a sub-component.
I modified the module behavior to use canDownload() method instead of adding a t-if in the view and prevent the chatter component from breaking when the message has attachments.
This commit is contained in:
parent
24004ca1b2
commit
2fb1f655c7
@ -52,6 +52,11 @@ patch(AttachmentList.prototype, {
|
|||||||
*
|
*
|
||||||
* @returns {String}
|
* @returns {String}
|
||||||
*/
|
*/
|
||||||
|
canDownload(attachment) {
|
||||||
|
return (
|
||||||
|
super.canDownload(attachment) && attachment.mimetype != "application/link"
|
||||||
|
);
|
||||||
|
},
|
||||||
get attachmentUrl() {
|
get attachmentUrl() {
|
||||||
return url("/web/content", {
|
return url("/web/content", {
|
||||||
id: this.attachment.id,
|
id: this.attachment.id,
|
||||||
|
@ -30,12 +30,6 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</t>
|
</t>
|
||||||
<t t-inherit="mail.AttachmentList" t-inherit-mode="extension">
|
<t t-inherit="mail.AttachmentList" t-inherit-mode="extension">
|
||||||
<xpath
|
|
||||||
expr="//div[contains(@class, 'o-mail-AttachmentCard-aside')]//button[@title='Download']"
|
|
||||||
position="attributes"
|
|
||||||
>
|
|
||||||
<attribute name="t-if">attachment.mimetype != 'application/link'</attribute>
|
|
||||||
</xpath>
|
|
||||||
<xpath
|
<xpath
|
||||||
expr="//div[hasclass('o-mail-AttachmentCard-aside')]//button[@title='Download']"
|
expr="//div[hasclass('o-mail-AttachmentCard-aside')]//button[@title='Download']"
|
||||||
position="after"
|
position="after"
|
||||||
|
Loading…
Reference in New Issue
Block a user