From 67279d23db0569a5b87e6ad10580f3a8477baaf0 Mon Sep 17 00:00:00 2001 From: Eduardo Rosendo Date: Mon, 27 May 2024 17:50:20 -0400 Subject: [PATCH 1/2] feat(acms): Adds logic to display the warning about combined PDFs --- src/appellate/appellate.js | 17 ++++++++++++++++- src/assets/css/style.css | 6 ++++++ src/utils.js | 8 +++++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/appellate/appellate.js b/src/appellate/appellate.js index f2d16187..738189a6 100644 --- a/src/appellate/appellate.js +++ b/src/appellate/appellate.js @@ -375,7 +375,22 @@ AppellateDelegate.prototype.handleAcmsDownloadPage = async function () { .toLowerCase() .includes('accept charges and retrieve'); - if (n.localName === 'div' && hasReceipt && hasAcceptChargesButton) { + let hasOneDocument = JSON.parse( + sessionStorage.selectedDocuments + ).length == 1; + + if ( + n.localName === 'div' && + hasReceipt && + hasAcceptChargesButton + ) { + + if (!hasOneDocument){ + pdfWarning = combinedPdfWarning(); + n.append(pdfWarning); + return; + } + // Insert script to retrieve and store Vue data in the storage APPELLATE.storeVueDataInSession(); diff --git a/src/assets/css/style.css b/src/assets/css/style.css index c173b105..a4c737c4 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -196,6 +196,12 @@ footer #version { font-size: 13px; } +.recap-combined-pdf-text { + display: flex; + align-content: center; + text-align: justify; +} + .recap-banner, .recap-popup, .recap-email-banner { diff --git a/src/utils.js b/src/utils.js index 0030d4d3..837050d2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -424,11 +424,13 @@ const combinedPdfWarning = () => { imgDiv.appendChild(img); let text = document.createElement('p'); - text.innerHTML = `This document will not be uploaded to the RECAP Archive because the extension has detected that this page may return a combined PDF and consistently splitting these files in a proper manner is not possible for now.`; + text.innerHTML = 'This document will not be uploaded to the RECAP' + + 'Archive because the extension has detected that this page may return' + + 'a combined PDF and consistently splitting these files in a proper manner' + + 'is not possible for now.'; let messageDiv = document.createElement('div'); - messageDiv.style.display = 'flex'; - messageDiv.style.alignContent = 'center'; + messageDiv.classList.add('recap-combined-pdf-text'); messageDiv.appendChild(text); let innerDiv = document.createElement('div'); From c6a270670e35944b58df35b9448fc713273ecc4c Mon Sep 17 00:00:00 2001 From: Eduardo Rosendo Date: Mon, 27 May 2024 18:05:58 -0400 Subject: [PATCH 2/2] feat(docs): Changelog Update --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 0945f220..4e2902a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Features: - Docket reports from ACMS are now uploaded to CourtListener.([#372](https://github.com/freelawproject/recap-chrome/pull/372)) - Adds logic to upload ACMS PDF documents to CourtListener. ([#373](https://github.com/freelawproject/recap-chrome/pull/373)) - Inserts the RECAP button and [R] icons to the ACMS Docket report. ([#374](https://github.com/freelawproject/recap-chrome/pull/374)) + - Displays the warning about combined PDFs on the download page.([#376](https://github.com/freelawproject/recap-chrome/pull/376)) Changes: - None yet