Skip to content

Commit

Permalink
Merge pull request #1459 from flexion/937-mobile-tables
Browse files Browse the repository at this point in the history
937: show 2 view options for docket record table on mobile (temporarily)
  • Loading branch information
rachaelparris authored Apr 22, 2019
2 parents d3aad2e + 2b84abf commit e62991c
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web-client/cypress/integration/file-a-petition.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe('can view case detail', () => {
});

it('shows docket record table and data', () => {
cy.get('table#docket-record tbody tr').should('exist');
cy.get('table.docket-record tbody tr').should('exist');
});

it('accordion header expands/collapses', () => {
Expand Down
14 changes: 13 additions & 1 deletion web-client/src/styles/tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,25 @@ table.work-queue {
overflow-y: scroll;
}

table#docket-record {
@media only screen and (max-width: $medium-screen - 1px) {
.scrollable-table-container-mobile {
overflow: scroll;
max-height: 500px;
margin-top: 300px;
}
}

table.docket-record {
thead th {
font-weight: $font-semibold;
}

/* big screens */
@media only screen and (min-width: $medium-screen) {
&.mobile-only-extra-table {
display: none;
}

.center-column {
text-align: center;
}
Expand Down
104 changes: 102 additions & 2 deletions web-client/src/views/DocketRecord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export const DocketRecord = connect(
)}
<div className="scrollable-table-container">
<table
className="responsive-table row-border-only"
id="docket-record"
className="docket-record responsive-table row-border-only"
aria-label="docket record"
>
<thead>
Expand Down Expand Up @@ -188,6 +187,107 @@ export const DocketRecord = connect(
</tbody>
</table>
</div>

<div className="scrollable-table-container-mobile">
<table
className="docket-record mobile-only-extra-table row-border-only"
aria-label="docket record"
>
<thead>
<tr>
<th className="center-column">No.</th>
<th>Date</th>
<th className="center-column">Event</th>
<th className="icon-column" />
<th>Filings and Proceedings</th>
<th>Filed By</th>
<th>Action</th>
<th>Served</th>
<th className="center-column">Parties</th>
</tr>
</thead>
<tbody>
{caseDetail.docketRecordWithDocument.map(
({ record, document, index }) => (
<tr key={index}>
<td className="center-column">{index + 1}</td>
<td>{record.createdAtFormatted}</td>
<td className="center-column">
{document && document.eventCode}
</td>
<td className="filing-type-icon">
{document && document.isPaper && (
<FontAwesomeIcon icon={['fas', 'file-alt']} />
)}
{document &&
helper.showDirectDownloadLink &&
document.processingStatus !== 'complete' && (
<FontAwesomeIcon
icon="spinner"
className="fa-spin spinner"
/>
)}
</td>
<td>
{document &&
helper.showDirectDownloadLink &&
document.processingStatus === 'complete' &&
renderDocumentLink(
document.documentId,
record.description,
document.isPaper,
)}
{document &&
helper.showDirectDownloadLink &&
document.processingStatus !== 'complete' && (
<React.Fragment>
<span
className="usa-label-uploading"
aria-label="document uploading marker"
>
<span aria-hidden="true">Uploading</span>
</span>
{record.description}
</React.Fragment>
)}
{document && helper.showDocumentDetailLink && (
<a
href={documentHelper({
docketNumber: caseDetail.docketNumber,
documentId: document.documentId,
})}
aria-label="View PDF"
>
{record.description}
</a>
)}
{!document &&
record.documentId &&
renderDocumentLink(
record.documentId,
record.description,
)}
{!document && !record.documentId && record.description}
{record.filingsAndProceedings &&
` ${record.filingsAndProceedings}`}
</td>
<td>{document && document.filedBy}</td>
<td>{record.action}</td>
<td>
{document && document.isStatusServed && (
<span>{caseDetail.datePetitionSentToIrsMessage}</span>
)}
{document && helper.showDocumentStatus && (
<span>{document.status}</span>
)}
</td>
<td className="center-column">{record.servedParties}</td>
</tr>
),
)}
</tbody>
</table>
</div>
</React.Fragment>
);
},
Expand Down

0 comments on commit e62991c

Please sign in to comment.