@@ -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,8 +76,7 @@ const Document = ({ document, addClass }) => {
76
76
< div className = 'address' > { shipFrom . text } </ div >
77
77
</ div >
78
78
</ div >
79
- { lineItems
80
- && (
79
+ { lineItems && (
81
80
< LineItemsTable
82
81
lineItems = { lineItems }
83
82
subtotalPrice = { subtotalPrice }
@@ -97,16 +96,16 @@ const Document = ({ document, addClass }) => {
97
96
Document . propTypes = {
98
97
addClass : PropTypes . string ,
99
98
document : PropTypes . shape ( {
100
- adPO : allowNull ( PropTypes . string . isRequired ) ,
99
+ adPO : PropTypes . string ,
101
100
identifier : PropTypes . string . isRequired ,
102
101
date : PropTypes . string . isRequired ,
103
102
documentStatus : PropTypes . string . isRequired ,
104
103
documentStatusColor : PropTypes . string ,
105
104
documentType : PropTypes . string . isRequired ,
106
105
documentTypeColor : PropTypes . string ,
107
106
lineItems : PropTypes . arrayOf ( PropTypes . shape ( { } ) ) . isRequired ,
108
- poNumber : allowNull ( PropTypes . string . isRequired ) ,
109
- relatedSOWIdentifier : allowNull ( PropTypes . string . isRequired ) ,
107
+ poNumber : PropTypes . string ,
108
+ relatedSOWIdentifier : PropTypes . string ,
110
109
requestIdentifier : PropTypes . string . isRequired ,
111
110
shippingPrice : PropTypes . string . isRequired ,
112
111
shipTo : PropTypes . shape ( {
@@ -121,7 +120,7 @@ Document.propTypes = {
121
120
taxAmount : PropTypes . string . isRequired ,
122
121
terms : PropTypes . string . isRequired ,
123
122
totalPrice : PropTypes . string . isRequired ,
124
- turnaroundTime : allowNull ( PropTypes . string . isRequired ) ,
123
+ turnaroundTime : PropTypes . string ,
125
124
} ) ,
126
125
}
127
126
0 commit comments