diff --git a/packages/react-components/lib/tasks/create-task.tsx b/packages/react-components/lib/tasks/create-task.tsx index cb7bf566d..67e24445c 100644 --- a/packages/react-components/lib/tasks/create-task.tsx +++ b/packages/react-components/lib/tasks/create-task.tsx @@ -595,7 +595,6 @@ export function CreateTaskForm({ { desc.category = taskRequest.description.category; diff --git a/packages/react-components/lib/tasks/types/delivery-custom.spec.tsx b/packages/react-components/lib/tasks/types/delivery-custom.spec.tsx index ccb559a6d..0b6729f3f 100644 --- a/packages/react-components/lib/tasks/types/delivery-custom.spec.tsx +++ b/packages/react-components/lib/tasks/types/delivery-custom.spec.tsx @@ -489,7 +489,7 @@ describe('Custom deliveries', () => { "unix_millis_action_duration_estimate": 60000, "category": "delivery_pickup", "description": { - "cart_id": "test_first_cart_id", + "cart_id": "", "pickup_lot": "test_first_pickup_lot" } } @@ -580,7 +580,7 @@ describe('Custom deliveries', () => { "unix_millis_action_duration_estimate": 60000, "category": "delivery_pickup", "description": { - "cart_id": "test_second_cart_id", + "cart_id": "", "pickup_lot": "test_second_pickup_lot" } } @@ -662,12 +662,11 @@ describe('Custom deliveries', () => { const description: DoubleComposeDeliveryTaskDescription = makeDefaultDoubleComposeDeliveryTaskDescription(); - let firstPickupPhase = cartPickupPhaseInsertPickup( + const firstPickupPhase = cartPickupPhaseInsertPickup( description.phases[0], 'test_first_pickup_place', 'test_first_pickup_lot', ); - firstPickupPhase = cartPickupPhaseInsertCartId(firstPickupPhase, 'test_first_cart_id'); let firstDeliveryPhase = deliveryPhaseInsertDropoff( description.phases[1], 'test_first_dropoff_place', @@ -677,12 +676,11 @@ describe('Custom deliveries', () => { 'test_waypoint_2', 'test_waypoint_3', ]); - let secondPickupPhase = cartPickupPhaseInsertPickup( + const secondPickupPhase = cartPickupPhaseInsertPickup( description.phases[3], 'test_second_pickup_place', 'test_second_pickup_lot', ); - secondPickupPhase = cartPickupPhaseInsertCartId(secondPickupPhase, 'test_second_cart_id'); let secondDeliveryPhase = deliveryPhaseInsertDropoff( description.phases[4], 'test_second_dropoff_place', diff --git a/packages/react-components/lib/tasks/types/delivery-custom.tsx b/packages/react-components/lib/tasks/types/delivery-custom.tsx index 1a0320c13..b7c26e2b4 100644 --- a/packages/react-components/lib/tasks/types/delivery-custom.tsx +++ b/packages/react-components/lib/tasks/types/delivery-custom.tsx @@ -197,14 +197,12 @@ export function makeDoubleComposeDeliveryTaskBookingLabel( const pickups = `${firstPickupDescription.pickup_lot}(1), ${secondPickupDescription.pickup_lot}(2)`; const dropoffs = `${task_description.phases[1].activity.description.activities[0].description}(1), ${task_description.phases[4].activity.description.activities[0].description}(2)`; - const cartIds = `${firstPickupDescription.pickup_lot}(1), ${secondPickupDescription.cart_id}(2)`; return { description: { task_definition_id: task_description.category, pickup: pickups, destination: dropoffs, - cart_id: cartIds, }, }; } @@ -243,20 +241,14 @@ export function makeDoubleComposeDeliveryTaskShortDescription( ): string { try { const firstGoToPickup: GoToPlaceActivity = desc.phases[0].activity.description.activities[0]; - const firstPickup: LotPickupActivity = desc.phases[0].activity.description.activities[1]; - const firstCartId = firstPickup.description.description.cart_id; const firstGoToDropoff: GoToPlaceActivity = desc.phases[1].activity.description.activities[0]; const secondGoToPickup: GoToPlaceActivity = desc.phases[3].activity.description.activities[0]; - const secondPickup: LotPickupActivity = desc.phases[3].activity.description.activities[1]; - const secondCartId = secondPickup.description.description.cart_id; const secondGoToDropoff: GoToPlaceActivity = desc.phases[4].activity.description.activities[0]; - return `[${ - taskDisplayName ?? DeliveryPickupTaskDefinition.taskDisplayName - }] payload [${firstCartId}] from [${firstGoToPickup.description}] to [${ - firstGoToDropoff.description - }], then payload [${secondCartId}] from [${secondGoToPickup.description}] to [${ + return `[${taskDisplayName ?? DeliveryPickupTaskDefinition.taskDisplayName}] from [${ + firstGoToPickup.description + }] to [${firstGoToDropoff.description}], then from [${secondGoToPickup.description}] to [${ secondGoToDropoff.description }]`; } catch (e) { @@ -348,14 +340,12 @@ const isDoubleComposeDeliveryTaskDescriptionValid = ( firstGoToPickup.description.length > 0 && Object.keys(pickupPoints).includes(firstGoToPickup.description) && pickupPoints[firstGoToPickup.description] === firstPickup.description.description.pickup_lot && - firstPickup.description.description.cart_id.length > 0 && firstGoToDropoff.description.length > 0 && Object.keys(dropoffPoints).includes(firstGoToDropoff.description) && secondGoToPickup.description.length > 0 && Object.keys(pickupPoints).includes(secondGoToPickup.description) && pickupPoints[secondGoToPickup.description] === secondPickup.description.description.pickup_lot && - secondPickup.description.description.cart_id.length > 0 && secondGoToDropoff.description.length > 0 && Object.keys(dropoffPoints).includes(secondGoToDropoff.description) ); @@ -607,7 +597,6 @@ export function DeliveryPickupTaskForm({ interface DoubleComposeDeliveryTaskFormProps { taskDesc: DoubleComposeDeliveryTaskDescription; pickupPoints: Record; - cartIds: string[]; dropoffPoints: Record; onChange(taskDesc: DoubleComposeDeliveryTaskDescription): void; onValidate(valid: boolean): void; @@ -616,7 +605,6 @@ interface DoubleComposeDeliveryTaskFormProps { export function DoubleComposeDeliveryTaskForm({ taskDesc, pickupPoints = {}, - cartIds = [], dropoffPoints = {}, onChange, onValidate, @@ -630,7 +618,7 @@ export function DoubleComposeDeliveryTaskForm({ return ( - + - + - - option} - onInputChange={(_ev, newValue) => { - const newTaskDesc = { ...taskDesc }; - newTaskDesc.phases[0] = cartPickupPhaseInsertCartId(newTaskDesc.phases[0], newValue); - onInputChange(newTaskDesc); - }} - onBlur={(ev) => { - const newTaskDesc = { ...taskDesc }; - newTaskDesc.phases[0] = cartPickupPhaseInsertCartId( - newTaskDesc.phases[0], - (ev.target as HTMLInputElement).value, - ); - onInputChange(newTaskDesc); - }} - sx={{ - '& .MuiOutlinedInput-root': { - height: isScreenHeightLessThan800 ? '3rem' : '3.5rem', - fontSize: isScreenHeightLessThan800 ? 14 : 20, - }, - }} - renderInput={(params) => ( - - )} - /> - - + - + - - option} - onInputChange={(_ev, newValue) => { - const newTaskDesc = { ...taskDesc }; - newTaskDesc.phases[3] = cartPickupPhaseInsertCartId(newTaskDesc.phases[3], newValue); - onInputChange(newTaskDesc); - }} - onBlur={(ev) => { - const newTaskDesc = { ...taskDesc }; - newTaskDesc.phases[3] = cartPickupPhaseInsertCartId( - newTaskDesc.phases[3], - (ev.target as HTMLInputElement).value, - ); - onInputChange(newTaskDesc); - }} - sx={{ - '& .MuiOutlinedInput-root': { - height: isScreenHeightLessThan800 ? '3rem' : '3.5rem', - fontSize: isScreenHeightLessThan800 ? 14 : 20, - }, - }} - renderInput={(params) => ( - - )} - /> - ); }