Skip to content

Commit

Permalink
Merge pull request #299 from flexion/111-irs-dashboard
Browse files Browse the repository at this point in the history
Added Respondent Dashboard
  • Loading branch information
kkoskelin authored Dec 12, 2018
2 parents b48b8cb + ffad95b commit 17e615f
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 6 deletions.
11 changes: 10 additions & 1 deletion web-client/pa11y-ci.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
"http://localhost:1234/log-in?token=intakeclerk&path=/",
"http://localhost:1234/log-in?token=intakeclerk&path=/case-detail/101-18",
"http://localhost:1234/log-in?token=respondent&path=/",
"http://localhost:1234/log-in?token=respondent&path=/case-detail/101-18"
"http://localhost:1234/log-in?token=respondent&path=/case-detail/101-18",
{
"url": "http://localhost:1234/log-in?token=respondent&path=/case-detail/101-18",
"actions": [
"wait for #button-file-document to be visible",
"click element #button-file-document",
"wait for #file-a-document to be visible"
],
"timeout": 5000
}
]
}
2 changes: 2 additions & 0 deletions web-client/src/presenter/computeds/formattedCaseDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ const formatCase = (caseDetail, form) => {

if (result.documents) result.documents.map(formatDocument);

result.createdAtFormatted = moment(result.createdAt).format('L');
result.irsDateFormatted = moment(result.irsDate).format('L LT');
result.payGovDateFormatted = moment(result.payGovDate).format('L');

result.showDocumentStatus = !result.irsSendDate;
result.showIrsServedDate = !!result.irsSendDate;
result.showPayGovIdInput = form.paymentType == 'payGov';
result.showPaymentOptions = !(caseDetail.payGovId && !form.paymentType);
result.showActionRequired = !caseDetail.payGovId;
result.showPaymentRecord = result.payGovId && !form.paymentType;
result.datePetitionSentToIrsMessage = `Respondent served ${
result.irsDateFormatted
Expand Down
10 changes: 9 additions & 1 deletion web-client/src/presenter/sequences/gotoDashboardSequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ const goToDashboard = [
setCurrentPage('DashboardPetitionsClerk'),
],
intakeclerk: [clearAlerts, setCurrentPage('DashboardIntakeClerk')],
respondent: [clearAlerts, setCurrentPage('DashboardRespondent')],
respondent: [
clearAlerts,
getCasesByUser,
{
error: [setAlertError],
success: [setCases],
},
setCurrentPage('DashboardRespondent'),
],
},
];

Expand Down
4 changes: 4 additions & 0 deletions web-client/src/styles/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
color: $color-blue;
}

.action-flag {
color: $color-red;
}

.label {
margin-bottom: 0;
}
Expand Down
4 changes: 4 additions & 0 deletions web-client/src/styles/overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ input[type='file'] {
height: auto;
}

.usa-header .usa-nav-secondary .usa-search {
margin-top: -0.6rem;
}

input[type='text'] {
margin: 0 0 2rem;
}
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/CaseDetailPetitioner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default connect(
<span>
<FontAwesomeIcon
icon="flag"
color="#CD2026"
className="action-flag"
size="sm"
/>{' '}
Pay $60.00 filing fee.
Expand Down
1 change: 1 addition & 0 deletions web-client/src/views/CaseDetailRespondent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default connect(
{currentTab == 'Docket Record' && (
<div className="tab-content" role="tabpanel">
<button
id="button-file-document"
onClick={() =>
updateCurrentTabSequence({ value: 'File Document' })
}
Expand Down
55 changes: 53 additions & 2 deletions web-client/src/views/DashboardRespondent.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,68 @@
import { connect } from '@cerebral/react';
import React from 'react';
import { state } from 'cerebral';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

import SuccessNotification from './SuccessNotification';
import ErrorNotification from './ErrorNotification';

export default connect(
{},
function Dashboard() {
{ caseList: state.formattedCases },
function Dashboard({ caseList }) {
return (
<section className="usa-section usa-grid">
<h1 tabIndex="-1">Respondent Dashboard</h1>
<SuccessNotification />
<ErrorNotification />
<h2>Cases</h2>
<table className="responsive-table" id="workQueue">
<thead>
<tr>
<th>Docket number</th>
<th>Petitioner name</th>
<th>Date filed</th>
<th>Notifications</th>
</tr>
</thead>
<tbody>
{!caseList.length && (
<tr>
<td colSpan="4">(none)</td>
</tr>
)}
{caseList.map(item => (
<tr key={item.docketNumber}>
<td className="responsive-title">
<span className="responsive-label">Docket number</span>
<a href={'/case-detail/' + item.docketNumber}>
{item.docketNumber}
</a>
</td>
<td>
<span className="responsive-label">Petitioner name</span>
{item.userId}
</td>
<td>
<span className="responsive-label">Date filed</span>
{item.createdAtFormatted}
</td>
<td>
<span className="responsive-label">Notification</span>
{item.showActionRequired && (
<span>
<FontAwesomeIcon
icon="flag"
className="action-flag"
size="sm"
/>{' '}
Action Required
</span>
)}
</td>
</tr>
))}
</tbody>
</table>
</section>
);
},
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/FileDocument.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default connect(
submitDocumentSequence();
}}
>
<label htmlFor="options">Document type</label>
<label htmlFor="document-type">Document type</label>
<select
name="documentType"
id="document-type"
Expand Down

0 comments on commit 17e615f

Please sign in to comment.