@@ -3,13 +3,13 @@ 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'
7
6
8
7
const Document = ( { document, addClass } ) => {
9
- const { adPO, date, documentStatusColor, documentType,
10
- documentTypeColor, documentStatus, identifier, lineItems, poNumber, relatedSOWIdentifier, requestIdentifier,
11
- shippingPrice, shipTo, shipFrom, subtotalPrice,
12
- taxAmount, terms, totalPrice, turnaroundTime } = document
8
+ const {
9
+ adPO, date, documentStatusColor, documentType, documentTypeColor, documentStatus, identifier, lineItems, poNumber,
10
+ relatedSOWIdentifier, requestIdentifier, shippingPrice, shipTo, shipFrom, subtotalPrice, taxAmount, terms, totalPrice,
11
+ turnaroundTime,
12
+ } = document
13
13
const [ show , setShow ] = useState ( false )
14
14
const handleClose = ( ) => setShow ( false )
15
15
const handleShow = ( ) => setShow ( true )
@@ -76,16 +76,13 @@ const Document = ({ document, addClass }) => {
76
76
< div className = 'address' > { shipFrom . text } </ div >
77
77
</ div >
78
78
</ div >
79
- { lineItems
80
- && (
81
- < LineItemsTable
82
- lineItems = { lineItems }
83
- subtotalPrice = { subtotalPrice }
84
- taxAmount = { taxAmount }
85
- shippingPrice = { shippingPrice }
86
- totalPrice = { totalPrice }
87
- />
88
- ) }
79
+ < LineItemsTable
80
+ lineItems = { lineItems }
81
+ subtotalPrice = { subtotalPrice }
82
+ taxAmount = { taxAmount }
83
+ shippingPrice = { shippingPrice }
84
+ totalPrice = { totalPrice }
85
+ />
89
86
{ turnaroundTime && < h5 > < b > Turnaround Time:</ b > { turnaroundTime } </ h5 > }
90
87
</ Offcanvas . Body >
91
88
</ Offcanvas >
@@ -97,16 +94,16 @@ const Document = ({ document, addClass }) => {
97
94
Document . propTypes = {
98
95
addClass : PropTypes . string ,
99
96
document : PropTypes . shape ( {
100
- adPO : allowNull ( PropTypes . string . isRequired ) ,
97
+ adPO : PropTypes . string ,
101
98
identifier : PropTypes . string . isRequired ,
102
99
date : PropTypes . string . isRequired ,
103
100
documentStatus : PropTypes . string . isRequired ,
104
101
documentStatusColor : PropTypes . string ,
105
102
documentType : PropTypes . string . isRequired ,
106
103
documentTypeColor : PropTypes . string ,
107
104
lineItems : PropTypes . arrayOf ( PropTypes . shape ( { } ) ) . isRequired ,
108
- poNumber : allowNull ( PropTypes . string . isRequired ) ,
109
- relatedSOWIdentifier : allowNull ( PropTypes . string . isRequired ) ,
105
+ poNumber : PropTypes . string ,
106
+ relatedSOWIdentifier : PropTypes . string ,
110
107
requestIdentifier : PropTypes . string . isRequired ,
111
108
shippingPrice : PropTypes . string . isRequired ,
112
109
shipTo : PropTypes . shape ( {
@@ -121,7 +118,7 @@ Document.propTypes = {
121
118
taxAmount : PropTypes . string . isRequired ,
122
119
terms : PropTypes . string . isRequired ,
123
120
totalPrice : PropTypes . string . isRequired ,
124
- turnaroundTime : allowNull ( PropTypes . string . isRequired ) ,
121
+ turnaroundTime : PropTypes . string ,
125
122
} ) ,
126
123
}
127
124
0 commit comments