@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
3
3
import { Dropdown , Offcanvas } from 'react-bootstrap'
4
4
import LineItemsTable from '../../components/LineItemsTable/LineItemsTable'
5
5
import './document.scss'
6
+ import { allowNull } from '../../resources/utilityFunctions'
6
7
7
8
const Document = ( { document, addClass } ) => {
8
9
const { adPO, date, documentStatusColor, documentType,
@@ -28,7 +29,7 @@ const Document = ({ document, addClass }) => {
28
29
</ small >
29
30
</ div >
30
31
< div className = 'ms-auto p-2' >
31
- < div className = 'badge p-2' style = { { backgroundColor : documentStatusColor } } >
32
+ < div className = 'badge p-2' style = { { backgroundColor : documentStatusColor } } >
32
33
{ documentStatus }
33
34
</ div >
34
35
</ div >
@@ -55,10 +56,9 @@ const Document = ({ document, addClass }) => {
55
56
< h5 > Details:</ h5 >
56
57
{ poNumber && < > < b > PO:</ b > { poNumber } < br /> </ > }
57
58
{ 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 />
62
62
< b > Amount:</ b > { subtotalPrice } < br />
63
63
< b > Request:</ b > { requestIdentifier } < br />
64
64
< b > Date:</ b > { date } < br />
@@ -86,7 +86,7 @@ const Document = ({ document, addClass }) => {
86
86
totalPrice = { totalPrice }
87
87
/>
88
88
) }
89
- { turnaroundTime && < > < h5 > < b > Turnaround Time:</ b > { turnaroundTime } </ h5 > </ > }
89
+ { turnaroundTime && < h5 > < b > Turnaround Time:</ b > { turnaroundTime } </ h5 > }
90
90
</ Offcanvas . Body >
91
91
</ Offcanvas >
92
92
</ >
@@ -97,13 +97,16 @@ const Document = ({ document, addClass }) => {
97
97
Document . propTypes = {
98
98
addClass : PropTypes . string ,
99
99
document : PropTypes . shape ( {
100
+ adPO : allowNull ( PropTypes . string . isRequired ) ,
100
101
identifier : PropTypes . string . isRequired ,
101
102
date : PropTypes . string . isRequired ,
102
103
documentStatus : PropTypes . string . isRequired ,
103
104
documentStatusColor : PropTypes . string ,
104
105
documentType : PropTypes . string . isRequired ,
105
106
documentTypeColor : PropTypes . string ,
106
107
lineItems : PropTypes . arrayOf ( PropTypes . shape ( { } ) ) . isRequired ,
108
+ poNumber : allowNull ( PropTypes . string . isRequired ) ,
109
+ relatedSOWIdentifier : allowNull ( PropTypes . string . isRequired ) ,
107
110
requestIdentifier : PropTypes . string . isRequired ,
108
111
shippingPrice : PropTypes . string . isRequired ,
109
112
shipTo : PropTypes . shape ( {
@@ -118,6 +121,7 @@ Document.propTypes = {
118
121
taxAmount : PropTypes . string . isRequired ,
119
122
terms : PropTypes . string . isRequired ,
120
123
totalPrice : PropTypes . string . isRequired ,
124
+ turnaroundTime : allowNull ( PropTypes . string . isRequired ) ,
121
125
} ) ,
122
126
}
123
127
0 commit comments