Skip to content

Commit 6f6bb3a

Browse files
authored
Merge pull request #175 from scientist-softserv/138-display-pos
138 display pos
2 parents ec89bf0 + 950f362 commit 6f6bb3a

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

src/components/StatusBar/StatusBar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const StatusBar = ({ backgroundColor, statusArray, apiRequestStatus, addClass })
1616

1717
return (
1818
<div className={`container ${addClass}`}>
19-
<div className='row border'>
19+
<div className='row border' data-cy='status-bar'>
2020
{statusArray.map((statusObject, index) => {
2121
const { statusLabel, statusIcon } = statusObject
2222
const border = index !== statusArray.length - 1 ? 'border-end' : ''

src/compounds/Document/Document.jsx

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import LineItemsTable from '../../components/LineItemsTable/LineItemsTable'
55
import './document.scss'
66

77
const Document = ({ document, addClass }) => {
8-
const { identifier, date, documentStatusColor, documentType,
9-
documentTypeColor, documentStatus, lineItems, requestIdentifier,
10-
shippingPrice, shipTo, shipFrom, subtotalPrice,
11-
taxAmount, terms, totalPrice } = 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
1213
const [show, setShow] = useState(false)
1314
const handleClose = () => setShow(false)
1415
const handleShow = () => setShow(true)
@@ -21,14 +22,14 @@ const Document = ({ document, addClass }) => {
2122
{documentType}
2223
</div>
2324
<div className='border-end p-2'>
24-
<b>{identifier}:</b> {subtotalPrice}
25+
<b>{(documentType === 'SOW') ? identifier : poNumber}:</b> {subtotalPrice}
2526
</div>
2627
<small className='text-muted fw-light p-2'>
2728
{date}
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>
@@ -52,8 +53,12 @@ const Document = ({ document, addClass }) => {
5253
<Offcanvas.Body>
5354
<div className='d-block d-md-flex justify-content-between'>
5455
<div className='details'>
55-
<h6>Details:</h6>
56-
<b>Proposal:</b> {identifier}<br />
56+
<h5>Details:</h5>
57+
{poNumber && <><b>PO:</b> {poNumber}<br /></>}
58+
{adPO && <><b>AD PO:</b> {identifier}<br /></>}
59+
{documentType === 'SOW'
60+
? <><b>Proposal:</b> {identifier}</>
61+
: <><b>Related SOW:</b> {relatedSOWIdentifier}</>}<br />
5762
<b>Amount:</b> {subtotalPrice}<br />
5863
<b>Request:</b> {requestIdentifier} <br />
5964
<b>Date:</b> {date}<br />
@@ -71,8 +76,7 @@ const Document = ({ document, addClass }) => {
7176
<div className='address'>{shipFrom.text}</div>
7277
</div>
7378
</div>
74-
{lineItems
75-
&& (
79+
{lineItems && (
7680
<LineItemsTable
7781
lineItems={lineItems}
7882
subtotalPrice={subtotalPrice}
@@ -81,6 +85,7 @@ const Document = ({ document, addClass }) => {
8185
totalPrice={totalPrice}
8286
/>
8387
)}
88+
{turnaroundTime && <h5><b>Turnaround Time:</b> {turnaroundTime}</h5>}
8489
</Offcanvas.Body>
8590
</Offcanvas>
8691
</>
@@ -91,13 +96,16 @@ const Document = ({ document, addClass }) => {
9196
Document.propTypes = {
9297
addClass: PropTypes.string,
9398
document: PropTypes.shape({
99+
adPO: PropTypes.string,
94100
identifier: PropTypes.string.isRequired,
95101
date: PropTypes.string.isRequired,
96102
documentStatus: PropTypes.string.isRequired,
97103
documentStatusColor: PropTypes.string,
98104
documentType: PropTypes.string.isRequired,
99105
documentTypeColor: PropTypes.string,
100106
lineItems: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
107+
poNumber: PropTypes.string,
108+
relatedSOWIdentifier: PropTypes.string,
101109
requestIdentifier: PropTypes.string.isRequired,
102110
shippingPrice: PropTypes.string.isRequired,
103111
shipTo: PropTypes.shape({
@@ -112,6 +120,7 @@ Document.propTypes = {
112120
taxAmount: PropTypes.string.isRequired,
113121
terms: PropTypes.string.isRequired,
114122
totalPrice: PropTypes.string.isRequired,
123+
turnaroundTime: PropTypes.string,
115124
}),
116125
}
117126

0 commit comments

Comments
 (0)