Skip to content

Commit

Permalink
B-22132-INT fix link amend orders (#14440)
Browse files Browse the repository at this point in the history
* fix amend orders link after move is submitted

* fixed link in second spot

* add orderId to helper approved move call

* trying dummy id

* maybe this will make happo happy

* update playwright test

* update index stories

* 7th times the charm

* remove extra changes

* remove added whitespace

* readd stuff because now it's failing again

* update playwright test

* forgot this
  • Loading branch information
loganwc authored Jan 2, 2025
1 parent 84a76a5 commit 57638d8
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 33 deletions.
4 changes: 3 additions & 1 deletion src/components/Customer/Home/Helper/Helper.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export const NeedsShipment = () => <HelperNeedsShipment />;
export const NeedsSubmitMove = () => <HelperNeedsSubmitMove />;
export const SubmittedMove = () => <HelperSubmittedMove />;
export const AmendedOrders = () => <HelperAmendedOrders />;

const defaultProps = { orderId: '12345' };
export const ApprovedMove = () => (
<MemoryRouter>
<HelperApprovedMove />
<HelperApprovedMove {...defaultProps} />
</MemoryRouter>
);
export const PPMCloseoutSubmitted = () => <HelperPPMCloseoutSubmitted />;
66 changes: 36 additions & 30 deletions src/pages/MyMove/Home/HomeHelpers.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { generatePath, Link } from 'react-router-dom';
import { Link as ExternalLink } from '@trussworks/react-uswds';

import styles from './Home.module.scss';
Expand Down Expand Up @@ -96,35 +96,41 @@ export const HelperSubmittedMove = () => (
</Helper>
);

export const HelperApprovedMove = () => (
<Helper title="Your move is in progress." className={styles['helper-approved-section']}>
<div>
<p>Talk to your counselor or to your movers to make any changes to your move.</p>
</div>
<div>
<p>
<strong>For PPM shipments</strong>
</p>
<p className={styles['top-gap']}>
When you are done moving your things, select <strong>Upload PPM Documents</strong> to document your PPM,
calculate your final incentive, and create a payment request packet. You will upload weight tickets, receipts,
and other documentation that a counselor will review.
</p>
</div>
<div>
<p>
<strong>If you receive new orders while your move is underway</strong>
</p>
<ul className={styles['top-gap']}>
<li>Talk to your counselor</li>
<li>Talk to your movers</li>
<li>
<Link to={customerRoutes.ORDERS_AMEND_PATH}>Upload a copy of your new orders</Link>
</li>
</ul>
</div>
</Helper>
);
export const HelperApprovedMove = ({ orderId }) => {
const path = generatePath(customerRoutes.ORDERS_AMEND_PATH, {
orderId,
});

return (
<Helper title="Your move is in progress." className={styles['helper-approved-section']}>
<div>
<p>Talk to your counselor or to your movers to make any changes to your move.</p>
</div>
<div>
<p>
<strong>For PPM shipments</strong>
</p>
<p className={styles['top-gap']}>
When you are done moving your things, select <strong>Upload PPM Documents</strong> to document your PPM,
calculate your final incentive, and create a payment request packet. You will upload weight tickets, receipts,
and other documentation that a counselor will review.
</p>
</div>
<div>
<p>
<strong>If you receive new orders while your move is underway</strong>
</p>
<ul className={styles['top-gap']}>
<li>Talk to your counselor</li>
<li>Talk to your movers</li>
<li>
<Link to={path}>Upload a copy of your new orders</Link>
</li>
</ul>
</div>
</Helper>
);
};

export const HelperAmendedOrders = () => (
<Helper title="Next step: Contact your movers (if you have them)" className={styles['helper-paragraph-only']}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/MyMove/Home/MoveHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed
if (!hasSubmittedMove()) return <HelperNeedsSubmitMove />;
if (hasSubmittedPPMCloseout()) return <HelperPPMCloseoutSubmitted />;
if (hasUnapprovedAmendedOrders()) return <HelperAmendedOrders />;
if (isMoveApproved()) return <HelperApprovedMove />;
if (isMoveApproved()) return <HelperApprovedMove orderId={orders.id} />;
return <HelperSubmittedMove />;
};

Expand Down
4 changes: 3 additions & 1 deletion src/pages/MyMove/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ export class Home extends Component {
};

renderHelper = () => {
const { orders } = this.props;
if (!this.hasOrders) return <HelperNeedsOrders />;
if (!this.hasAnyShipments) return <HelperNeedsShipment />;
if (!this.hasSubmittedMove) return <HelperNeedsSubmitMove />;
if (this.hasSubmittedPPMCloseout) return <HelperPPMCloseoutSubmitted />;
if (this.hasUnapprovedAmendedOrders) return <HelperAmendedOrders />;
if (this.isMoveApproved) return <HelperApprovedMove />;
if (this.isMoveApproved) return <HelperApprovedMove orderId={orders.id} />;

return <HelperSubmittedMove />;
};

Expand Down
9 changes: 9 additions & 0 deletions src/pages/MyMove/Home/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ const propsForApprovedPPMShipment = {
status: MOVE_STATUSES.APPROVED,
submitted_at: '2020-12-24',
},
orders: {
id: '12345',
origin_duty_location: {
name: 'NAS Norfolk',
},
new_duty_location: {
name: 'NAS Jacksonville',
},
},
};

const propsForCloseoutCompletePPMShipment = {
Expand Down

0 comments on commit 57638d8

Please sign in to comment.