Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/StatusBar/StatusBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const StatusBar = ({ backgroundColor, statusArray, apiRequestStatus, addClass })

return (
<div className={`container ${addClass}`}>
<div className='row border'>
<div className='row border' data-cy='status-bar'>
{statusArray.map((statusObject, index) => {
const { statusLabel, statusIcon } = statusObject
const border = index !== statusArray.length - 1 ? 'border-end' : ''
Expand Down
24 changes: 17 additions & 7 deletions src/compounds/Document/Document.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +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 { 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)
Expand All @@ -21,14 +22,14 @@ const Document = ({ document, addClass }) => {
{documentType}
</div>
<div className='border-end p-2'>
<b>{identifier}:</b> {subtotalPrice}
<b>{(documentType === 'SOW') ? identifier : poNumber}:</b> {subtotalPrice}
</div>
<small className='text-muted fw-light p-2'>
{date}
</small>
</div>
<div className='ms-auto p-2'>
<div className='badge p-2' style={{backgroundColor: documentStatusColor}}>
<div className='badge p-2' style={{ backgroundColor: documentStatusColor }}>
{documentStatus}
</div>
</div>
Expand All @@ -52,8 +53,12 @@ const Document = ({ document, addClass }) => {
<Offcanvas.Body>
<div className='d-block d-md-flex justify-content-between'>
<div className='details'>
<h6>Details:</h6>
<b>Proposal:</b> {identifier}<br />
<h5>Details:</h5>
{poNumber && <><b>PO:</b> {poNumber}<br /></>}
{adPO && <><b>AD PO:</b> {identifier}<br /></>}
{documentType === 'SOW'
? <><b>Proposal:</b> {identifier}</>
: <><b>Related SOW:</b> {relatedSOWIdentifier}</>}<br />
<b>Amount:</b> {subtotalPrice}<br />
<b>Request:</b> {requestIdentifier} <br />
<b>Date:</b> {date}<br />
Expand Down Expand Up @@ -81,6 +86,7 @@ const Document = ({ document, addClass }) => {
totalPrice={totalPrice}
/>
)}
{turnaroundTime && <h5><b>Turnaround Time:</b> {turnaroundTime}</h5>}
</Offcanvas.Body>
</Offcanvas>
</>
Expand All @@ -91,13 +97,16 @@ 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,
documentStatusColor: PropTypes.string,
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({
Expand All @@ -112,6 +121,7 @@ Document.propTypes = {
taxAmount: PropTypes.string.isRequired,
terms: PropTypes.string.isRequired,
totalPrice: PropTypes.string.isRequired,
turnaroundTime: allowNull(PropTypes.string.isRequired),
}),
}

Expand Down