@bjsdistribution/dms-client-return 0.2.1-prod → 0.2.2-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/order-view/store.js +14 -12
- package/dist/components/order-view/store.js.map +1 -1
- package/dist/components/order-view/utils.js +47 -46
- package/dist/components/order-view/utils.js.map +1 -1
- package/dist/types/components/order-view/types.d.ts +2 -0
- package/dist/types/components/order-view/utils.d.ts +0 -2
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ import { useAtom as Ir } from "jotai";
|
|
|
3
3
|
import { atomWithReducer as u } from "jotai/utils";
|
|
4
4
|
const l = e("active"), s = e(!1);
|
|
5
5
|
e([]);
|
|
6
|
-
const
|
|
6
|
+
const i = e(void 0);
|
|
7
7
|
e(!1);
|
|
8
8
|
e(/* @__PURE__ */ new Date());
|
|
9
|
-
const
|
|
9
|
+
const c = e({}), d = e({
|
|
10
10
|
recipient_name: "",
|
|
11
11
|
postcode: ""
|
|
12
12
|
}), o = {
|
|
@@ -51,6 +51,8 @@ const i = e({}), d = e({
|
|
|
51
51
|
postcode: null,
|
|
52
52
|
postcode_district: null,
|
|
53
53
|
postcode_short: null,
|
|
54
|
+
latitude: null,
|
|
55
|
+
longitude: null,
|
|
54
56
|
what_3words_address: null,
|
|
55
57
|
contact_home: null,
|
|
56
58
|
contact_work: null,
|
|
@@ -165,10 +167,10 @@ function ve() {
|
|
|
165
167
|
return r(s);
|
|
166
168
|
}
|
|
167
169
|
function De() {
|
|
168
|
-
return r(
|
|
170
|
+
return r(i);
|
|
169
171
|
}
|
|
170
172
|
function Ae() {
|
|
171
|
-
return r(
|
|
173
|
+
return r(c);
|
|
172
174
|
}
|
|
173
175
|
function Ce() {
|
|
174
176
|
return r(d);
|
|
@@ -369,11 +371,11 @@ function sr() {
|
|
|
369
371
|
return r($);
|
|
370
372
|
}
|
|
371
373
|
const ee = e([]);
|
|
372
|
-
function
|
|
374
|
+
function ir() {
|
|
373
375
|
return r(ee);
|
|
374
376
|
}
|
|
375
377
|
const re = e("success");
|
|
376
|
-
function
|
|
378
|
+
function cr() {
|
|
377
379
|
return r(re);
|
|
378
380
|
}
|
|
379
381
|
const te = e(f);
|
|
@@ -400,13 +402,13 @@ const se = e("");
|
|
|
400
402
|
function pr() {
|
|
401
403
|
return r(se);
|
|
402
404
|
}
|
|
403
|
-
const
|
|
405
|
+
const ie = e("");
|
|
404
406
|
function gr() {
|
|
405
|
-
return r(
|
|
407
|
+
return r(ie);
|
|
406
408
|
}
|
|
407
|
-
const
|
|
409
|
+
const ce = e("");
|
|
408
410
|
function yr() {
|
|
409
|
-
return r(
|
|
411
|
+
return r(ce);
|
|
410
412
|
}
|
|
411
413
|
const de = e(!1);
|
|
412
414
|
function br() {
|
|
@@ -458,7 +460,7 @@ export {
|
|
|
458
460
|
Cr as skeletonTomTom,
|
|
459
461
|
a as unrecieveOrderProducts,
|
|
460
462
|
_ as updateOrderProducts,
|
|
461
|
-
|
|
463
|
+
cr as useActiveTab,
|
|
462
464
|
Ir as useAtom,
|
|
463
465
|
ur as useAuditLogLoadingState,
|
|
464
466
|
$e as useCUstomerId,
|
|
@@ -477,7 +479,7 @@ export {
|
|
|
477
479
|
fr as useEscalationLevel,
|
|
478
480
|
mr as useEscalationReason,
|
|
479
481
|
ar as useFailureReason,
|
|
480
|
-
|
|
482
|
+
ir as useGlobalEscData,
|
|
481
483
|
lr as useGlobalStateHitAuditLog,
|
|
482
484
|
sr as useGlobalStateHitOrder,
|
|
483
485
|
Ye as useGsitCUstomerId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sources":["../../../src/components/order-view/store.ts"],"sourcesContent":["import { atom, useAtom } from 'jotai';\nimport { atomWithReducer } from 'jotai/utils';\nimport {\n CancelOrderProductsType,\n ChargesType,\n CreateProduct,\n OrderActionsType,\n OrdersType,\n UnRecieveOrderProduct,\n UpdateOrderProduct,\n} from './types';\nimport {\n ClientData,\n ClientType,\n} from '../order-daily-overview/common/interface';\n// OrderActionsType\nconst activeTabAtom = atom<string>('active');\nconst infoAtom = atom<boolean | undefined>(false);\nconst orderResources = atom<[]>([]);\nconst currentActionAtom = atom<OrderActionsType | undefined>(undefined);\nconst isOnHold = atom<Boolean>(false);\nconst date = atom(new Date());\n\nconst orderStaticDataAtom = atom<any>({});\n\ninterface OrderRecipient {\n recipient_name: string | null;\n postcode: string | null;\n return_action?: string[] | null;\n}\n\nconst customerInfoAtom = atom<OrderRecipient>({\n recipient_name: '',\n postcode: '',\n});\n\nexport const ordersInitialValue: OrdersType = {\n order_locked_time: null,\n depot_id: null,\n gsit_order_id: null,\n customer_id: null,\n trading_name: null,\n recipient_reference: null,\n order_locked: true,\n lock_notes: null,\n order_type_id: null,\n allow_live_tracking: null,\n weight: null,\n cube: null,\n rescheduled: null,\n zone_code: null,\n status: null,\n status_value: null,\n order_status_note: null,\n print_pod: null,\n order_number: null,\n consignment: null,\n action_date: null,\n other_instructions: null,\n schedule_after: null,\n vehicle_type: null,\n latitude: null,\n longitude: null,\n order_locked_by: null,\n delivery_instructions: null,\n drop_time: null,\n created_by: null,\n created_at: null,\n recipient_name: '',\n postcode: '',\n order_recipient: {\n id: null,\n order_id: null,\n recipient_name: null,\n address: null,\n postcode: null,\n postcode_district: null,\n postcode_short: null,\n what_3words_address: null,\n contact_home: null,\n contact_work: null,\n contact_mobile: null,\n contact_email: null,\n is_comms_enabled: null,\n },\n order_services_detail: {\n order_id: null,\n timed_service_id: null,\n order_delivery_point_id: null,\n order_service_level_id: null,\n heavy_order: null,\n heavy_item: null,\n bulky_order: null,\n bulky_item: null,\n id: null,\n },\n order_services: [\n {\n order_id: null,\n order_service_list_id: null,\n service_time: null,\n is_refused: null,\n service_note: null,\n id: null,\n service_category_id: 0,\n },\n ],\n order_routes: null,\n order_eta_updates: [],\n order_delivery_declined_dates: [],\n order_communications: [],\n id: null,\n name: '',\n carrier_id: null,\n order_type: {\n type: null,\n },\n assemble: false,\n disassemble: false,\n unpack_items: false,\n take_packaging_away: false,\n collect_disposal: false,\n assembly_type: null,\n route_id: null,\n hold_untill: null,\n hold_reason: null,\n\n order_on_hold: {\n order_id: null,\n hold_indefinitely: null,\n hold_until: null,\n reason_id: null,\n un_hold: null,\n },\n\n refused_service: [],\n refused_service_reason: '',\n invalid_order: null,\n owner_name: null,\n force_debrief_enabled: null,\n import_reference: null,\n labels: null,\n};\n\nexport const orderProductInitialvalue: CreateProduct = {\n code: '',\n description: '',\n sku: '',\n weight: 0,\n cube: 0,\n order_id: 0,\n order_product_type_id: 0,\n return_reason_id: 0,\n collection_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nexport const unrecieveOrderProducts: UnRecieveOrderProduct = {\n unrecieve_reason_id: 0,\n unrecieve_note: '',\n // id: 0\n};\n\nexport const updateOrderProducts: UpdateOrderProduct = {\n id: 0,\n order_id: 0,\n product_type_id: 0,\n product_return_action_id: 0,\n return_location: '',\n return_reason_id: 0,\n};\n\n//force debrief\nconst chargesIntialValue: ChargesType = {\n base_charge_type: 1,\n base_charge: 0,\n weight: 0,\n drop_time: 0,\n timed_service: 0,\n wait_time: 0,\n extra_floor: 0,\n bulky_items: 0,\n re_label: 0,\n extra_cube: 0,\n additional_box: 0,\n additional_item: 0,\n weekend: 0,\n re_allocation: 0,\n pre_dated: 0,\n re_package: 0,\n disassemble: 0,\n qc: 0,\n collection_qc: 0,\n return_to_client: 0,\n roc: 0,\n unpack: 0,\n packaging_disposal: 0,\n assembly: 0,\n debrief_notes: '',\n recycle: 0,\n admin: 0,\n disposal: 0,\n disposal_recycling: 0,\n debrief_status: '',\n new_order_status: '',\n adhoc_charges: [],\n};\n\nexport const usedate = () => {\n return useAtom(date);\n};\nfunction useTabType() {\n return useAtom(activeTabAtom);\n}\nfunction useInfoType() {\n return useAtom(infoAtom);\n}\nfunction useOrderResources() {\n return useAtom(orderResources);\n}\nfunction useCurrentAction() {\n return useAtom(currentActionAtom);\n}\n\nfunction useOrderStaticData() {\n return useAtom(orderStaticDataAtom);\n}\n\nexport function useCustomerInfo() {\n return useAtom(customerInfoAtom);\n}\n\n// Define initial modal state\nexport const initialModalState = {\n openModalType: null,\n};\nfunction useIsOnHoldOrder() {\n return useAtom(isOnHold);\n}\n//value\nconst orderId = atom<any>(undefined);\nexport const useOrderId = () => {\n //dddddddddddd\n return useAtom(orderId);\n};\n\nconst escalationIds = atom<number[]>([]);\n\nfunction useEscalationIDs() {\n return useAtom(escalationIds);\n}\n\nconst bulkUpdateSelectedRow = atom<any[]>([]);\nexport const useBulkUpdateSelectedRow = () => {\n return useAtom(bulkUpdateSelectedRow);\n};\n\nexport const initialConfirmOrderErrValues = {\n homeContactError: '',\n workContactError: '',\n mobileError: '',\n emailError: '',\n};\n\nconst errorConfirmOrderAtom = atom(initialConfirmOrderErrValues);\n\nfunction useErrorConfirmOrder() {\n return useAtom(errorConfirmOrderAtom);\n}\n\nconst OrderDetailsConfirmOrder = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetailsConfirmOrder() {\n return useAtom(OrderDetailsConfirmOrder);\n}\n\nconst selectedAction = atom<string>('');\n\nexport function useSelectionAction() {\n return useAtom(selectedAction);\n}\n\n// REFUSED SERVICES STATE STARTS\n\nconst confirmedDate = atom<{\n previousDate: string | null;\n currentDate: string | null;\n}>({\n previousDate: null,\n currentDate: null,\n});\n\nexport function useNotificationConfirmedDate() {\n return useAtom(confirmedDate);\n}\n\nconst cancelOrderProducts = atom<CancelOrderProductsType[]>([]);\nexport function useCancelOrderProducts() {\n return useAtom(cancelOrderProducts);\n}\n\n// changes customer Account state\nconst customerData = atom<any[]>([]);\nexport const useCustomerData = () => {\n return useAtom(customerData);\n};\n\nconst orderAlertsData = atom<any>({});\nexport function useOrderAlertsData() {\n return useAtom(orderAlertsData);\n}\n\nconst customerList = atom<any>([]);\nexport function useOrderCustomersList() {\n return useAtom(customerList);\n}\n\nexport {\n useTabType,\n useInfoType,\n useOrderResources,\n useCurrentAction,\n useIsOnHoldOrder,\n useOrderStaticData,\n useEscalationIDs,\n useErrorConfirmOrder,\n useOrderDetailsConfirmOrder,\n};\n\n// Remainder count\nconst OrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetails() {\n return useAtom(OrderDetails);\n}\n\nconst prevOrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction usePrevOrderDetails() {\n return useAtom(prevOrderDetails);\n}\n\nconst customerDetails = atom<any>({});\nfunction useCustomerDetails() {\n return useAtom(customerDetails);\n}\n\nconst DepotDeatils = atom<any>(0);\nfunction useDepotDetails() {\n return useAtom(DepotDeatils);\n}\n/**\n * Products of the *order* (`/order/order_products/{id}`), used by the order-action\n * modals. Kept separate from `returnProductDetails` below — the two endpoints return\n * different shapes and only the return-products one carries pallet data.\n */\nconst productDetails = atom<any[]>([]);\nfunction useProductDetails() {\n return useAtom(productDetails);\n}\n\n/** Products of the *return order* (`/v1/return/products/{id}`) — carries `pallet_id`. */\nconst returnProductDetails = atom<any[]>([]);\nexport function useReturnProductDetails() {\n return useAtom(returnProductDetails);\n}\n\nconst fetchAgain = atom<boolean>(false);\nexport function usefetchAgain() {\n return useAtom(fetchAgain);\n}\n\nconst productDetailsCopy = atom<any>([]);\nexport function useProductDetailsCopy() {\n return useAtom(productDetailsCopy);\n}\n\nconst StatusDeatils = atom<any>(0);\nfunction useStatusDetails() {\n return useAtom(StatusDeatils);\n}\n\nconst depotOptions = atom<any>([]);\nfunction useDepotOptions() {\n return useAtom(depotOptions);\n}\n\nconst depotEscData = atom<any>([]);\nfunction useEscData() {\n return useAtom(depotEscData);\n}\nconst deleteProdId = atom<any[]>([]);\nfunction useDeleteProdsID() {\n return useAtom(deleteProdId);\n}\n\nconst createOrderProduct = atom<any[]>([]);\nfunction useCreateOrderProducts() {\n return useAtom(createOrderProduct);\n}\n\nconst unrevieveOrderProduct = atom<UnRecieveOrderProduct>(\n unrecieveOrderProducts\n);\nfunction useRecieveOrderProducts() {\n return useAtom(unrevieveOrderProduct);\n}\n\nconst updateOrderProduct = atom<UpdateOrderProduct>(updateOrderProducts);\nfunction useUpdateOrderProducts() {\n return useAtom(updateOrderProduct);\n}\nconst CallAPi = atom(false);\n\nexport function useCallAPi() {\n return useAtom(CallAPi);\n}\n// export const selectedProductIdAtom = atom<number | null>(null);\n\nexport const selectedProductActionTabKeyAtom = atom<string>(\n 'update_product_type_tab'\n);\nfunction useSelectedProductActionTabKey() {\n return useAtom(selectedProductActionTabKeyAtom);\n}\n\nexport const errorAtom = atom({\n homeContactError: '',\n workCOntanctError: '',\n mobileError: '',\n emailError: '',\n w3wError: '',\n postCodeError: '',\n});\n\nconst orderProductResources = atom<any>([]);\nfunction useOrderProductsResources() {\n return useAtom(orderProductResources);\n}\n\nconst orderProductToolbox = atom<any>([]);\nfunction useOrderProductsToolbox() {\n return useAtom(orderProductToolbox);\n}\n\nexport const initialBulkReasonValues = {\n collection_reason_id: 0,\n return_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nconst bulkReasonsAtom = atom<any>(initialBulkReasonValues);\nexport function useBulkReasons() {\n return useAtom(bulkReasonsAtom);\n}\n\nconst bulkUpdatePayloadAtom = atom<any>([]);\nexport function useBulkUpdatePayload() {\n return useAtom(bulkUpdatePayloadAtom);\n}\n\nconst singleProductTypeUpdateAtom = atom<any>({\n order_product_type_id: 0,\n order_product_type: '',\n});\nexport function useSingleProductTypeUpdate() {\n return useAtom(singleProductTypeUpdateAtom);\n}\n\nconst locationOptions = atom<any>([]);\nexport function useLocationOptions() {\n return useAtom(locationOptions);\n}\nconst orderProductSystemLogs = atom<any>([]);\nfunction useOrderProductSystemLogs() {\n return useAtom(orderProductSystemLogs);\n}\n\nconst eventNotesData = atom<any>([]);\nfunction useEventNotesData() {\n return useAtom(eventNotesData);\n}\n\nconst selectedProductIdAtom = atom<number | undefined>(undefined);\nfunction useSelectedProductId() {\n return useAtom(selectedProductIdAtom);\n}\nconst returnAfterOrderAtom = atom<any[]>([]);\n\nexport function useReturnAfterOrderData() {\n return useAtom(returnAfterOrderAtom);\n}\n\nconst clientDataAtom = atom<ClientData[]>([]);\nfunction useClientData() {\n return useAtom(clientDataAtom);\n}\n\nconst clientData = atom<ClientType[]>([]);\n\nexport function usegetClientData() {\n return useAtom(clientData);\n}\n\nconst internalSearch = atom<string>('');\n\nfunction useInternalSearchText() {\n return useAtom(internalSearch);\n}\n\nexport {\n useAtom,\n useOrderDetails,\n useCustomerDetails,\n useProductDetails,\n useDepotDetails,\n useStatusDetails,\n useDepotOptions,\n usePrevOrderDetails,\n useEscData,\n useDeleteProdsID,\n useCreateOrderProducts,\n useRecieveOrderProducts,\n useUpdateOrderProducts,\n useOrderProductsResources,\n useOrderProductsToolbox,\n useOrderProductSystemLogs,\n useEventNotesData,\n useSelectedProductId,\n useSelectedProductActionTabKey,\n useClientData,\n useInternalSearchText,\n};\n\nconst notes = atom<any>([]);\n\nexport function usegetNotes() {\n return useAtom(notes);\n}\n\nconst moduleIds = atom<{\n id?: string;\n parentId?: string;\n} | null>(null);\n\nexport function usemoduleIds() {\n return useAtom(moduleIds);\n}\n\nconst callAPi = atom(false);\n\nexport function useLogsCallAPi() {\n return useAtom(callAPi);\n}\n\nconst callOrderProductsApi = atom<boolean>(false);\n\nexport function usecallOrderProductsApi() {\n return useAtom(callOrderProductsApi);\n}\n\nconst selectedProductId = atom<any>([]);\n\nexport function useSelectUpdateOP() {\n return useAtom(selectedProductId);\n}\n\nconst gsitCUstomerId = atom<any>({});\n\nexport function useGsitCUstomerId() {\n return useAtom(gsitCUstomerId);\n}\n\nconst CUstomerId = atom<number | undefined>(undefined);\n\nexport function useCUstomerId() {\n return useAtom(CUstomerId);\n}\n\nconst RouteId = atom<any | null>(null);\n\nexport function useRouteId() {\n return useAtom(RouteId);\n}\n\nconst gsitOrderId = atom<number | undefined>(undefined);\n\nexport function useGsitOrderId() {\n return useAtom(gsitOrderId);\n}\n\nconst orderProductId = atom<number | undefined>(undefined);\n\nexport function useOrderProductId() {\n return useAtom(orderProductId);\n}\nconst returnDataAtom = atom<any[]>([]);\nexport function useReturnData() {\n return useAtom(returnDataAtom);\n}\nconst apiUpdateCalling = atom<boolean>(false);\n\nexport function useUpdateApiCall() {\n return useAtom(apiUpdateCalling);\n}\n\nconst liveRecalling = atom<boolean>(false);\n\n//re api call of live status\nexport function useLiveRecalling() {\n return useAtom(liveRecalling);\n}\n\n//delete products\nconst onDeleteProduct = atom<boolean>(false);\n\nexport function useDeleteRecall() {\n return useAtom(onDeleteProduct);\n}\n\nexport const selectedTabKeyAtom = atom<string>('1');\nexport const letselectedProductIdAtom = atom<number | null>(null);\n\n// const BulkUPdateDisabledState = atom<boolean>(false);\n// export const useBulkUPdateDisabledState = () => {\n// return useAtom(BulkUPdateDisabledState);\n// };\n\nconst auditLogLoadingState = atom<boolean>(true);\nexport function useAuditLogLoadingState() {\n return useAtom(auditLogLoadingState);\n}\n\nconst globalStateHitAuditLog = atom<boolean>(false);\nexport function useGlobalStateHitAuditLog() {\n return useAtom(globalStateHitAuditLog);\n}\n\nconst globalOrderGetApi = atom<boolean>(true);\n\nexport function useGlobalStateHitOrder() {\n return useAtom(globalOrderGetApi);\n}\n\n//force debrief states\nconst globalEscData = atom<any>([]);\nexport function useGlobalEscData() {\n return useAtom(globalEscData);\n}\n\nconst activeTab = atom<any>('success');\n\nexport function useActiveTab() {\n return useAtom(activeTab);\n}\n\nconst chargesStateAtom = atom<ChargesType>(chargesIntialValue);\n\nexport function useChargesState() {\n return useAtom(chargesStateAtom);\n}\n\nconst failureReasonAtom = atom<any>('');\nexport function useFailureReason() {\n return useAtom(failureReasonAtom);\n}\n\nconst escalationCategoryAtom = atom<any>('');\n\nexport function useEscalationCategory() {\n return useAtom(escalationCategoryAtom);\n}\n\nconst escalationLevelAtom = atom<any>('');\n\nexport function useEscalationLevel() {\n return useAtom(escalationLevelAtom);\n}\n\nconst escalationReasonAtom = atom<any>('');\n\nexport function useEscalationReason() {\n return useAtom(escalationReasonAtom);\n}\n\nconst newStatusAtom = atom<any>('');\nexport function useNewStatus() {\n return useAtom(newStatusAtom);\n}\n\nconst orderCancelReasonAtom = atom<any>('');\nexport function useOrderCancelReason() {\n return useAtom(orderCancelReasonAtom);\n}\n\nconst orderHoldReasonAtom = atom<any>('');\nexport function useOrderHoldReason() {\n return useAtom(orderHoldReasonAtom);\n}\n\nconst isFailureReasonChangedAtom = atom<boolean>(false);\nexport function useIsFailureReasonChanged() {\n return useAtom(isFailureReasonChangedAtom);\n}\n\nconst zoomCallLogsApiLoader = atom<boolean>(true);\nexport function useZoomCallLogsLoader() {\n return useAtom(zoomCallLogsApiLoader);\n}\n\nconst zoomCallLogs = atom<any>([]);\nexport function useZoomCallLogs() {\n return useAtom(zoomCallLogs);\n}\n\nconst epodImages = atom<any>([]);\nexport function useEpodImages() {\n return useAtom(epodImages);\n}\n\nexport const skeletonTomTom = atom<boolean>(true);\n\n// Popup state Manage\nconst initialState = null;\n\nconst popupReducer = (state: any, action: any) => {\n if (action.type === 'create-return') {\n state = 'create-return';\n return { state };\n }\n if (action.type === 'bulkUpdate') {\n state = 'bulkUpdate';\n return { state };\n } else if (action.type === 'addProduct') {\n state = 'addProduct';\n return { state };\n } else if (action.type === 'split-order') {\n state = 'split-order';\n return { state };\n } else if (action.type === 'deleteProduct') {\n state = 'deleteProduct';\n return { state };\n } else if (action.type === 'defectsModal') {\n state = 'defectsModal';\n return { state };\n } else if (action.type === 'repackModal') {\n state = 'repackModal';\n return { state };\n } else if (action.type === 'qclog') {\n state = 'qclog';\n return { state };\n } else if (action.type === 'qclogtable') {\n state = 'qclogtable';\n return { state };\n } else if (action.type === 'repack') {\n state = 'repack';\n return { state };\n } else if (action.type === 'close') {\n state = null;\n return { state };\n } else {\n throw new Error('unknown action type');\n }\n};\nexport const countReducerAtom = atomWithReducer(initialState, popupReducer);\n"],"names":["activeTabAtom","atom","infoAtom","currentActionAtom","orderStaticDataAtom","customerInfoAtom","ordersInitialValue","unrecieveOrderProducts","updateOrderProducts","chargesIntialValue","useTabType","useAtom","useInfoType","useCurrentAction","useOrderStaticData","useCustomerInfo","orderId","useOrderId","initialConfirmOrderErrValues","errorConfirmOrderAtom","useErrorConfirmOrder","OrderDetailsConfirmOrder","useOrderDetailsConfirmOrder","selectedAction","useSelectionAction","confirmedDate","useNotificationConfirmedDate","cancelOrderProducts","useCancelOrderProducts","customerData","useCustomerData","orderAlertsData","useOrderAlertsData","customerList","useOrderCustomersList","OrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","customerDetails","useCustomerDetails","productDetails","useProductDetails","returnProductDetails","useReturnProductDetails","fetchAgain","usefetchAgain","productDetailsCopy","useProductDetailsCopy","StatusDeatils","useStatusDetails","depotOptions","useDepotOptions","deleteProdId","useDeleteProdsID","errorAtom","orderProductResources","useOrderProductsResources","initialBulkReasonValues","locationOptions","useLocationOptions","orderProductSystemLogs","useOrderProductSystemLogs","returnAfterOrderAtom","useReturnAfterOrderData","clientDataAtom","useClientData","clientData","usegetClientData","internalSearch","useInternalSearchText","notes","usegetNotes","moduleIds","usemoduleIds","gsitCUstomerId","useGsitCUstomerId","CUstomerId","useCUstomerId","RouteId","useRouteId","gsitOrderId","useGsitOrderId","orderProductId","useOrderProductId","returnDataAtom","useReturnData","liveRecalling","useLiveRecalling","auditLogLoadingState","useAuditLogLoadingState","globalStateHitAuditLog","useGlobalStateHitAuditLog","globalOrderGetApi","useGlobalStateHitOrder","globalEscData","useGlobalEscData","activeTab","useActiveTab","chargesStateAtom","useChargesState","failureReasonAtom","useFailureReason","escalationCategoryAtom","useEscalationCategory","escalationLevelAtom","useEscalationLevel","escalationReasonAtom","useEscalationReason","newStatusAtom","useNewStatus","orderCancelReasonAtom","useOrderCancelReason","orderHoldReasonAtom","useOrderHoldReason","isFailureReasonChangedAtom","useIsFailureReasonChanged","zoomCallLogsApiLoader","useZoomCallLogsLoader","zoomCallLogs","useZoomCallLogs","epodImages","useEpodImages","skeletonTomTom","initialState","popupReducer","state","action","countReducerAtom","atomWithReducer"],"mappings":";;;AAgBA,MAA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,EAAgBL,IAAcC,EAAY;"}
|
|
1
|
+
{"version":3,"file":"store.js","sources":["../../../src/components/order-view/store.ts"],"sourcesContent":["import { atom, useAtom } from 'jotai';\nimport { atomWithReducer } from 'jotai/utils';\nimport {\n CancelOrderProductsType,\n ChargesType,\n CreateProduct,\n OrderActionsType,\n OrdersType,\n UnRecieveOrderProduct,\n UpdateOrderProduct,\n} from './types';\nimport {\n ClientData,\n ClientType,\n} from '../order-daily-overview/common/interface';\n// OrderActionsType\nconst activeTabAtom = atom<string>('active');\nconst infoAtom = atom<boolean | undefined>(false);\nconst orderResources = atom<[]>([]);\nconst currentActionAtom = atom<OrderActionsType | undefined>(undefined);\nconst isOnHold = atom<Boolean>(false);\nconst date = atom(new Date());\n\nconst orderStaticDataAtom = atom<any>({});\n\ninterface OrderRecipient {\n recipient_name: string | null;\n postcode: string | null;\n return_action?: string[] | null;\n}\n\nconst customerInfoAtom = atom<OrderRecipient>({\n recipient_name: '',\n postcode: '',\n});\n\nexport const ordersInitialValue: OrdersType = {\n order_locked_time: null,\n depot_id: null,\n gsit_order_id: null,\n customer_id: null,\n trading_name: null,\n recipient_reference: null,\n order_locked: true,\n lock_notes: null,\n order_type_id: null,\n allow_live_tracking: null,\n weight: null,\n cube: null,\n rescheduled: null,\n zone_code: null,\n status: null,\n status_value: null,\n order_status_note: null,\n print_pod: null,\n order_number: null,\n consignment: null,\n action_date: null,\n other_instructions: null,\n schedule_after: null,\n vehicle_type: null,\n latitude: null,\n longitude: null,\n order_locked_by: null,\n delivery_instructions: null,\n drop_time: null,\n created_by: null,\n created_at: null,\n recipient_name: '',\n postcode: '',\n order_recipient: {\n id: null,\n order_id: null,\n recipient_name: null,\n address: null,\n postcode: null,\n postcode_district: null,\n postcode_short: null,\n latitude: null,\n longitude: null,\n what_3words_address: null,\n contact_home: null,\n contact_work: null,\n contact_mobile: null,\n contact_email: null,\n is_comms_enabled: null,\n },\n order_services_detail: {\n order_id: null,\n timed_service_id: null,\n order_delivery_point_id: null,\n order_service_level_id: null,\n heavy_order: null,\n heavy_item: null,\n bulky_order: null,\n bulky_item: null,\n id: null,\n },\n order_services: [\n {\n order_id: null,\n order_service_list_id: null,\n service_time: null,\n is_refused: null,\n service_note: null,\n id: null,\n service_category_id: 0,\n },\n ],\n order_routes: null,\n order_eta_updates: [],\n order_delivery_declined_dates: [],\n order_communications: [],\n id: null,\n name: '',\n carrier_id: null,\n order_type: {\n type: null,\n },\n assemble: false,\n disassemble: false,\n unpack_items: false,\n take_packaging_away: false,\n collect_disposal: false,\n assembly_type: null,\n route_id: null,\n hold_untill: null,\n hold_reason: null,\n\n order_on_hold: {\n order_id: null,\n hold_indefinitely: null,\n hold_until: null,\n reason_id: null,\n un_hold: null,\n },\n\n refused_service: [],\n refused_service_reason: '',\n invalid_order: null,\n owner_name: null,\n force_debrief_enabled: null,\n import_reference: null,\n labels: null,\n};\n\nexport const orderProductInitialvalue: CreateProduct = {\n code: '',\n description: '',\n sku: '',\n weight: 0,\n cube: 0,\n order_id: 0,\n order_product_type_id: 0,\n return_reason_id: 0,\n collection_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nexport const unrecieveOrderProducts: UnRecieveOrderProduct = {\n unrecieve_reason_id: 0,\n unrecieve_note: '',\n // id: 0\n};\n\nexport const updateOrderProducts: UpdateOrderProduct = {\n id: 0,\n order_id: 0,\n product_type_id: 0,\n product_return_action_id: 0,\n return_location: '',\n return_reason_id: 0,\n};\n\n//force debrief\nconst chargesIntialValue: ChargesType = {\n base_charge_type: 1,\n base_charge: 0,\n weight: 0,\n drop_time: 0,\n timed_service: 0,\n wait_time: 0,\n extra_floor: 0,\n bulky_items: 0,\n re_label: 0,\n extra_cube: 0,\n additional_box: 0,\n additional_item: 0,\n weekend: 0,\n re_allocation: 0,\n pre_dated: 0,\n re_package: 0,\n disassemble: 0,\n qc: 0,\n collection_qc: 0,\n return_to_client: 0,\n roc: 0,\n unpack: 0,\n packaging_disposal: 0,\n assembly: 0,\n debrief_notes: '',\n recycle: 0,\n admin: 0,\n disposal: 0,\n disposal_recycling: 0,\n debrief_status: '',\n new_order_status: '',\n adhoc_charges: [],\n};\n\nexport const usedate = () => {\n return useAtom(date);\n};\nfunction useTabType() {\n return useAtom(activeTabAtom);\n}\nfunction useInfoType() {\n return useAtom(infoAtom);\n}\nfunction useOrderResources() {\n return useAtom(orderResources);\n}\nfunction useCurrentAction() {\n return useAtom(currentActionAtom);\n}\n\nfunction useOrderStaticData() {\n return useAtom(orderStaticDataAtom);\n}\n\nexport function useCustomerInfo() {\n return useAtom(customerInfoAtom);\n}\n\n// Define initial modal state\nexport const initialModalState = {\n openModalType: null,\n};\nfunction useIsOnHoldOrder() {\n return useAtom(isOnHold);\n}\n//value\nconst orderId = atom<any>(undefined);\nexport const useOrderId = () => {\n //dddddddddddd\n return useAtom(orderId);\n};\n\nconst escalationIds = atom<number[]>([]);\n\nfunction useEscalationIDs() {\n return useAtom(escalationIds);\n}\n\nconst bulkUpdateSelectedRow = atom<any[]>([]);\nexport const useBulkUpdateSelectedRow = () => {\n return useAtom(bulkUpdateSelectedRow);\n};\n\nexport const initialConfirmOrderErrValues = {\n homeContactError: '',\n workContactError: '',\n mobileError: '',\n emailError: '',\n};\n\nconst errorConfirmOrderAtom = atom(initialConfirmOrderErrValues);\n\nfunction useErrorConfirmOrder() {\n return useAtom(errorConfirmOrderAtom);\n}\n\nconst OrderDetailsConfirmOrder = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetailsConfirmOrder() {\n return useAtom(OrderDetailsConfirmOrder);\n}\n\nconst selectedAction = atom<string>('');\n\nexport function useSelectionAction() {\n return useAtom(selectedAction);\n}\n\n// REFUSED SERVICES STATE STARTS\n\nconst confirmedDate = atom<{\n previousDate: string | null;\n currentDate: string | null;\n}>({\n previousDate: null,\n currentDate: null,\n});\n\nexport function useNotificationConfirmedDate() {\n return useAtom(confirmedDate);\n}\n\nconst cancelOrderProducts = atom<CancelOrderProductsType[]>([]);\nexport function useCancelOrderProducts() {\n return useAtom(cancelOrderProducts);\n}\n\n// changes customer Account state\nconst customerData = atom<any[]>([]);\nexport const useCustomerData = () => {\n return useAtom(customerData);\n};\n\nconst orderAlertsData = atom<any>({});\nexport function useOrderAlertsData() {\n return useAtom(orderAlertsData);\n}\n\nconst customerList = atom<any>([]);\nexport function useOrderCustomersList() {\n return useAtom(customerList);\n}\n\nexport {\n useTabType,\n useInfoType,\n useOrderResources,\n useCurrentAction,\n useIsOnHoldOrder,\n useOrderStaticData,\n useEscalationIDs,\n useErrorConfirmOrder,\n useOrderDetailsConfirmOrder,\n};\n\n// Remainder count\nconst OrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction useOrderDetails() {\n return useAtom(OrderDetails);\n}\n\nconst prevOrderDetails = atom<OrdersType>(ordersInitialValue);\nfunction usePrevOrderDetails() {\n return useAtom(prevOrderDetails);\n}\n\nconst customerDetails = atom<any>({});\nfunction useCustomerDetails() {\n return useAtom(customerDetails);\n}\n\nconst DepotDeatils = atom<any>(0);\nfunction useDepotDetails() {\n return useAtom(DepotDeatils);\n}\n/**\n * Products of the *order* (`/order/order_products/{id}`), used by the order-action\n * modals. Kept separate from `returnProductDetails` below — the two endpoints return\n * different shapes and only the return-products one carries pallet data.\n */\nconst productDetails = atom<any[]>([]);\nfunction useProductDetails() {\n return useAtom(productDetails);\n}\n\n/** Products of the *return order* (`/v1/return/products/{id}`) — carries `pallet_id`. */\nconst returnProductDetails = atom<any[]>([]);\nexport function useReturnProductDetails() {\n return useAtom(returnProductDetails);\n}\n\nconst fetchAgain = atom<boolean>(false);\nexport function usefetchAgain() {\n return useAtom(fetchAgain);\n}\n\nconst productDetailsCopy = atom<any>([]);\nexport function useProductDetailsCopy() {\n return useAtom(productDetailsCopy);\n}\n\nconst StatusDeatils = atom<any>(0);\nfunction useStatusDetails() {\n return useAtom(StatusDeatils);\n}\n\nconst depotOptions = atom<any>([]);\nfunction useDepotOptions() {\n return useAtom(depotOptions);\n}\n\nconst depotEscData = atom<any>([]);\nfunction useEscData() {\n return useAtom(depotEscData);\n}\nconst deleteProdId = atom<any[]>([]);\nfunction useDeleteProdsID() {\n return useAtom(deleteProdId);\n}\n\nconst createOrderProduct = atom<any[]>([]);\nfunction useCreateOrderProducts() {\n return useAtom(createOrderProduct);\n}\n\nconst unrevieveOrderProduct = atom<UnRecieveOrderProduct>(\n unrecieveOrderProducts\n);\nfunction useRecieveOrderProducts() {\n return useAtom(unrevieveOrderProduct);\n}\n\nconst updateOrderProduct = atom<UpdateOrderProduct>(updateOrderProducts);\nfunction useUpdateOrderProducts() {\n return useAtom(updateOrderProduct);\n}\nconst CallAPi = atom(false);\n\nexport function useCallAPi() {\n return useAtom(CallAPi);\n}\n// export const selectedProductIdAtom = atom<number | null>(null);\n\nexport const selectedProductActionTabKeyAtom = atom<string>(\n 'update_product_type_tab'\n);\nfunction useSelectedProductActionTabKey() {\n return useAtom(selectedProductActionTabKeyAtom);\n}\n\nexport const errorAtom = atom({\n homeContactError: '',\n workCOntanctError: '',\n mobileError: '',\n emailError: '',\n w3wError: '',\n postCodeError: '',\n});\n\nconst orderProductResources = atom<any>([]);\nfunction useOrderProductsResources() {\n return useAtom(orderProductResources);\n}\n\nconst orderProductToolbox = atom<any>([]);\nfunction useOrderProductsToolbox() {\n return useAtom(orderProductToolbox);\n}\n\nexport const initialBulkReasonValues = {\n collection_reason_id: 0,\n return_reason_id: 0,\n product_return_action_id: 0,\n return_location: '',\n};\n\nconst bulkReasonsAtom = atom<any>(initialBulkReasonValues);\nexport function useBulkReasons() {\n return useAtom(bulkReasonsAtom);\n}\n\nconst bulkUpdatePayloadAtom = atom<any>([]);\nexport function useBulkUpdatePayload() {\n return useAtom(bulkUpdatePayloadAtom);\n}\n\nconst singleProductTypeUpdateAtom = atom<any>({\n order_product_type_id: 0,\n order_product_type: '',\n});\nexport function useSingleProductTypeUpdate() {\n return useAtom(singleProductTypeUpdateAtom);\n}\n\nconst locationOptions = atom<any>([]);\nexport function useLocationOptions() {\n return useAtom(locationOptions);\n}\nconst orderProductSystemLogs = atom<any>([]);\nfunction useOrderProductSystemLogs() {\n return useAtom(orderProductSystemLogs);\n}\n\nconst eventNotesData = atom<any>([]);\nfunction useEventNotesData() {\n return useAtom(eventNotesData);\n}\n\nconst selectedProductIdAtom = atom<number | undefined>(undefined);\nfunction useSelectedProductId() {\n return useAtom(selectedProductIdAtom);\n}\nconst returnAfterOrderAtom = atom<any[]>([]);\n\nexport function useReturnAfterOrderData() {\n return useAtom(returnAfterOrderAtom);\n}\n\nconst clientDataAtom = atom<ClientData[]>([]);\nfunction useClientData() {\n return useAtom(clientDataAtom);\n}\n\nconst clientData = atom<ClientType[]>([]);\n\nexport function usegetClientData() {\n return useAtom(clientData);\n}\n\nconst internalSearch = atom<string>('');\n\nfunction useInternalSearchText() {\n return useAtom(internalSearch);\n}\n\nexport {\n useAtom,\n useOrderDetails,\n useCustomerDetails,\n useProductDetails,\n useDepotDetails,\n useStatusDetails,\n useDepotOptions,\n usePrevOrderDetails,\n useEscData,\n useDeleteProdsID,\n useCreateOrderProducts,\n useRecieveOrderProducts,\n useUpdateOrderProducts,\n useOrderProductsResources,\n useOrderProductsToolbox,\n useOrderProductSystemLogs,\n useEventNotesData,\n useSelectedProductId,\n useSelectedProductActionTabKey,\n useClientData,\n useInternalSearchText,\n};\n\nconst notes = atom<any>([]);\n\nexport function usegetNotes() {\n return useAtom(notes);\n}\n\nconst moduleIds = atom<{\n id?: string;\n parentId?: string;\n} | null>(null);\n\nexport function usemoduleIds() {\n return useAtom(moduleIds);\n}\n\nconst callAPi = atom(false);\n\nexport function useLogsCallAPi() {\n return useAtom(callAPi);\n}\n\nconst callOrderProductsApi = atom<boolean>(false);\n\nexport function usecallOrderProductsApi() {\n return useAtom(callOrderProductsApi);\n}\n\nconst selectedProductId = atom<any>([]);\n\nexport function useSelectUpdateOP() {\n return useAtom(selectedProductId);\n}\n\nconst gsitCUstomerId = atom<any>({});\n\nexport function useGsitCUstomerId() {\n return useAtom(gsitCUstomerId);\n}\n\nconst CUstomerId = atom<number | undefined>(undefined);\n\nexport function useCUstomerId() {\n return useAtom(CUstomerId);\n}\n\nconst RouteId = atom<any | null>(null);\n\nexport function useRouteId() {\n return useAtom(RouteId);\n}\n\nconst gsitOrderId = atom<number | undefined>(undefined);\n\nexport function useGsitOrderId() {\n return useAtom(gsitOrderId);\n}\n\nconst orderProductId = atom<number | undefined>(undefined);\n\nexport function useOrderProductId() {\n return useAtom(orderProductId);\n}\nconst returnDataAtom = atom<any[]>([]);\nexport function useReturnData() {\n return useAtom(returnDataAtom);\n}\nconst apiUpdateCalling = atom<boolean>(false);\n\nexport function useUpdateApiCall() {\n return useAtom(apiUpdateCalling);\n}\n\nconst liveRecalling = atom<boolean>(false);\n\n//re api call of live status\nexport function useLiveRecalling() {\n return useAtom(liveRecalling);\n}\n\n//delete products\nconst onDeleteProduct = atom<boolean>(false);\n\nexport function useDeleteRecall() {\n return useAtom(onDeleteProduct);\n}\n\nexport const selectedTabKeyAtom = atom<string>('1');\nexport const letselectedProductIdAtom = atom<number | null>(null);\n\n// const BulkUPdateDisabledState = atom<boolean>(false);\n// export const useBulkUPdateDisabledState = () => {\n// return useAtom(BulkUPdateDisabledState);\n// };\n\nconst auditLogLoadingState = atom<boolean>(true);\nexport function useAuditLogLoadingState() {\n return useAtom(auditLogLoadingState);\n}\n\nconst globalStateHitAuditLog = atom<boolean>(false);\nexport function useGlobalStateHitAuditLog() {\n return useAtom(globalStateHitAuditLog);\n}\n\nconst globalOrderGetApi = atom<boolean>(true);\n\nexport function useGlobalStateHitOrder() {\n return useAtom(globalOrderGetApi);\n}\n\n//force debrief states\nconst globalEscData = atom<any>([]);\nexport function useGlobalEscData() {\n return useAtom(globalEscData);\n}\n\nconst activeTab = atom<any>('success');\n\nexport function useActiveTab() {\n return useAtom(activeTab);\n}\n\nconst chargesStateAtom = atom<ChargesType>(chargesIntialValue);\n\nexport function useChargesState() {\n return useAtom(chargesStateAtom);\n}\n\nconst failureReasonAtom = atom<any>('');\nexport function useFailureReason() {\n return useAtom(failureReasonAtom);\n}\n\nconst escalationCategoryAtom = atom<any>('');\n\nexport function useEscalationCategory() {\n return useAtom(escalationCategoryAtom);\n}\n\nconst escalationLevelAtom = atom<any>('');\n\nexport function useEscalationLevel() {\n return useAtom(escalationLevelAtom);\n}\n\nconst escalationReasonAtom = atom<any>('');\n\nexport function useEscalationReason() {\n return useAtom(escalationReasonAtom);\n}\n\nconst newStatusAtom = atom<any>('');\nexport function useNewStatus() {\n return useAtom(newStatusAtom);\n}\n\nconst orderCancelReasonAtom = atom<any>('');\nexport function useOrderCancelReason() {\n return useAtom(orderCancelReasonAtom);\n}\n\nconst orderHoldReasonAtom = atom<any>('');\nexport function useOrderHoldReason() {\n return useAtom(orderHoldReasonAtom);\n}\n\nconst isFailureReasonChangedAtom = atom<boolean>(false);\nexport function useIsFailureReasonChanged() {\n return useAtom(isFailureReasonChangedAtom);\n}\n\nconst zoomCallLogsApiLoader = atom<boolean>(true);\nexport function useZoomCallLogsLoader() {\n return useAtom(zoomCallLogsApiLoader);\n}\n\nconst zoomCallLogs = atom<any>([]);\nexport function useZoomCallLogs() {\n return useAtom(zoomCallLogs);\n}\n\nconst epodImages = atom<any>([]);\nexport function useEpodImages() {\n return useAtom(epodImages);\n}\n\nexport const skeletonTomTom = atom<boolean>(true);\n\n// Popup state Manage\nconst initialState = null;\n\nconst popupReducer = (state: any, action: any) => {\n if (action.type === 'create-return') {\n state = 'create-return';\n return { state };\n }\n if (action.type === 'bulkUpdate') {\n state = 'bulkUpdate';\n return { state };\n } else if (action.type === 'addProduct') {\n state = 'addProduct';\n return { state };\n } else if (action.type === 'split-order') {\n state = 'split-order';\n return { state };\n } else if (action.type === 'deleteProduct') {\n state = 'deleteProduct';\n return { state };\n } else if (action.type === 'defectsModal') {\n state = 'defectsModal';\n return { state };\n } else if (action.type === 'repackModal') {\n state = 'repackModal';\n return { state };\n } else if (action.type === 'qclog') {\n state = 'qclog';\n return { state };\n } else if (action.type === 'qclogtable') {\n state = 'qclogtable';\n return { state };\n } else if (action.type === 'repack') {\n state = 'repack';\n return { state };\n } else if (action.type === 'close') {\n state = null;\n return { state };\n } else {\n throw new Error('unknown action type');\n }\n};\nexport const countReducerAtom = atomWithReducer(initialState, popupReducer);\n"],"names":["activeTabAtom","atom","infoAtom","currentActionAtom","orderStaticDataAtom","customerInfoAtom","ordersInitialValue","unrecieveOrderProducts","updateOrderProducts","chargesIntialValue","useTabType","useAtom","useInfoType","useCurrentAction","useOrderStaticData","useCustomerInfo","orderId","useOrderId","initialConfirmOrderErrValues","errorConfirmOrderAtom","useErrorConfirmOrder","OrderDetailsConfirmOrder","useOrderDetailsConfirmOrder","selectedAction","useSelectionAction","confirmedDate","useNotificationConfirmedDate","cancelOrderProducts","useCancelOrderProducts","customerData","useCustomerData","orderAlertsData","useOrderAlertsData","customerList","useOrderCustomersList","OrderDetails","useOrderDetails","prevOrderDetails","usePrevOrderDetails","customerDetails","useCustomerDetails","productDetails","useProductDetails","returnProductDetails","useReturnProductDetails","fetchAgain","usefetchAgain","productDetailsCopy","useProductDetailsCopy","StatusDeatils","useStatusDetails","depotOptions","useDepotOptions","deleteProdId","useDeleteProdsID","errorAtom","orderProductResources","useOrderProductsResources","initialBulkReasonValues","locationOptions","useLocationOptions","orderProductSystemLogs","useOrderProductSystemLogs","returnAfterOrderAtom","useReturnAfterOrderData","clientDataAtom","useClientData","clientData","usegetClientData","internalSearch","useInternalSearchText","notes","usegetNotes","moduleIds","usemoduleIds","gsitCUstomerId","useGsitCUstomerId","CUstomerId","useCUstomerId","RouteId","useRouteId","gsitOrderId","useGsitOrderId","orderProductId","useOrderProductId","returnDataAtom","useReturnData","liveRecalling","useLiveRecalling","auditLogLoadingState","useAuditLogLoadingState","globalStateHitAuditLog","useGlobalStateHitAuditLog","globalOrderGetApi","useGlobalStateHitOrder","globalEscData","useGlobalEscData","activeTab","useActiveTab","chargesStateAtom","useChargesState","failureReasonAtom","useFailureReason","escalationCategoryAtom","useEscalationCategory","escalationLevelAtom","useEscalationLevel","escalationReasonAtom","useEscalationReason","newStatusAtom","useNewStatus","orderCancelReasonAtom","useOrderCancelReason","orderHoldReasonAtom","useOrderHoldReason","isFailureReasonChangedAtom","useIsFailureReasonChanged","zoomCallLogsApiLoader","useZoomCallLogsLoader","zoomCallLogs","useZoomCallLogs","epodImages","useEpodImages","skeletonTomTom","initialState","popupReducer","state","action","countReducerAtom","atomWithReducer"],"mappings":";;;AAgBA,MAAMA,IAAgBC,EAAa,QAAQ,GACrCC,IAAWD,EAA0B,EAAK;AACzBA,EAAS,CAAA,CAAE;AAClC,MAAME,IAAoBF,EAAmC,MAAS;AACrDA,EAAc,EAAK;AACvBA,EAAK,oBAAI,KAAA,CAAM;AAE5B,MAAMG,IAAsBH,EAAU,EAAE,GAQlCI,IAAmBJ,EAAqB;AAAA,EAC5C,gBAAgB;AAAA,EAChB,UAAU;AACZ,CAAC,GAEYK,IAAiC;AAAA,EAC5C,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,iBAAiB;AAAA,IACf,IAAI;AAAA,IACJ,UAAU;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ACX,MAAWC,EAAO,SAAS;AACzB,WAAAD,IAAQ,SACD,EAAE,OAAAA,EAAA;AACX,MAAWC,EAAO,SAAS;AACzB,WAAAD,IAAQ,cACD,EAAE,OAAAA,EAAA;AACX,MAAWC,EAAO,SAAS;AACzB,WAAAD,IAAQ,UACD,EAAE,OAAAA,EAAA;AACX,MAAWC,EAAO,SAAS;AACzB,WAAAD,IAAQ,MACD,EAAE,OAAAA,EAAA;AAET,QAAM,IAAI,MAAM,qBAAqB;AAEzC,GACaE,KAAmBC,EAAgBL,IAAcC,EAAY;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getProjectEnv as
|
|
2
|
-
const
|
|
1
|
+
import { getProjectEnv as y } from "@bjsdistribution/dms-component-library";
|
|
2
|
+
const S = (e) => {
|
|
3
3
|
if (e)
|
|
4
4
|
return e.replace(/\b\w/g, function(t) {
|
|
5
5
|
return t.toUpperCase();
|
|
6
6
|
});
|
|
7
|
-
},
|
|
7
|
+
}, T = () => y() === "release_us" ? "$" : "£", b = (e) => {
|
|
8
8
|
const t = [
|
|
9
9
|
"0",
|
|
10
10
|
"1",
|
|
@@ -21,7 +21,7 @@ const g = (e) => {
|
|
|
21
21
|
"ArrowRight"
|
|
22
22
|
];
|
|
23
23
|
e.key === "Backspace" || e.key === "Delete" || e.key === "Tab" || t.includes(e.key) || e.preventDefault();
|
|
24
|
-
},
|
|
24
|
+
}, L = [
|
|
25
25
|
{
|
|
26
26
|
action: "Route",
|
|
27
27
|
type: "Product",
|
|
@@ -70,7 +70,7 @@ const g = (e) => {
|
|
|
70
70
|
date: "6/11/2024 11:26:05 AM",
|
|
71
71
|
images: ""
|
|
72
72
|
}
|
|
73
|
-
],
|
|
73
|
+
], k = (e) => {
|
|
74
74
|
if ((e.ctrlKey || e.metaKey) && (e.key.toLowerCase() === "v" || // Paste
|
|
75
75
|
e.key.toLowerCase() === "c" || // Copy
|
|
76
76
|
e.key.toLowerCase() === "x" || // Cut
|
|
@@ -101,64 +101,65 @@ const g = (e) => {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
t.includes(e.key) || e.preventDefault();
|
|
104
|
-
},
|
|
104
|
+
}, R = (e, t) => {
|
|
105
105
|
const i = {};
|
|
106
|
-
return e.forEach((
|
|
107
|
-
|
|
106
|
+
return e.forEach((o) => {
|
|
107
|
+
o in t && (i[o] = t[o]);
|
|
108
108
|
}), i;
|
|
109
|
-
},
|
|
109
|
+
}, a = (e, t) => {
|
|
110
110
|
if (!e || !t)
|
|
111
111
|
return {};
|
|
112
|
-
const i = Object.keys(e).reduce((r,
|
|
112
|
+
const i = Object.keys(e).reduce((r, n) => ((!(n in t) || e[n] !== t[n]) && r.push(n), r), []);
|
|
113
113
|
return Object.keys(t).forEach((r) => {
|
|
114
114
|
(!(r in e) || e[r] !== t[r]) && (i.includes(r) || i.push(r));
|
|
115
|
-
}),
|
|
116
|
-
},
|
|
115
|
+
}), R(i, t);
|
|
116
|
+
}, A = (e, t) => Object.keys(e).reduce((o, r) => (t.includes(r) || (o[r] = e[r]), o), {}), s = (e) => Object.keys(e).length === 0, M = (e, t) => {
|
|
117
117
|
const {
|
|
118
118
|
order_recipient: i,
|
|
119
|
-
order_routes:
|
|
119
|
+
order_routes: o,
|
|
120
120
|
order_services_detail: r,
|
|
121
|
-
...
|
|
121
|
+
...n
|
|
122
122
|
} = e, {
|
|
123
|
-
order_recipient:
|
|
124
|
-
order_routes:
|
|
125
|
-
order_services_detail:
|
|
126
|
-
...
|
|
127
|
-
} = t,
|
|
128
|
-
i,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
123
|
+
order_recipient: f,
|
|
124
|
+
order_routes: _,
|
|
125
|
+
order_services_detail: m,
|
|
126
|
+
...h
|
|
127
|
+
} = t, O = a(n, h), { latitude: d, longitude: c, ...g } = O, D = { ...g, id: e.id }, l = {
|
|
128
|
+
...a(i, f),
|
|
129
|
+
...d !== void 0 && { latitude: d },
|
|
130
|
+
...c !== void 0 && { longitude: c }
|
|
131
|
+
}, u = a(
|
|
132
|
+
o,
|
|
133
|
+
_
|
|
134
|
+
), p = a(
|
|
134
135
|
r,
|
|
135
|
-
|
|
136
|
+
m
|
|
136
137
|
);
|
|
137
138
|
return {
|
|
138
|
-
...
|
|
139
|
-
...!
|
|
140
|
-
order_recipient:
|
|
139
|
+
...D,
|
|
140
|
+
...!s(l) && {
|
|
141
|
+
order_recipient: l
|
|
141
142
|
},
|
|
142
|
-
...!
|
|
143
|
-
order_routes:
|
|
143
|
+
...!s(u) && {
|
|
144
|
+
order_routes: u
|
|
144
145
|
},
|
|
145
|
-
...!
|
|
146
|
-
order_services_detail:
|
|
146
|
+
...!s(p) && {
|
|
147
|
+
order_services_detail: p
|
|
147
148
|
}
|
|
148
149
|
};
|
|
149
|
-
},
|
|
150
|
+
}, B = (e) => e.trim() === "" ? "" : e, E = () => y();
|
|
150
151
|
export {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
152
|
+
L as DefectsData,
|
|
153
|
+
S as capitalize,
|
|
154
|
+
M as compareOrderDetailsStates,
|
|
155
|
+
A as filterObject,
|
|
156
|
+
a as findDifference,
|
|
157
|
+
R as generateObj,
|
|
158
|
+
T as getBaseUrlSymbol,
|
|
159
|
+
E as getEnvironment,
|
|
160
|
+
k as handleKeyDown,
|
|
161
|
+
b as handleKeyDownDebrief,
|
|
162
|
+
s as isObjectEmpty,
|
|
163
|
+
B as sanitizeInput
|
|
163
164
|
};
|
|
164
165
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/order-view/utils.ts"],"sourcesContent":["import {\n OrderRecipientType,\n OrderRouteType,\n OrderServicesDetailType,\n OrdersType,\n} from './types';\n\nexport const capitalize = (input: string) => {\n if (!input) {\n return;\n }\n return input.replace(/\\b\\w/g, function(char) {\n return char.toUpperCase();\n });\n};\nimport { getProjectEnv } from '@bjsdistribution/dms-component-library';\n\nexport const getBaseUrlSymbol = (): string => {\n const basedEnv = getProjectEnv();\n return basedEnv === 'release_us' ? '$' : '£';\n};\nexport const handleKeyDownDebrief = (\n e: React.KeyboardEvent<HTMLInputElement>\n) => {\n // Allowed keys: numbers (0-9), '.'\n const allowedKeys = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '.',\n 'ArrowLeft',\n 'ArrowRight',\n ];\n\n // Allow backspace, delete and Tab keys\n if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {\n return;\n }\n\n // Prevent input if key is not in allowedKeys\n if (!allowedKeys.includes(e.key)) {\n e.preventDefault();\n }\n};\nexport const RepackData = [\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n];\nexport const DefectsData = [\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n];\n\nexport const getCookie = (name: string): string | null => {\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n const lastPart = parts.pop();\n if (lastPart !== undefined) {\n return lastPart.split(';').shift() || null;\n }\n }\n return null;\n};\n\nexport const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n // Allow common shortcuts like Ctrl+V, Ctrl+C, Ctrl+A, etc.\n if (e.ctrlKey || e.metaKey) {\n if (\n e.key.toLowerCase() === 'v' || // Paste\n e.key.toLowerCase() === 'c' || // Copy\n e.key.toLowerCase() === 'x' || // Cut\n e.key.toLowerCase() === 'a' // Select All\n ) {\n return;\n }\n }\n\n // Allowed keys: numbers (0-9), '.', '-', '+'\n const allowedKeys = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '.',\n '-',\n '+',\n 'ArrowLeft',\n 'ArrowRight',\n ];\n\n // Allow backspace, delete, and Tab keys\n if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {\n return;\n }\n\n const input = e.currentTarget;\n\n // Check if '+' is allowed only at the start and not duplicated\n if (e.key === '+') {\n // Prevent if '+' is not at the start or there is already a '+' in the input\n if (input.selectionStart !== 0 || input.value.includes('+')) {\n e.preventDefault();\n return;\n }\n }\n\n // Prevent input if key is not in allowedKeys\n if (!allowedKeys.includes(e.key)) {\n e.preventDefault();\n }\n};\n\nexport const generateObj = (keys: string[], sourceObj: any) => {\n const newObj: any = {};\n keys.forEach(key => {\n if (key in sourceObj) {\n newObj[key] = sourceObj[key];\n }\n });\n return newObj;\n};\n\nexport const findDifference = (obj1: any, obj2: any) => {\n // Check if obj1 or obj2 is null or undefined and return an empty object if so\n if (!obj1 || !obj2) {\n return {};\n }\n\n const diffKeys = Object.keys(obj1).reduce((acc: any, key) => {\n if (!(key in obj2) || obj1[key] !== obj2[key]) {\n acc.push(key);\n }\n return acc;\n }, []);\n\n Object.keys(obj2).forEach(key => {\n if (!(key in obj1) || obj1[key] !== obj2[key]) {\n if (!diffKeys.includes(key)) {\n diffKeys.push(key);\n }\n }\n });\n\n const newObj = generateObj(diffKeys, obj2);\n return newObj;\n};\n\nexport const filterObject = (obj: any, keysToRemove: any[]) => {\n const filteredObj = Object.keys(obj).reduce((acc: any, key: any) => {\n if (!keysToRemove.includes(key)) {\n acc[key] = obj[key];\n }\n return acc;\n }, {});\n\n return filteredObj;\n};\n\nexport const isObjectEmpty = (objectName: object) => {\n return Object.keys(objectName).length === 0;\n};\n\nexport const compareArrays = (arr: any, newArr: any) => {\n const required_output: any = [];\n newArr.forEach((newObj: any) => {\n arr.forEach((oldObj: any) => {\n if (!newObj.hasOwnProperty('id')) {\n required_output.push(newObj);\n } else {\n const newObjFiltered = {};\n if (newObj.id === oldObj.id) {\n Object.keys(newObj).forEach((key: any) => {\n if (\n key !== 'id' &&\n oldObj.hasOwnProperty(key) &&\n newObj[key] !== oldObj[key]\n ) {\n //@ts-ignore\n newObjFiltered[key] = newObj[key];\n }\n });\n const isEmpty = isObjectEmpty(newObjFiltered);\n if (!isEmpty) {\n const clone = { ...newObjFiltered, id: newObj.id };\n required_output.push(clone);\n }\n // const newObjFiltered = { id: newObj.id };\n }\n }\n });\n });\n return required_output;\n};\n\nexport const compareOrderDetailsStates = (\n oldData: OrdersType,\n newData: OrdersType\n) => {\n const {\n order_recipient: oldOrderRecipient,\n order_routes: oldOrderRoutes,\n order_services_detail: oldOrderServicesDetail,\n ...oldRequiredData\n } = oldData;\n const {\n order_recipient: newOrderRecipient,\n order_routes: newOrderRoutes,\n order_services_detail: newOrderServicesDetail,\n ...newRequiredData\n } = newData;\n\n const payload: OrdersType = findDifference(oldRequiredData, newRequiredData);\n\n const payloadWithId = { ...payload, id: oldData.id };\n\n const payloadOrderRecipient: OrderRecipientType = findDifference(\n oldOrderRecipient,\n newOrderRecipient\n );\n\n const payloadOrderRoutes: OrderRouteType = findDifference(\n oldOrderRoutes,\n newOrderRoutes\n );\n\n const payloadOrderServicesDetail: OrderServicesDetailType = findDifference(\n oldOrderServicesDetail,\n newOrderServicesDetail\n );\n\n const finalPayload = {\n ...payloadWithId,\n ...(!isObjectEmpty(payloadOrderRecipient) && {\n order_recipient: payloadOrderRecipient,\n }),\n ...(!isObjectEmpty(payloadOrderRoutes) && {\n order_routes: payloadOrderRoutes,\n }),\n ...(!isObjectEmpty(payloadOrderServicesDetail) && {\n order_services_detail: payloadOrderServicesDetail,\n }),\n };\n\n return finalPayload;\n};\n\nexport const sanitizeInput = (value: string): string => {\n return value.trim() === '' ? '' : value;\n};\nexport const getEnvironment = ():\n | 'development'\n | 'release_us'\n | 'release_uk'\n | 'staging' => {\n return getProjectEnv() as any;\n};\n"],"names":["capitalize","input","char","getBaseUrlSymbol","getProjectEnv","handleKeyDownDebrief","allowedKeys","DefectsData","handleKeyDown","generateObj","keys","sourceObj","newObj","key","findDifference","obj1","obj2","diffKeys","acc","filterObject","obj","keysToRemove","isObjectEmpty","objectName","compareOrderDetailsStates","oldData","newData","oldOrderRecipient","oldOrderRoutes","oldOrderServicesDetail","oldRequiredData","newOrderRecipient","newOrderRoutes","newOrderServicesDetail","newRequiredData","payloadWithId","payloadOrderRecipient","payloadOrderRoutes","payloadOrderServicesDetail","sanitizeInput","value","getEnvironment"],"mappings":";AAOO,MAAMA,IAAa,CAACC,MAAkB;AAC3C,MAAKA;AAGL,WAAOA,EAAM,QAAQ,SAAS,SAASC,GAAM;AAC3C,aAAOA,EAAK,YAAA;AAAA,IACd,CAAC;AACH,GAGaC,IAAmB,MACbC,EAAA,MACG,eAAe,MAAM,KAE9BC,IAAuB,CAClC,MACG;AAEH,QAAMC,IAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAIF,EAAI,EAAE,QAAQ,eAAe,EAAE,QAAQ,YAAY,EAAE,QAAQ,SAKxDA,EAAY,SAAS,EAAE,GAAG,KAC7B,EAAE,eAAA;AAEN,GA+BaC,IAAc;AAAA,EACzB;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAAA,EAEV;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA;AAAA,EAEV;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB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GAAI,CAACb,EAAcc,CAAqB,KAAK;AAAA,MAC3C,iBAAiBA;AAAA,IAAA;AAAA,IAEnB,GAAI,CAACd,EAAce,CAAkB,KAAK;AAAA,MACxC,cAAcA;AAAA,IAAA;AAAA,IAEhB,GAAI,CAACf,EAAcgB,CAA0B,KAAK;AAAA,MAChD,uBAAuBA;AAAA,IAAA;AAAA,EACzB;AAIJ,GAEaC,IAAgB,CAACC,MACrBA,EAAM,KAAA,MAAW,KAAK,KAAKA,GAEvBC,IAAiB,MAKrBrC,EAAA;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/order-view/utils.ts"],"sourcesContent":["import {\n OrderRecipientType,\n OrderRouteType,\n OrderServicesDetailType,\n OrdersType,\n} from './types';\n\nexport const capitalize = (input: string) => {\n if (!input) {\n return;\n }\n return input.replace(/\\b\\w/g, function(char) {\n return char.toUpperCase();\n });\n};\nimport { getProjectEnv } from '@bjsdistribution/dms-component-library';\n\nexport const getBaseUrlSymbol = (): string => {\n const basedEnv = getProjectEnv();\n return basedEnv === 'release_us' ? '$' : '£';\n};\nexport const handleKeyDownDebrief = (\n e: React.KeyboardEvent<HTMLInputElement>\n) => {\n // Allowed keys: numbers (0-9), '.'\n const allowedKeys = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '.',\n 'ArrowLeft',\n 'ArrowRight',\n ];\n\n // Allow backspace, delete and Tab keys\n if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {\n return;\n }\n\n // Prevent input if key is not in allowedKeys\n if (!allowedKeys.includes(e.key)) {\n e.preventDefault();\n }\n};\nexport const RepackData = [\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n packaging_type: 'Recycled Cardboard',\n products: 'DWLK1006 - Altair TV stand for TVs up to 60\"(0067564578)',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n];\nexport const DefectsData = [\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n {\n action: 'Route',\n type: 'Product',\n primary_position: 'Right Side',\n secondary_position: 'Bottom Left',\n tertiary_position: 'Other',\n primary_details: 'Smashed Glass',\n secondary_details: 'Remote/Mechanism Does not Function',\n created_by: 'TST-002 Training Driver',\n date: '6/11/2024 11:26:05 AM',\n images: '',\n },\n];\n\nexport const getCookie = (name: string): string | null => {\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n const lastPart = parts.pop();\n if (lastPart !== undefined) {\n return lastPart.split(';').shift() || null;\n }\n }\n return null;\n};\n\nexport const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n // Allow common shortcuts like Ctrl+V, Ctrl+C, Ctrl+A, etc.\n if (e.ctrlKey || e.metaKey) {\n if (\n e.key.toLowerCase() === 'v' || // Paste\n e.key.toLowerCase() === 'c' || // Copy\n e.key.toLowerCase() === 'x' || // Cut\n e.key.toLowerCase() === 'a' // Select All\n ) {\n return;\n }\n }\n\n // Allowed keys: numbers (0-9), '.', '-', '+'\n const allowedKeys = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '.',\n '-',\n '+',\n 'ArrowLeft',\n 'ArrowRight',\n ];\n\n // Allow backspace, delete, and Tab keys\n if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {\n return;\n }\n\n const input = e.currentTarget;\n\n // Check if '+' is allowed only at the start and not duplicated\n if (e.key === '+') {\n // Prevent if '+' is not at the start or there is already a '+' in the input\n if (input.selectionStart !== 0 || input.value.includes('+')) {\n e.preventDefault();\n return;\n }\n }\n\n // Prevent input if key is not in allowedKeys\n if (!allowedKeys.includes(e.key)) {\n e.preventDefault();\n }\n};\n\nexport const generateObj = (keys: string[], sourceObj: any) => {\n const newObj: any = {};\n keys.forEach(key => {\n if (key in sourceObj) {\n newObj[key] = sourceObj[key];\n }\n });\n return newObj;\n};\n\nexport const findDifference = (obj1: any, obj2: any) => {\n // Check if obj1 or obj2 is null or undefined and return an empty object if so\n if (!obj1 || !obj2) {\n return {};\n }\n\n const diffKeys = Object.keys(obj1).reduce((acc: any, key) => {\n if (!(key in obj2) || obj1[key] !== obj2[key]) {\n acc.push(key);\n }\n return acc;\n }, []);\n\n Object.keys(obj2).forEach(key => {\n if (!(key in obj1) || obj1[key] !== obj2[key]) {\n if (!diffKeys.includes(key)) {\n diffKeys.push(key);\n }\n }\n });\n\n const newObj = generateObj(diffKeys, obj2);\n return newObj;\n};\n\nexport const filterObject = (obj: any, keysToRemove: any[]) => {\n const filteredObj = Object.keys(obj).reduce((acc: any, key: any) => {\n if (!keysToRemove.includes(key)) {\n acc[key] = obj[key];\n }\n return acc;\n }, {});\n\n return filteredObj;\n};\n\nexport const isObjectEmpty = (objectName: object) => {\n return Object.keys(objectName).length === 0;\n};\n\nexport const compareArrays = (arr: any, newArr: any) => {\n const required_output: any = [];\n newArr.forEach((newObj: any) => {\n arr.forEach((oldObj: any) => {\n if (!newObj.hasOwnProperty('id')) {\n required_output.push(newObj);\n } else {\n const newObjFiltered = {};\n if (newObj.id === oldObj.id) {\n Object.keys(newObj).forEach((key: any) => {\n if (\n key !== 'id' &&\n oldObj.hasOwnProperty(key) &&\n newObj[key] !== oldObj[key]\n ) {\n //@ts-ignore\n newObjFiltered[key] = newObj[key];\n }\n });\n const isEmpty = isObjectEmpty(newObjFiltered);\n if (!isEmpty) {\n const clone = { ...newObjFiltered, id: newObj.id };\n required_output.push(clone);\n }\n // const newObjFiltered = { id: newObj.id };\n }\n }\n });\n });\n return required_output;\n};\n\nexport const compareOrderDetailsStates = (\n oldData: OrdersType,\n newData: OrdersType\n) => {\n const {\n order_recipient: oldOrderRecipient,\n order_routes: oldOrderRoutes,\n order_services_detail: oldOrderServicesDetail,\n ...oldRequiredData\n } = oldData;\n const {\n order_recipient: newOrderRecipient,\n order_routes: newOrderRoutes,\n order_services_detail: newOrderServicesDetail,\n ...newRequiredData\n } = newData;\n\n const payload: OrdersType = findDifference(oldRequiredData, newRequiredData);\n\n // latitude/longitude live at the top level for display mapping only;\n // the update payload must still nest them under order_recipient.\n const { latitude: payloadLatitude, longitude: payloadLongitude, ...payloadRest } = payload;\n\n const payloadWithId = { ...payloadRest, id: oldData.id };\n\n const payloadOrderRecipient: OrderRecipientType = {\n ...findDifference(oldOrderRecipient, newOrderRecipient),\n ...(payloadLatitude !== undefined && { latitude: payloadLatitude }),\n ...(payloadLongitude !== undefined && { longitude: payloadLongitude }),\n };\n\n const payloadOrderRoutes: OrderRouteType = findDifference(\n oldOrderRoutes,\n newOrderRoutes\n );\n\n const payloadOrderServicesDetail: OrderServicesDetailType = findDifference(\n oldOrderServicesDetail,\n newOrderServicesDetail\n );\n\n const finalPayload = {\n ...payloadWithId,\n ...(!isObjectEmpty(payloadOrderRecipient) && {\n order_recipient: payloadOrderRecipient,\n }),\n ...(!isObjectEmpty(payloadOrderRoutes) && {\n order_routes: payloadOrderRoutes,\n }),\n ...(!isObjectEmpty(payloadOrderServicesDetail) && {\n order_services_detail: payloadOrderServicesDetail,\n }),\n };\n\n return finalPayload;\n};\n\nexport const sanitizeInput = (value: string): string => {\n return value.trim() === '' ? '' : value;\n};\nexport const getEnvironment = ():\n | 'development'\n | 'release_us'\n | 'release_uk'\n | 'staging' => {\n return getProjectEnv() as any;\n};\n"],"names":["capitalize","input","char","getBaseUrlSymbol","getProjectEnv","handleKeyDownDebrief","allowedKeys","DefectsData","handleKeyDown","generateObj","keys","sourceObj","newObj","key","findDifference","obj1","obj2","diffKeys","acc","filterObject","obj","keysToRemove","isObjectEmpty","objectName","compareOrderDetailsStates","oldData","newData","oldOrderRecipient","oldOrderRoutes","oldOrderServicesDetail","oldRequiredData","newOrderRecipient","newOrderRoutes","newOrderServicesDetail","newRequiredData","payload","payloadLatitude","payloadLongitude","payloadRest","payloadWithId","payloadOrderRecipient","payloadOrderRoutes","payloadOrderServicesDetail","sanitizeInput","value","getEnvironment"],"mappings":";AAOO,MAAMA,IAAa,CAACC,MAAkB;AAC3C,MAAKA;AAGL,WAAOA,EAAM,QAAQ,SAAS,SAASC,GAAM;AAC3C,aAAOA,EAAK,YAAA;AAAA,IACd,CAAC;AACH,GAGaC,IAAmB,MACbC,EAAA,MACG,eAAe,MAAM,KAE9BC,IAAuB,CAClC,MACG;AAEH,QAAMC,IAAc;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,I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@ -43,6 +43,8 @@ export type OrderRecipientType = {
|
|
|
43
43
|
postcode?: string | null;
|
|
44
44
|
postcode_district?: string | null;
|
|
45
45
|
postcode_short?: string | null;
|
|
46
|
+
latitude?: string | null;
|
|
47
|
+
longitude?: string | null;
|
|
46
48
|
what_3words_address?: string | null;
|
|
47
49
|
contact_home?: string | null;
|
|
48
50
|
contact_work?: string | null;
|
|
@@ -55,8 +55,6 @@ export declare const compareOrderDetailsStates: (oldData: OrdersType, newData: O
|
|
|
55
55
|
other_instructions: string | null;
|
|
56
56
|
schedule_after?: any | null;
|
|
57
57
|
vehicle_type: string | null;
|
|
58
|
-
latitude?: string | null;
|
|
59
|
-
longitude?: string | null;
|
|
60
58
|
order_services?: import('./types').OrderServiceType[];
|
|
61
59
|
order_eta_updates: any[];
|
|
62
60
|
order_delivery_declined_dates: any[];
|
package/package.json
CHANGED