Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(acms): Adds logic to display the warning about combined PDFs #376

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
- Introduces logic to upload ACMS attachment pages to CourtListener([#375](https://github.com/freelawproject/recap-chrome/pull/375))

Changes:
Expand Down
17 changes: 16 additions & 1 deletion src/appellate/appellate.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,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();

Expand Down
6 changes: 6 additions & 0 deletions src/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,13 @@ const combinedPdfWarning = () => {
imgDiv.appendChild(img);

let text = document.createElement('p');
text.innerHTML = `This document <b>will not be uploaded</b> 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 <b>will not be uploaded</b> 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');
Expand Down
Loading