diff --git a/shared/src/business/useCases/createCaseFromPaperInteractor.js b/shared/src/business/useCases/createCaseFromPaperInteractor.js index ca325a3d2ea..5d6346d1c7b 100644 --- a/shared/src/business/useCases/createCaseFromPaperInteractor.js +++ b/shared/src/business/useCases/createCaseFromPaperInteractor.js @@ -100,6 +100,7 @@ exports.createCaseFromPaper = async ({ documentId: petitionFileId, documentType: Case.documentTypes.petitionFile, filedBy: caseCaptionNames, + isPaper: true, userId: user.userId, }); const newWorkItem = addPetitionDocumentWithWorkItemToCase( @@ -114,6 +115,7 @@ exports.createCaseFromPaper = async ({ documentId: stinFileId, documentType: Case.documentTypes.stin, filedBy: caseCaptionNames, + isPaper: true, userId: user.userId, }); caseToAdd.addDocumentWithoutDocketRecord(stinDocumentEntity); @@ -125,6 +127,7 @@ exports.createCaseFromPaper = async ({ documentId: ownershipDisclosureFileId, documentType: Case.documentTypes.ownershipDisclosure, filedBy: caseCaptionNames, + isPaper: true, userId: user.userId, }); caseToAdd.addDocument(odsDocumentEntity); diff --git a/web-client/src/app.jsx b/web-client/src/app.jsx index 872a6fdd08b..c1800de487f 100644 --- a/web-client/src/app.jsx +++ b/web-client/src/app.jsx @@ -17,6 +17,7 @@ import { faDollarSign, faEdit as faEditSolid, faExclamationTriangle, + faFileAlt as faFileAltSolid, faFilePdf, faFlag, faLaptop, @@ -81,6 +82,7 @@ const app = { faFlag, faLaptop, faFileAlt, + faFileAltSolid, faListUl, faPaperclip, faPlusCircle, diff --git a/web-client/src/presenter/computeds/formattedCaseDetail.js b/web-client/src/presenter/computeds/formattedCaseDetail.js index e8086f8f0d9..9f655effc85 100644 --- a/web-client/src/presenter/computeds/formattedCaseDetail.js +++ b/web-client/src/presenter/computeds/formattedCaseDetail.js @@ -15,6 +15,7 @@ export const formatDocument = document => { export const formatDocketRecord = docketRecord => { const result = _.cloneDeep(docketRecord); result.createdAtFormatted = moment.utc(result.filingDate).format('L'); + return result; }; @@ -82,7 +83,11 @@ export const formatYearAmounts = (caseDetail, caseDetailErrors = {}) => { } }; -const formatDocketRecordWithDocument = (docketRecords = [], documents = []) => { +const formatDocketRecordWithDocument = ( + docketRecords = [], + documents = [], + caseDetail, +) => { const documentMap = documents.reduce((acc, document) => { acc[document.documentId] = document; return acc; @@ -93,7 +98,64 @@ const formatDocketRecordWithDocument = (docketRecords = [], documents = []) => { if (record.documentId) { document = documentMap[record.documentId]; + + if (document.certificateOfServiceDate) { + document.certificateOfServiceDateFormatted = moment + .utc(document.certificateOfServiceDate) + .format('L'); + } + + //filings and proceedings string + //(C/S 04/17/2019) (Exhibit(s)) (Attachment(s)) (Objection) (Lodged) + const filingsAndProceedingsArray = [ + `${ + document.certificateOfService + ? `(C/S ${document.certificateOfServiceDateFormatted})` + : '' + }`, + `${document.exhibits ? '(Exhibit(s))' : ''}`, + `${document.attachments ? '(Attachment(s))' : ''}`, + `${ + document.objections === 'Yes' + ? '(Objection)' + : document.objections === 'No' + ? '(No Objection)' + : '' + }`, + `${document.lodged ? '(Lodged)' : ''}`, + ]; + record.filingsAndProceedings = filingsAndProceedingsArray + .filter(item => item !== '') + .join(' '); + + if (!document.filedBy) { + let filedByString = ''; + if (document.partyRespondent) { + filedByString = 'Resp.'; + if (document.partyPrimary || document.partySecondary) { + filedByString += ' & '; + } + } + if ( + document.partyPrimary && + !document.partySecondary && + caseDetail.contactPrimary + ) { + filedByString += `Petr. ${caseDetail.contactPrimary.name}`; + } else if ( + document.partyPrimary && + document.partySecondary && + caseDetail.contactPrimary && + caseDetail.contactSecondary + ) { + filedByString += `Petrs. ${caseDetail.contactPrimary.name} & ${ + caseDetail.contactSecondary.name + }`; + } + document.filedBy = filedByString; + } } + return { document, index, record }; }); }; @@ -108,6 +170,7 @@ const formatCase = (caseDetail, caseDetailErrors, documentTypesMap) => { result.docketRecordWithDocument = formatDocketRecordWithDocument( result.docketRecord, result.documents, + caseDetail, ); } diff --git a/web-client/src/presenter/computeds/formattedCaseDetail.test.js b/web-client/src/presenter/computeds/formattedCaseDetail.test.js index 5e6c2ececac..d0a5fa6c8e9 100644 --- a/web-client/src/presenter/computeds/formattedCaseDetail.test.js +++ b/web-client/src/presenter/computeds/formattedCaseDetail.test.js @@ -248,6 +248,161 @@ describe('formatYearAmounts', () => { ); }); + it('formats docket record document data strings correctly', async () => { + const caseDetail = { + caseCaption: 'Brett Osborne, Petitioner', + contactPrimary: { + name: 'Bob', + }, + contactSecondary: { + name: 'Bill', + }, + docketRecord: [ + { + description: 'Amended Petition', + documentId: '88cd2c25-b8fa-4dc0-bfb6-57245c86bb0d', + filingDate: '2019-04-19T17:29:13.120Z', + }, + { + description: + 'First Amended Unsworn Declaration under Penalty of Perjury in Support', + documentId: 'c501a558-7632-497e-87c1-0c5f39f66718', + filingDate: '2019-04-19T18:24:09.515Z', + }, + { + description: + 'Motion for Leave to File Computation for Entry of Decision', + documentId: '362baeaf-7692-4b04-878b-2946dcfa26ee', + filingDate: '2019-04-19T17:39:10.476Z', + }, + { + description: + 'Unsworn Declaration of Test under Penalty of Perjury in Support of Amended Petition', + documentId: '3ac23dd8-b0c4-4538-86e1-52b715f54838', + filingDate: '2019-04-19T17:29:13.122Z', + }, + ], + documents: [ + { + attachments: false, + category: 'Petition', + certificateOfService: false, + createdAt: '2019-04-19T17:29:13.120Z', + documentId: '88cd2c25-b8fa-4dc0-bfb6-57245c86bb0d', + documentTitle: 'Amended Petition', + documentType: 'Amended Petition', + eventCode: 'PAP', + exhibits: false, + hasSupportingDocuments: true, + partyPrimary: true, + relationship: 'primaryDocument', + scenario: 'Standard', + supportingDocument: + 'Unsworn Declaration under Penalty of Perjury in Support', + supportingDocumentFreeText: 'Test', + }, + { + attachments: false, + category: 'Miscellaneous', + certificateOfService: false, + createdAt: '2019-04-19T18:24:09.515Z', + documentId: 'c501a558-7632-497e-87c1-0c5f39f66718', + documentTitle: + 'First Amended Unsworn Declaration under Penalty of Perjury in Support', + documentType: 'Amended', + eventCode: 'ADED', + exhibits: true, + hasSupportingDocuments: true, + ordinalValue: 'First', + partyPrimary: true, + partyRespondent: true, + previousDocument: + 'Unsworn Declaration under Penalty of Perjury in Support', + relationship: 'primaryDocument', + scenario: 'Nonstandard F', + supportingDocument: 'Brief in Support', + supportingDocumentFreeText: null, + }, + { + attachments: true, + category: 'Motion', + certificateOfService: true, + certificateOfServiceDate: '2018-06-07', + certificateOfServiceDay: '7', + certificateOfServiceMonth: '6', + certificateOfServiceYear: '2018', + createdAt: '2019-04-19T17:39:10.476Z', + documentId: '362baeaf-7692-4b04-878b-2946dcfa26ee', + documentTitle: + 'Motion for Leave to File Computation for Entry of Decision', + documentType: 'Motion for Leave to File', + eventCode: 'M115', + exhibits: true, + hasSecondarySupportingDocuments: false, + hasSupportingDocuments: true, + objections: 'Yes', + partyPrimary: true, + relationship: 'primaryDocument', + scenario: 'Nonstandard H', + secondarySupportingDocument: null, + secondarySupportingDocumentFreeText: null, + supportingDocument: 'Declaration in Support', + supportingDocumentFreeText: 'Rachael', + }, + { + category: 'Supporting Document', + createdAt: '2019-04-19T17:29:13.122Z', + documentId: '3ac23dd8-b0c4-4538-86e1-52b715f54838', + documentTitle: + 'Unsworn Declaration of Test under Penalty of Perjury in Support of Amended Petition', + documentType: + 'Unsworn Declaration under Penalty of Perjury in Support', + eventCode: 'USDL', + freeText: 'Test', + partyPrimary: true, + partySecondary: true, + previousDocument: 'Amended Petition', + relationship: 'primarySupportingDocument', + scenario: 'Nonstandard C', + }, + ], + hasIrsNotice: false, + hasVerifiedIrsNotice: false, + petitioners: [{ name: 'bob' }], + }; + const result = await runCompute(formattedCaseDetail, { + state: { + caseDetail, + caseDetailErrors: {}, + constants, + }, + }); + expect(result.docketRecordWithDocument[0].document.filedBy).toEqual( + 'Petr. Bob', + ); + expect( + result.docketRecordWithDocument[0].record.filingsAndProceedings, + ).toEqual(''); + expect(result.docketRecordWithDocument[1].document.filedBy).toEqual( + 'Resp. & Petr. Bob', + ); + expect( + result.docketRecordWithDocument[1].record.filingsAndProceedings, + ).toEqual('(Exhibit(s))'); + expect(result.docketRecordWithDocument[2].document.filedBy).toEqual( + 'Petr. Bob', + ); + expect( + result.docketRecordWithDocument[2].record.filingsAndProceedings, + ).toEqual('(C/S 06/07/2018) (Exhibit(s)) (Attachment(s)) (Objection)'); + expect(result.docketRecordWithDocument[3].document.filedBy).toEqual( + 'Petrs. Bob & Bill', + ); + expect( + result.docketRecordWithDocument[3].record.filingsAndProceedings, + ).toEqual(''); + }); + it('sorts the docket record in the expected order', async () => { const caseDetail = { caseCaption: 'Brett Osborne, Petitioner', diff --git a/web-client/src/styles/tables.scss b/web-client/src/styles/tables.scss index 682f60b8e29..05f68d1a7b5 100644 --- a/web-client/src/styles/tables.scss +++ b/web-client/src/styles/tables.scss @@ -219,10 +219,6 @@ table#docket-record { .hide-on-mobile { display: none; } - - td { - min-height: 65px; - } } } diff --git a/web-client/src/views/DocketRecord.jsx b/web-client/src/views/DocketRecord.jsx index ae12b451c2f..22d0e1589f2 100644 --- a/web-client/src/views/DocketRecord.jsx +++ b/web-client/src/views/DocketRecord.jsx @@ -13,7 +13,7 @@ export const DocketRecord = connect( token: state.token, }, ({ baseUrl, caseDetail, documentHelper, helper, token }) => { - function renderDocumentLink(documentId, description) { + function renderDocumentLink(documentId, description, isPaper) { return ( - - - + {isPaper && ( + + + + )} {description} ); @@ -52,7 +54,7 @@ export const DocketRecord = connect( Event Filings and Proceedings - Filed by + Filed By Action Served Parties @@ -74,10 +76,12 @@ export const DocketRecord = connect( Event - CODE + {document && document.eventCode} - + {document && document.isPaper && ( + + )} @@ -88,6 +92,7 @@ export const DocketRecord = connect( renderDocumentLink( document.documentId, record.description, + document.isPaper, )} {document && helper.showDocumentDetailLink && ( - - - + {document && document.isPaper && ( + + + + )} {record.description} )} @@ -107,6 +114,8 @@ export const DocketRecord = connect( record.documentId && renderDocumentLink(record.documentId, record.description)} {!document && !record.documentId && record.description} + {record.filingsAndProceedings && + ` ${record.filingsAndProceedings}`} Filed by @@ -127,6 +136,7 @@ export const DocketRecord = connect( Parties + {record.servedParties} ),