Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

138 display pos #175

Merged
merged 7 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
29 changes: 19 additions & 10 deletions src/compounds/Document/Document.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import LineItemsTable from '../../components/LineItemsTable/LineItemsTable'
import './document.scss'

const Document = ({ document, addClass }) => {
const { identifier, date, documentStatusColor, documentType,
documentTypeColor, documentStatus, lineItems, requestIdentifier,
shippingPrice, shipTo, shipFrom, subtotalPrice,
taxAmount, terms, totalPrice } = 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)
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 All @@ -71,8 +76,7 @@ const Document = ({ document, addClass }) => {
<div className='address'>{shipFrom.text}</div>
</div>
</div>
{lineItems
&& (
{lineItems && (
<LineItemsTable
lineItems={lineItems}
subtotalPrice={subtotalPrice}
Expand All @@ -81,6 +85,7 @@ const Document = ({ document, addClass }) => {
totalPrice={totalPrice}
/>
)}
{turnaroundTime && <h5><b>Turnaround Time:</b> {turnaroundTime}</h5>}
</Offcanvas.Body>
</Offcanvas>
</>
Expand All @@ -91,13 +96,16 @@ const Document = ({ document, addClass }) => {
Document.propTypes = {
addClass: PropTypes.string,
document: PropTypes.shape({
adPO: PropTypes.string,
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: PropTypes.string,
relatedSOWIdentifier: PropTypes.string,
requestIdentifier: PropTypes.string.isRequired,
shippingPrice: PropTypes.string.isRequired,
shipTo: PropTypes.shape({
Expand All @@ -112,6 +120,7 @@ Document.propTypes = {
taxAmount: PropTypes.string.isRequired,
terms: PropTypes.string.isRequired,
totalPrice: PropTypes.string.isRequired,
turnaroundTime: PropTypes.string,
}),
}

Expand Down
Loading