From 9cee25439959ec3f401a41e89b70e85e115bdac1 Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Thu, 19 Dec 2024 14:54:53 -0800 Subject: [PATCH] fix: remove PDF in new tab feature Our CSPs don't allow it and we need something that works until we figure it out squash: last --- .../messages/RequestConversations.vue | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/messages/RequestConversations.vue b/frontend/src/components/messages/RequestConversations.vue index a39fd2b2..79aa8c1b 100644 --- a/frontend/src/components/messages/RequestConversations.vue +++ b/frontend/src/components/messages/RequestConversations.vue @@ -67,7 +67,7 @@ Sent: {{ format.formatDate(item.sentDate) }} -
+
@@ -209,16 +209,6 @@ export default { deriveFromDisplay(item) { return item.ofmSourceSystem ? `${this.userInfo?.firstName ?? ''} ${this.userInfo?.lastName}` : OFM_PROGRAM }, - handlePdf(event) { - if (event.target.classList.contains('conversation-pdf')) { - fetch(event.target.dataset.link) - .then((res) => res.blob()) - .then((blob) => { - const blobUrl = URL.createObjectURL(blob) - window.open(blobUrl) - }) - } - }, async formatConversation() { const parser = new DOMParser() for (const conversation of this.assistanceRequestConversation) { @@ -246,14 +236,8 @@ export default { const file = await FileService.getFile(fileId) const dataLink = `data:${file.mimetype};base64,${file.fileData}` - if (file.mimetype === 'application/pdf') { - fileLink.setAttribute('href', '#') - fileLink.classList.add('conversation-pdf') - fileLink.setAttribute('data-link', dataLink) - } else { - fileLink.setAttribute('href', dataLink) - fileLink.setAttribute('download', file.filename) - } + fileLink.setAttribute('href', dataLink) + fileLink.setAttribute('download', file.filename) } else { fileLink.remove() }