Skip to content

Commit 12edc4c

Browse files
committed
fix proptypes
1 parent dbb319a commit 12edc4c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/compounds/Document/Document.jsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
33
import { Dropdown, Offcanvas } from 'react-bootstrap'
44
import LineItemsTable from '../../components/LineItemsTable/LineItemsTable'
55
import './document.scss'
6+
import { allowNull } from '../../resources/utilityFunctions'
67

78
const Document = ({ document, addClass }) => {
89
const { adPO, date, documentStatusColor, documentType,
@@ -28,7 +29,7 @@ const Document = ({ document, addClass }) => {
2829
</small>
2930
</div>
3031
<div className='ms-auto p-2'>
31-
<div className='badge p-2' style={{backgroundColor: documentStatusColor}}>
32+
<div className='badge p-2' style={{ backgroundColor: documentStatusColor }}>
3233
{documentStatus}
3334
</div>
3435
</div>
@@ -55,10 +56,9 @@ const Document = ({ document, addClass }) => {
5556
<h5>Details:</h5>
5657
{poNumber && <><b>PO:</b> {poNumber}<br /></>}
5758
{adPO && <><b>AD PO:</b> {identifier}<br /></>}
58-
{documentType === 'SOW' ?
59-
<><b>Proposal:</b> {identifier}</> :
60-
<><b>Related SOW:</b> {relatedSOWIdentifier}</>
61-
}<br />
59+
{documentType === 'SOW'
60+
? <><b>Proposal:</b> {identifier}</>
61+
: <><b>Related SOW:</b> {relatedSOWIdentifier}</>}<br />
6262
<b>Amount:</b> {subtotalPrice}<br />
6363
<b>Request:</b> {requestIdentifier} <br />
6464
<b>Date:</b> {date}<br />
@@ -86,7 +86,7 @@ const Document = ({ document, addClass }) => {
8686
totalPrice={totalPrice}
8787
/>
8888
)}
89-
{turnaroundTime && <><h5><b>Turnaround Time:</b> {turnaroundTime}</h5></>}
89+
{turnaroundTime && <h5><b>Turnaround Time:</b> {turnaroundTime}</h5>}
9090
</Offcanvas.Body>
9191
</Offcanvas>
9292
</>
@@ -97,13 +97,16 @@ const Document = ({ document, addClass }) => {
9797
Document.propTypes = {
9898
addClass: PropTypes.string,
9999
document: PropTypes.shape({
100+
adPO: allowNull(PropTypes.string.isRequired),
100101
identifier: PropTypes.string.isRequired,
101102
date: PropTypes.string.isRequired,
102103
documentStatus: PropTypes.string.isRequired,
103104
documentStatusColor: PropTypes.string,
104105
documentType: PropTypes.string.isRequired,
105106
documentTypeColor: PropTypes.string,
106107
lineItems: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
108+
poNumber: allowNull(PropTypes.string.isRequired),
109+
relatedSOWIdentifier: allowNull(PropTypes.string.isRequired),
107110
requestIdentifier: PropTypes.string.isRequired,
108111
shippingPrice: PropTypes.string.isRequired,
109112
shipTo: PropTypes.shape({
@@ -118,6 +121,7 @@ Document.propTypes = {
118121
taxAmount: PropTypes.string.isRequired,
119122
terms: PropTypes.string.isRequired,
120123
totalPrice: PropTypes.string.isRequired,
124+
turnaroundTime: allowNull(PropTypes.string.isRequired),
121125
}),
122126
}
123127

0 commit comments

Comments
 (0)