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

Added Respondent Dashboard #299

Merged
merged 7 commits into from
Dec 12, 2018
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
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;
kkoskelin marked this conversation as resolved.
Show resolved Hide resolved
}

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