From 99d87b13f67553fc0e3c37f0d10d834541c88b30 Mon Sep 17 00:00:00 2001 From: Summer Cook Date: Fri, 3 Mar 2023 10:43:59 -0500 Subject: [PATCH 1/6] add data-cy to the statusbar --- src/components/StatusBar/StatusBar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/StatusBar/StatusBar.jsx b/src/components/StatusBar/StatusBar.jsx index 7b31319..c64ae09 100644 --- a/src/components/StatusBar/StatusBar.jsx +++ b/src/components/StatusBar/StatusBar.jsx @@ -16,7 +16,7 @@ const StatusBar = ({ backgroundColor, statusArray, apiRequestStatus, addClass }) return (
-
+
{statusArray.map((statusObject, index) => { const { statusLabel, statusIcon } = statusObject const border = index !== statusArray.length - 1 ? 'border-end' : '' From 052a4183ddf4a5c615619c97740c2f5ff6d8b74e Mon Sep 17 00:00:00 2001 From: Summer Cook Date: Mon, 6 Mar 2023 14:49:13 -0500 Subject: [PATCH 2/6] add the correct properties to the document --- src/compounds/Document/Document.jsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/compounds/Document/Document.jsx b/src/compounds/Document/Document.jsx index dba368b..587336e 100644 --- a/src/compounds/Document/Document.jsx +++ b/src/compounds/Document/Document.jsx @@ -5,10 +5,10 @@ import LineItemsTable from '../../components/LineItemsTable/LineItemsTable' import './document.scss' const Document = ({ document, addClass }) => { - const { identifier, date, documentStatusColor, documentType, - documentTypeColor, documentStatus, lineItems, requestIdentifier, + const { adPO, date, documentStatusColor, documentType, + documentTypeColor, documentStatus, identifier, lineItems, poNumber, relatedSOWIdentifier, requestIdentifier, shippingPrice, shipTo, shipFrom, subtotalPrice, - taxAmount, terms, totalPrice } = document + taxAmount, terms, totalPrice, turnaroundTime } = document const [show, setShow] = useState(false) const handleClose = () => setShow(false) const handleShow = () => setShow(true) @@ -52,8 +52,13 @@ const Document = ({ document, addClass }) => {
-
Details:
- Proposal: {identifier}
+
Details:
+ {poNumber && <>PO: {poNumber}
} + {adPO && <>AD PO: {identifier}
} + {documentType === 'SOW' ? + <>Proposal: {identifier} : + <>Related SOW: {relatedSOWIdentifier} + }
Amount: {subtotalPrice}
Request: {requestIdentifier}
Date: {date}
@@ -81,6 +86,7 @@ const Document = ({ document, addClass }) => { totalPrice={totalPrice} /> )} + {turnaroundTime && <>
Turnaround Time: {turnaroundTime}
} From dbb319a7051ee2875a3247f84bfcbe7f73239772 Mon Sep 17 00:00:00 2001 From: Summer Cook Date: Mon, 6 Mar 2023 14:52:50 -0500 Subject: [PATCH 3/6] use the poNumber in place of the identifier for POs to match the marketplace --- src/compounds/Document/Document.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compounds/Document/Document.jsx b/src/compounds/Document/Document.jsx index 587336e..5f77823 100644 --- a/src/compounds/Document/Document.jsx +++ b/src/compounds/Document/Document.jsx @@ -21,7 +21,7 @@ const Document = ({ document, addClass }) => { {documentType}
- {identifier}: {subtotalPrice} + {(documentType === 'SOW') ? identifier : poNumber}: {subtotalPrice}
{date} From 12edc4c7c8732430b6b61ed7dc6b66f80314d8e2 Mon Sep 17 00:00:00 2001 From: Summer Cook Date: Mon, 6 Mar 2023 15:04:24 -0500 Subject: [PATCH 4/6] fix proptypes --- src/compounds/Document/Document.jsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/compounds/Document/Document.jsx b/src/compounds/Document/Document.jsx index 5f77823..53e95e4 100644 --- a/src/compounds/Document/Document.jsx +++ b/src/compounds/Document/Document.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import { Dropdown, Offcanvas } from 'react-bootstrap' import LineItemsTable from '../../components/LineItemsTable/LineItemsTable' import './document.scss' +import { allowNull } from '../../resources/utilityFunctions' const Document = ({ document, addClass }) => { const { adPO, date, documentStatusColor, documentType, @@ -28,7 +29,7 @@ const Document = ({ document, addClass }) => {
-
+
{documentStatus}
@@ -55,10 +56,9 @@ const Document = ({ document, addClass }) => {
Details:
{poNumber && <>PO: {poNumber}
} {adPO && <>AD PO: {identifier}
} - {documentType === 'SOW' ? - <>Proposal: {identifier} : - <>Related SOW: {relatedSOWIdentifier} - }
+ {documentType === 'SOW' + ? <>Proposal: {identifier} + : <>Related SOW: {relatedSOWIdentifier}}
Amount: {subtotalPrice}
Request: {requestIdentifier}
Date: {date}
@@ -86,7 +86,7 @@ const Document = ({ document, addClass }) => { totalPrice={totalPrice} /> )} - {turnaroundTime && <>
Turnaround Time: {turnaroundTime}
} + {turnaroundTime &&
Turnaround Time: {turnaroundTime}
} @@ -97,6 +97,7 @@ const Document = ({ document, addClass }) => { Document.propTypes = { addClass: PropTypes.string, document: PropTypes.shape({ + adPO: allowNull(PropTypes.string.isRequired), identifier: PropTypes.string.isRequired, date: PropTypes.string.isRequired, documentStatus: PropTypes.string.isRequired, @@ -104,6 +105,8 @@ Document.propTypes = { documentType: PropTypes.string.isRequired, documentTypeColor: PropTypes.string, lineItems: PropTypes.arrayOf(PropTypes.shape({})).isRequired, + poNumber: allowNull(PropTypes.string.isRequired), + relatedSOWIdentifier: allowNull(PropTypes.string.isRequired), requestIdentifier: PropTypes.string.isRequired, shippingPrice: PropTypes.string.isRequired, shipTo: PropTypes.shape({ @@ -118,6 +121,7 @@ Document.propTypes = { taxAmount: PropTypes.string.isRequired, terms: PropTypes.string.isRequired, totalPrice: PropTypes.string.isRequired, + turnaroundTime: allowNull(PropTypes.string.isRequired), }), } From 91b8b431059107e876e156c8d39a77cf01213668 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Tue, 7 Mar 2023 16:43:04 -0600 Subject: [PATCH 5/6] no longer passing null values so we do not need to account for them --- src/compounds/Document/Document.jsx | 35 +++++++++++++---------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/compounds/Document/Document.jsx b/src/compounds/Document/Document.jsx index 53e95e4..33667a6 100644 --- a/src/compounds/Document/Document.jsx +++ b/src/compounds/Document/Document.jsx @@ -3,13 +3,13 @@ import PropTypes from 'prop-types' import { Dropdown, Offcanvas } from 'react-bootstrap' import LineItemsTable from '../../components/LineItemsTable/LineItemsTable' import './document.scss' -import { allowNull } from '../../resources/utilityFunctions' const Document = ({ document, addClass }) => { - const { adPO, date, documentStatusColor, documentType, - documentTypeColor, documentStatus, identifier, lineItems, poNumber, relatedSOWIdentifier, requestIdentifier, - shippingPrice, shipTo, shipFrom, subtotalPrice, - taxAmount, terms, totalPrice, turnaroundTime } = document + const { + adPO, date, documentStatusColor, documentType, documentTypeColor, documentStatus, identifier, lineItems, poNumber, + relatedSOWIdentifier, requestIdentifier, shippingPrice, shipTo, shipFrom, subtotalPrice, taxAmount, terms, totalPrice, + turnaroundTime, + } = document const [show, setShow] = useState(false) const handleClose = () => setShow(false) const handleShow = () => setShow(true) @@ -76,16 +76,13 @@ const Document = ({ document, addClass }) => {
{shipFrom.text}
- {lineItems - && ( - - )} + {turnaroundTime &&
Turnaround Time: {turnaroundTime}
} @@ -97,7 +94,7 @@ const Document = ({ document, addClass }) => { Document.propTypes = { addClass: PropTypes.string, document: PropTypes.shape({ - adPO: allowNull(PropTypes.string.isRequired), + adPO: PropTypes.string, identifier: PropTypes.string.isRequired, date: PropTypes.string.isRequired, documentStatus: PropTypes.string.isRequired, @@ -105,8 +102,8 @@ Document.propTypes = { documentType: PropTypes.string.isRequired, documentTypeColor: PropTypes.string, lineItems: PropTypes.arrayOf(PropTypes.shape({})).isRequired, - poNumber: allowNull(PropTypes.string.isRequired), - relatedSOWIdentifier: allowNull(PropTypes.string.isRequired), + poNumber: PropTypes.string, + relatedSOWIdentifier: PropTypes.string, requestIdentifier: PropTypes.string.isRequired, shippingPrice: PropTypes.string.isRequired, shipTo: PropTypes.shape({ @@ -121,7 +118,7 @@ Document.propTypes = { taxAmount: PropTypes.string.isRequired, terms: PropTypes.string.isRequired, totalPrice: PropTypes.string.isRequired, - turnaroundTime: allowNull(PropTypes.string.isRequired), + turnaroundTime: PropTypes.string, }), } From bcf4ad70a3a173df644862c0c49ff816cbbb75ee Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Tue, 7 Mar 2023 17:00:35 -0600 Subject: [PATCH 6/6] check for lineItems again --- src/compounds/Document/Document.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/compounds/Document/Document.jsx b/src/compounds/Document/Document.jsx index 33667a6..50e03f9 100644 --- a/src/compounds/Document/Document.jsx +++ b/src/compounds/Document/Document.jsx @@ -76,13 +76,15 @@ const Document = ({ document, addClass }) => {
{shipFrom.text}
- + {lineItems && ( + + )} {turnaroundTime &&
Turnaround Time: {turnaroundTime}
}