Skip to content

Commit

Permalink
Merge branch 'MAIN-B-20452' into INT-B-20452
Browse files Browse the repository at this point in the history
  • Loading branch information
taeJungCaci committed Sep 11, 2024
2 parents 432bb7f + 5e31bf8 commit 90dfc54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/pages/MyMove/Home/MoveHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed
};

// checking if there are any incomplete shipment
const hasCompletedAllShipment = () => {
if (!mtoShipments || !mtoShipments?.length) return false;
const hasIncompleteShipment = () => {
if (!mtoShipments) return false;
const shipmentValidators = {
[SHIPMENT_TYPES.PPM]: isPPMShipmentComplete,
[SHIPMENT_TYPES.BOAT_HAUL_AWAY]: isBoatShipmentComplete,
Expand All @@ -179,7 +179,7 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed

return mtoShipments.some((shipment) => {
const validateShipment = shipmentValidators[shipment.shipmentType];
return validateShipment && validateShipment(shipment);
return validateShipment && !validateShipment(shipment);
});
};

Expand Down Expand Up @@ -562,7 +562,7 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed
actionBtnDisabled={!hasOrdersAndUpload()}
actionBtnId="shipment-selection-btn"
onActionBtnClick={() => handleNewPathClick(shipmentSelectionPath)}
complete={hasCompletedAllShipment()}
complete={!hasIncompleteShipment() && hasAnyShipments()}
completedHeaderText="Shipments"
headerText="Set up shipments"
secondaryBtn={hasAnyShipments()}
Expand Down Expand Up @@ -593,7 +593,7 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed
)}
</Step>
<Step
actionBtnDisabled={!hasCompletedAllShipment()}
actionBtnDisabled={hasIncompleteShipment() || !hasAnyShipments()}
actionBtnId="review-and-submit-btn"
actionBtnLabel={!hasSubmittedMove() ? 'Review and submit' : 'Review your request'}
complete={hasSubmittedMove()}
Expand Down
10 changes: 5 additions & 5 deletions src/pages/MyMove/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ export class Home extends Component {
return !!finishedCloseout.length;
}

get hasCompletedAllShipment() {
get hasIncompleteShipment() {
const { mtoShipments } = this.props;
if (!mtoShipments || !mtoShipments?.length) return false;
if (!mtoShipments) return false;
const shipmentValidators = {
[SHIPMENT_TYPES.PPM]: isPPMShipmentComplete,
[SHIPMENT_TYPES.BOAT_HAUL_AWAY]: isBoatShipmentComplete,
Expand All @@ -157,7 +157,7 @@ export class Home extends Component {

return mtoShipments.some((shipment) => {
const validateShipment = shipmentValidators[shipment.shipmentType];
return validateShipment && validateShipment(shipment);
return validateShipment && !validateShipment(shipment);
});
}

Expand Down Expand Up @@ -551,7 +551,7 @@ export class Home extends Component {
actionBtnDisabled={!this.hasOrders}
actionBtnId="shipment-selection-btn"
onActionBtnClick={() => this.handleNewPathClick(shipmentSelectionPath)}
complete={this.hasCompletedAllShipment}
complete={!this.hasIncompleteShipment && this.hasAnyShipments}
completedHeaderText="Shipments"
headerText="Set up shipments"
secondaryBtn={this.hasAnyShipments}
Expand Down Expand Up @@ -582,7 +582,7 @@ export class Home extends Component {
)}
</Step>
<Step
actionBtnDisabled={!this.hasCompletedAllShipment}
actionBtnDisabled={this.hasIncompleteShipment || !this.hasAnyShipments}
actionBtnId="review-and-submit-btn"
actionBtnLabel={!this.hasSubmittedMove ? 'Review and submit' : 'Review your request'}
complete={this.hasSubmittedMove}
Expand Down

0 comments on commit 90dfc54

Please sign in to comment.