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(district): Capture attachment pages with no footer form #400

Merged
merged 2 commits into from
Sep 19, 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 @@ -12,6 +12,7 @@ Changes:

Fixes:
- Corrected typo in build script, ensuring correct favicon path for Firefox releases([379](https://github.com/freelawproject/recap/issues/379), [397](https://github.com/freelawproject/recap-chrome/pull/397))
- Improves the reliability of PACER case ID retrieval on attachment pages ([369](https://github.com/freelawproject/recap/issues/369), [400](https://github.com/freelawproject/recap-chrome/pull/400)).

For developers:
- Nothing yet
Expand Down
7 changes: 4 additions & 3 deletions spec/PacerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ describe('The PACER module', function () {
});

describe('getDocumentIdFronForm', function () {
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','');";
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','','','');";
let form;
beforeEach(function () {
form = document.createElement('form');
Expand Down Expand Up @@ -477,7 +477,7 @@ describe('The PACER module', function () {
});

describe('getCaseNumberFromInputs', function () {
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','');";
const goDLS = "goDLS('/doc1/09518360046','153992','264','','','1','','','');";
const input = document.createElement('input');

beforeEach(function () {
Expand Down Expand Up @@ -516,7 +516,7 @@ describe('The PACER module', function () {

describe('parseGoDLSFunction', function () {
it('gets the right values for an example DLS string', function () {
let goDLSSampleString = "goDLS('/doc1/09518360046','153992','264','','','1','',''); " + 'return(false);';
let goDLSSampleString = "goDLS('/doc1/09518360046','153992','264','','','1','','',''); " + 'return(false);';
expect(PACER.parseGoDLSFunction(goDLSSampleString)).toEqual({
hyperlink: '/doc1/09518360046',
de_caseid: '153992',
Expand All @@ -526,6 +526,7 @@ describe('The PACER module', function () {
pdf_toggle_possible: '1',
magic_num: '',
hdr: '',
psf_report: '',
});
});

Expand Down
9 changes: 9 additions & 0 deletions src/content_delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,15 @@ ContentDelegate.prototype.handleAttachmentMenuPage = async function () {
return;
}

if (!this.pacer_case_id)
this.pacer_case_id = await getPacerCaseIdFromPacerDocId(
this.tabId,
this.pacer_doc_id
);

// If we don't have this.pacer_case_id at this point, punt.
if (!this.pacer_case_id) return;

const upload = await dispatchBackgroundFetch({
action: 'upload',
data: {
Expand Down
8 changes: 4 additions & 4 deletions src/pacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@ let PACER = {
// https://ecf.flnd.uscourts.gov/lib/dls_url.js
// as:
// function goDLS(hyperlink, de_caseid, de_seqno, got_receipt,
// pdf_header, pdf_toggle_possible, magic_num, hdr)
// pdf_header, pdf_toggle_possible, magic_num, hdr, psf_report)
//
// Bankruptcy courts provide ten parameters, instead of eight. These can
// Bankruptcy courts provide ten parameters, instead of nine. These can
// be found in unminified js:
// https://ecf.paeb.uscourts.gov/lib/dls_url.js
// as:
Expand All @@ -548,15 +548,15 @@ let PACER = {
// Δ:
// - hdr
// + claim_id, claim_num, claim_doc_seq
let goDlsDistrict = /^goDLS\('([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)'\)/.exec(goDLS_string);
let goDlsDistrict = /^goDLS\('([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)'\)/.exec(goDLS_string);
let goDlsBankr= /^goDLS\('([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)','([^']*)'\)/.exec(goDLS_string);
if (!goDlsDistrict && !goDlsBankr) {
return null;
}
let r = {};
if (goDlsDistrict){
[, r.hyperlink, r.de_caseid, r.de_seqno, r.got_receipt, r.pdf_header,
r.pdf_toggle_possible, r.magic_num, r.hdr] = goDlsDistrict;
r.pdf_toggle_possible, r.magic_num, r.hdr, r.psf_report] = goDlsDistrict;
} else {
[, r.hyperlink, r.de_caseid, r.de_seqno, r.got_receipt, r.pdf_header,
r.pdf_toggle_possible, r.magic_num, r.claim_id, r.claim_num,
Expand Down
Loading