Skip to content

Commit

Permalink
Merge pull request #400 from freelawproject/369-feat-capture-attachme…
Browse files Browse the repository at this point in the history
…nt-pages-with-no-footer-form

feat(district): Capture attachment pages with no footer form
  • Loading branch information
mlissner authored Sep 19, 2024
2 parents 009217f + f384bbc commit ef6a852
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
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

0 comments on commit ef6a852

Please sign in to comment.