@os1-platform/dispatch-mobile 1.0.8 → 1.3.11
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/README.md +116 -48
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +4 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +131 -0
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +0 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +46 -39
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +14 -24
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +142 -23
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +64 -16
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +6 -16
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +68 -26
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +4 -13
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +61 -28
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +5 -19
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +62 -18
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +112 -28
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -26
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +49 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -16
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -10
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +4 -13
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +0 -12
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +7 -35
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +74 -49
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js +0 -4
- package/lib/commonjs/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +0 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -17
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +63 -24
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -22
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +5 -15
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +60 -19
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +843 -0
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js +6 -0
- package/lib/commonjs/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js +19 -0
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js +29 -0
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +103 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +74 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +115 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js +134 -0
- package/lib/commonjs/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js +373 -0
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js +3 -21
- package/lib/commonjs/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js +4 -9
- package/lib/commonjs/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js +7 -36
- package/lib/commonjs/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js +0 -5
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js +0 -9
- package/lib/commonjs/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -14
- package/lib/commonjs/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js +1 -40
- package/lib/commonjs/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -17
- package/lib/commonjs/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js +0 -28
- package/lib/commonjs/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +334 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js +14 -0
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js +37 -0
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +59 -0
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +147 -0
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -13
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -17
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +3 -18
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +0 -5
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +0 -12
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +34 -0
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -0
- package/lib/commonjs/components/widgets/ProgressDialog.js +0 -7
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +38 -38
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +93 -0
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/commonjs/components/widgets/Toaster.js +0 -2
- package/lib/commonjs/components/widgets/Toaster.js.map +1 -1
- package/lib/commonjs/config/DispatchSDKConfig.js +4 -5
- package/lib/commonjs/config/DispatchSDKConfig.js.map +1 -1
- package/lib/commonjs/constants/apiConstants.js +15 -0
- package/lib/commonjs/constants/apiConstants.js.map +1 -0
- package/lib/commonjs/constants/constants.js +7 -3
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/constants/statuscode.js +3 -5
- package/lib/commonjs/constants/statuscode.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -8
- package/lib/commonjs/errors/BaseError.js.map +1 -1
- package/lib/commonjs/errors/ErrorCodes.js +7 -6
- package/lib/commonjs/errors/ErrorCodes.js.map +1 -1
- package/lib/commonjs/events/EventDispatcher.js +27 -0
- package/lib/commonjs/events/EventDispatcher.js.map +1 -0
- package/lib/commonjs/events/EventListener.js +20 -0
- package/lib/commonjs/events/EventListener.js.map +1 -0
- package/lib/commonjs/events/constants.js +13 -0
- package/lib/commonjs/events/constants.js.map +1 -0
- package/lib/commonjs/events/index.js +11 -0
- package/lib/commonjs/events/index.js.map +1 -0
- package/lib/commonjs/events/interface.js +2 -0
- package/lib/commonjs/events/interface.js.map +1 -0
- package/lib/commonjs/index.js +9 -23
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +527 -177
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +55 -4
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +70 -0
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +3 -29
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -20
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js +27 -0
- package/lib/commonjs/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/commonjs/manager/location/LocationManager.js +3 -20
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -36
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -17
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +12 -46
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +13 -7
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js +0 -2
- package/lib/commonjs/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +28 -12
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +0 -19
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +3 -20
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +3 -52
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +59 -25
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +77 -90
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +27 -19
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js +4 -5
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/ReasonCodes.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +28 -35
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js +4 -5
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +3 -24
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +7 -35
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +2 -13
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +10 -8
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js +0 -2
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +6 -21
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/res/strings.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -15
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +3 -8
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/SdkColors.js +7 -7
- package/lib/commonjs/styles/SdkColors.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +42 -18
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +36 -27
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +6 -15
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +0 -19
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +6 -15
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +7 -12
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +6 -16
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +6 -18
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +14 -16
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +36 -15
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +7 -13
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +5 -10
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +27 -14
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +11 -23
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +9 -13
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RTScanScreen.js +8 -27
- package/lib/commonjs/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +268 -0
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +21 -30
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +49 -0
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +0 -10
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +9 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +115 -0
- package/lib/commonjs/utils/ApiUtils.js.map +1 -0
- package/lib/commonjs/utils/ExecTaskUtils.js +93 -31
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +10 -29
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -19
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -31
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +25 -40
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/fcm/FCM.js +35 -16
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +50 -25
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +0 -5
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js +44 -0
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -0
- package/lib/commonjs/utils/loginHelper.js +6 -18
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +53 -32
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +8 -11
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +46 -28
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +3 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +145 -19
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancellationSchema.js.map +1 -1
- package/lib/module/components/executiontasks/captureInput/CaptureText.js +66 -9
- package/lib/module/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverET.js +6 -7
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +69 -16
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/display/DisplayModalET.js +4 -3
- package/lib/module/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/DoodleUtils.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +64 -14
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js +5 -6
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +62 -8
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +114 -14
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +3 -15
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js +39 -0
- package/lib/module/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -0
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +1 -5
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +0 -3
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js +4 -2
- package/lib/module/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js +0 -3
- package/lib/module/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +7 -10
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +75 -35
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +64 -6
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +63 -11
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +71 -10
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +5 -6
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +61 -10
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +833 -0
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js +2 -0
- package/lib/module/components/executiontasks/scan/ScanSchema.js.map +1 -0
- package/lib/module/components/executiontasks/scan/constants.js +7 -0
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -0
- package/lib/module/components/executiontasks/scan/interfaces.js +21 -0
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +94 -0
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +66 -0
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +105 -0
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js +124 -0
- package/lib/module/components/executiontasks/scan/sub_components/ScanList.js.map +1 -0
- package/lib/module/components/executiontasks/scan/utils.js +358 -0
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -0
- package/lib/module/components/executiontasks/scanner/CScanner.js +3 -8
- package/lib/module/components/executiontasks/scanner/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js +3 -3
- package/lib/module/components/executiontasks/scanner/ScannerSchema.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js +6 -18
- package/lib/module/components/executiontasks/scanner/ScannerUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js +0 -2
- package/lib/module/components/executiontasks/scanner/returns/DropDownSelector.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js +0 -5
- package/lib/module/components/executiontasks/scanner/returns/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js +0 -3
- package/lib/module/components/executiontasks/scanner/returns/RTReasonSelection.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js +1 -19
- package/lib/module/components/executiontasks/scanner/returns/RTScan.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js +0 -7
- package/lib/module/components/executiontasks/scanner/returns/ReasonDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js +0 -15
- package/lib/module/components/executiontasks/scanner/returns/ScanList.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js +325 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js +8 -0
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPSchema.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js +25 -0
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js +49 -0
- package/lib/module/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js +133 -0
- package/lib/module/components/executiontasks/validateOTP/utils.js.map +1 -0
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js +0 -6
- package/lib/module/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js +4 -3
- package/lib/module/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js +4 -8
- package/lib/module/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/module/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/module/components/widgets/CancelOrderDialog.js +0 -2
- package/lib/module/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +26 -0
- package/lib/module/components/widgets/IconButton.js.map +1 -0
- package/lib/module/components/widgets/ProgressDialog.js +0 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +36 -18
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +84 -0
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -0
- package/lib/module/components/widgets/Toaster.js.map +1 -1
- package/lib/module/config/DispatchSDKConfig.js +3 -4
- package/lib/module/config/DispatchSDKConfig.js.map +1 -1
- package/lib/module/constants/apiConstants.js +7 -0
- package/lib/module/constants/apiConstants.js.map +1 -0
- package/lib/module/constants/constants.js +4 -2
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/constants/statuscode.js +3 -5
- package/lib/module/constants/statuscode.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -6
- package/lib/module/errors/BaseError.js.map +1 -1
- package/lib/module/errors/ErrorCodes.js +5 -5
- package/lib/module/errors/ErrorCodes.js.map +1 -1
- package/lib/module/events/EventDispatcher.js +19 -0
- package/lib/module/events/EventDispatcher.js.map +1 -0
- package/lib/module/events/EventListener.js +13 -0
- package/lib/module/events/EventListener.js.map +1 -0
- package/lib/module/events/constants.js +6 -0
- package/lib/module/events/constants.js.map +1 -0
- package/lib/module/events/index.js +3 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/interface.js +2 -0
- package/lib/module/events/interface.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/manager/dispatch/DispatchStateContainer.js +529 -151
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +52 -2
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +61 -0
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -0
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +3 -16
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +6 -14
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/jobRemoval/JobRemovalManager.js +20 -0
- package/lib/module/manager/jobRemoval/JobRemovalManager.js.map +1 -0
- package/lib/module/manager/location/LocationManager.js +3 -14
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +8 -14
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +6 -13
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/syncmanager/AppSyncManager.js +12 -26
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +9 -5
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/NativeSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/database.js +27 -3
- package/lib/module/manager/syncmanager/database.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js +0 -7
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +3 -14
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +3 -35
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +59 -18
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +77 -68
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +26 -11
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js +3 -4
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/ReasonCodes.js.map +1 -1
- package/lib/module/models/execTasks/ETBaseModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +22 -29
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js +3 -4
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +3 -18
- package/lib/module/native/signature/SignatureCapture.js.map +1 -1
- package/lib/module/network/GraphQLClient.js +6 -26
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +2 -6
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +10 -3
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +7 -17
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/res/strings.js.map +1 -1
- package/lib/module/resources/Login.js +4 -13
- package/lib/module/resources/Login.js.map +1 -1
- package/lib/module/resources/network.js +3 -6
- package/lib/module/resources/network.js.map +1 -1
- package/lib/module/styles/SdkColors.js +6 -6
- package/lib/module/styles/SdkColors.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +41 -7
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +36 -14
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +7 -4
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +0 -3
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +7 -4
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +5 -4
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +7 -4
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +7 -7
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +3 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +34 -6
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +5 -4
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +5 -3
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +25 -5
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +12 -10
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +7 -5
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/RTScanScreen.js +9 -13
- package/lib/module/ui/screens/RTScanScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +259 -0
- package/lib/module/ui/screens/ScanScreen.js.map +1 -0
- package/lib/module/ui/screens/StartWorkFlowScreen.js +22 -9
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +39 -0
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -0
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +0 -3
- package/lib/module/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +9 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +101 -0
- package/lib/module/utils/ApiUtils.js.map +1 -0
- package/lib/module/utils/ExecTaskUtils.js +92 -21
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +9 -21
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -15
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js +2 -15
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +25 -10
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/fcm/FCM.js +35 -4
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +50 -7
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +0 -3
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js +37 -0
- package/lib/module/utils/hooks/useTimer.js.map +1 -0
- package/lib/module/utils/loginHelper.js +6 -16
- package/lib/module/utils/loginHelper.js.map +1 -1
- package/lib/module/utils/storage.js +51 -29
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +8 -6
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/executiontasks/CompletedWFSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +6 -2
- package/lib/typescript/components/executiontasks/cancellation/CancellationSchema.d.ts +10 -5
- package/lib/typescript/components/executiontasks/captureInput/CaptureInputSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +7 -7
- package/lib/typescript/components/executiontasks/display/DisplaySchema.d.ts +5 -5
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +7 -7
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/forms/widgets/DateTimeWidget.d.ts +1 -1
- package/lib/typescript/components/executiontasks/forms/widgets/DropdownWidget.d.ts +9 -0
- package/lib/typescript/components/executiontasks/httpRequest/HttpRequestETSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +16 -11
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +2 -2
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +3 -3
- package/lib/typescript/components/executiontasks/scan/ScanET.d.ts +16 -0
- package/lib/typescript/components/executiontasks/scan/ScanSchema.d.ts +70 -0
- package/lib/typescript/components/executiontasks/scan/constants.d.ts +6 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +41 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/CScanner.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/DropDownUtils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ERDropDown.d.ts +17 -0
- package/lib/typescript/components/executiontasks/scan/sub_components/ScanList.d.ts +8 -0
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +21 -0
- package/lib/typescript/components/executiontasks/scanner/ScannerSchema.d.ts +6 -6
- package/lib/typescript/components/executiontasks/scanner/returns/DropDownUtils.d.ts +1 -2
- package/lib/typescript/components/executiontasks/scanner/returns/RTReasonSelection.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scanner/returns/ScanList.d.ts +1 -1
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPET.d.ts +4 -0
- package/lib/typescript/components/executiontasks/validateOTP/ValidateOTPSchema.d.ts +54 -0
- package/lib/typescript/components/executiontasks/validateOTP/constants.d.ts +10 -0
- package/lib/typescript/components/executiontasks/validateOTP/sub-components/OTPInput.d.ts +12 -0
- package/lib/typescript/components/executiontasks/validateOTP/utils.d.ts +7 -0
- package/lib/typescript/components/executiontasks/verifyInput/VerifyInputSchema.d.ts +8 -8
- package/lib/typescript/components/executiontasks/verifyLocation/VerifyLocSchema.d.ts +9 -9
- package/lib/typescript/components/executiontasks/verifyOtp/VerifyOtpSchema.d.ts +3 -3
- package/lib/typescript/components/widgets/IconButton.d.ts +9 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +9 -5
- package/lib/typescript/components/widgets/SplitTextInput.d.ts +12 -0
- package/lib/typescript/constants/apiConstants.d.ts +6 -0
- package/lib/typescript/constants/constants.d.ts +4 -2
- package/lib/typescript/errors/ErrorCodes.d.ts +3 -1
- package/lib/typescript/events/EventDispatcher.d.ts +5 -0
- package/lib/typescript/events/EventListener.d.ts +5 -0
- package/lib/typescript/events/constants.d.ts +5 -0
- package/lib/typescript/events/index.d.ts +2 -0
- package/lib/typescript/events/interface.d.ts +1 -0
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/manager/dispatch/DispatchStateContainer.d.ts +21 -8
- package/lib/typescript/manager/dispatchCodes/EventCodeContainer.d.ts +12 -1
- package/lib/typescript/manager/dispatchCodes/EventCodeRepo.d.ts +13 -0
- package/lib/typescript/manager/jobRemoval/JobRemovalManager.d.ts +6 -0
- package/lib/typescript/manager/sdk/DispatchSdkCache.d.ts +2 -0
- package/lib/typescript/manager/syncmanager/AppSyncManager.d.ts +1 -0
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +22 -2
- package/lib/typescript/manager/syncmanager/database.d.ts +5 -0
- package/lib/typescript/manager/syncmanager/document/models.d.ts +1 -1
- package/lib/typescript/manager/syncmanager/events/ETEventsManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/EventsSyncManager.d.ts +5 -1
- package/lib/typescript/manager/syncmanager/events/SyncHttpClient.d.ts +3 -1
- package/lib/typescript/models/DispatchModels.d.ts +56 -1
- package/lib/typescript/models/ReasonCodes.d.ts +5 -0
- package/lib/typescript/models/auth.d.ts +1 -1
- package/lib/typescript/models/execTasks/ETBaseModels.d.ts +27 -8
- package/lib/typescript/models/execTasks/ETConfig.d.ts +8 -4
- package/lib/typescript/models/sdk.d.ts +5 -0
- package/lib/typescript/native/signature/SignatureCapture.d.ts +1 -1
- package/lib/typescript/network/NetworkUtils.d.ts +1 -5
- package/lib/typescript/styles/SdkColors.d.ts +1 -0
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +36 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +3 -1
- package/lib/typescript/ui/screens/ScanScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ValidateOTPScreen.d.ts +3 -0
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +8 -0
- package/lib/typescript/utils/ApiUtils.d.ts +61 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +7 -2
- package/lib/typescript/utils/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/SyncManagerUtils.d.ts +3 -1
- package/lib/typescript/utils/hooks/useTimer.d.ts +5 -0
- package/lib/typescript/utils/storage.d.ts +17 -0
- package/package.json +23 -24
- package/tsconfig.json +9 -8
- package/file_unzip.js +0 -5
- package/mobile-execution-lib-0.6.4.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CommonStyles","ProgressDialog","View","React","useEffect","useState","PLEASE_WAIT","getApiResponse","getHttpETOutput","HttpRequestET","props","inProgress","setInProgress","apiResponse","api","onSubmitET","data","responseJsonPath","error","response","errorJsonPath","mainContainer","message"],"sources":["HttpRequestET.tsx"],"sourcesContent":["import type { HttpRequestETInput } from './HttpRequestETSchema';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { View } from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { PLEASE_WAIT } from '../../../res/strings';\nimport { getApiResponse, getHttpETOutput } from './HttpEtUtils';\n\nconst HttpRequestET = (props: HttpRequestETInput) => {\n const [inProgress, setInProgress] = useState(true);\n\n useEffect(() => {\n (async () => {\n if (inProgress) {\n try {\n const apiResponse = await getApiResponse(props.api);\n setInProgress(false);\n props.onSubmitET(\n await getHttpETOutput(\n apiResponse.data,\n props.api.responseJsonPath,\n true\n )\n );\n } catch (error: any) {\n setInProgress(false);\n if (error.response) {\n /**\n * The request was made and the server responded\n * with a status code that falls out of the range of 2xx\n */\n props.onSubmitET(\n await getHttpETOutput(\n error.response.data,\n props.api.errorJsonPath,\n false\n )\n );\n } else {\n props.onSubmitET(await getHttpETOutput(error, '', false));\n }\n }\n }\n })();\n }, [inProgress, props]);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={inProgress}\n label={props.message ?? PLEASE_WAIT}\n />\n </View>\n );\n};\nexport default HttpRequestET;\n"],"mappings":"AACA,SAASA,
|
|
1
|
+
{"version":3,"names":["CommonStyles","ProgressDialog","View","React","useEffect","useState","PLEASE_WAIT","getApiResponse","getHttpETOutput","HttpRequestET","props","inProgress","setInProgress","apiResponse","api","onSubmitET","data","responseJsonPath","error","response","errorJsonPath","createElement","style","mainContainer","visible","label","message"],"sources":["HttpRequestET.tsx"],"sourcesContent":["import type { HttpRequestETInput } from './HttpRequestETSchema';\nimport { CommonStyles } from '../../../styles/executionTasks/CommonStyles';\nimport ProgressDialog from '../../widgets/ProgressDialog';\nimport { View } from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { PLEASE_WAIT } from '../../../res/strings';\nimport { getApiResponse, getHttpETOutput } from './HttpEtUtils';\n\nconst HttpRequestET = (props: HttpRequestETInput) => {\n const [inProgress, setInProgress] = useState(true);\n\n useEffect(() => {\n (async () => {\n if (inProgress) {\n try {\n const apiResponse = await getApiResponse(props.api);\n setInProgress(false);\n props.onSubmitET(\n await getHttpETOutput(\n apiResponse.data,\n props.api.responseJsonPath,\n true\n )\n );\n } catch (error: any) {\n setInProgress(false);\n if (error.response) {\n /**\n * The request was made and the server responded\n * with a status code that falls out of the range of 2xx\n */\n props.onSubmitET(\n await getHttpETOutput(\n error.response.data,\n props.api.errorJsonPath,\n false\n )\n );\n } else {\n props.onSubmitET(await getHttpETOutput(error, '', false));\n }\n }\n }\n })();\n }, [inProgress, props]);\n return (\n <View style={CommonStyles.mainContainer}>\n <ProgressDialog\n visible={inProgress}\n label={props.message ?? PLEASE_WAIT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tB,YAAY,CAACuB;EAAc,gBACtCpB,KAAA,CAAAkB,aAAA,CAACpB,cAAc;IACbuB,OAAO,EAAEb,UAAW;IACpBc,KAAK,EAAEf,KAAK,CAACgB,OAAO,IAAIpB;EAAY,EACpC,CACG;AAEX,CAAC;AACD,eAAeG,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["CaptureSchema.ts"],"sourcesContent":["/**\n * Length (in cm)\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport interface CapturedImage {\n /**\n * Url of image\n */\n url: string;\n file?: { folder: string; name: string };\n\n /**\n * Epoch timestamp for the image capture\n */\n timestamp: number;\n}\n\nexport type CaptureOutput = BaseETResponse & {\n /**\n * Array of captured images\n */\n captures?: CapturedImage[];\n};\n\nexport type ImageData = {\n id: string;\n path: string;\n url: string;\n timestamp: number;\n};\n\n/**\n * Length (in cm)\n */\nexport type Length = number;\n/**\n * Breadth (in cm)\n */\nexport type Breadth = number;\n/**\n * Maximum Size limit (in kb) of image to be captured\n */\nexport type MaxFileSize = number;\n/**\n * Mode of capturing image\n */\nexport type CaptureMode = 'SINGLE' | 'MULTI';\n/**\n * Max limit of images to be captured in multi-capture mode\n */\nexport type MaxImageCount = number;\n/**\n * Title of instruction\n */\nexport type Title = string;\n/**\n * Message of instruction\n */\nexport type Message = string;\n/**\n * Can go back\n */\nexport type CanGoBack = boolean;\n\nexport type CaptureInput = BaseETRequest & {\n resolution: Resolution;\n fileSizeLimit: MaxFileSize;\n captureMode: CaptureMode;\n captureCountLimit?: MaxImageCount;\n onSubmitET: (etOutput: CaptureOutput) => void;\n} & {\n jobIds: string[];\n objRefs: string[];\n};\n/**\n * Resolution of image to be captured\n */\nexport interface Resolution {\n length: Length;\n breadth: Breadth;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["CaptureSchema.ts"],"sourcesContent":["/**\n * Length (in cm)\n */\nimport type {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\n\nexport interface CapturedImage {\n /**\n * Url of image\n */\n url: string;\n file?: { folder: string; name: string };\n\n /**\n * Epoch timestamp for the image capture\n */\n timestamp: number;\n}\n\nexport type CaptureOutput = BaseETResponse & {\n /**\n * Array of captured images\n */\n captures?: CapturedImage[];\n};\n\nexport type ImageData = {\n id: string;\n path: string;\n url: string;\n timestamp: number;\n};\n\n/**\n * Length (in cm)\n */\nexport type Length = number;\n/**\n * Breadth (in cm)\n */\nexport type Breadth = number;\n/**\n * Maximum Size limit (in kb) of image to be captured\n */\nexport type MaxFileSize = number;\n/**\n * Mode of capturing image\n */\nexport type CaptureMode = 'SINGLE' | 'MULTI';\n/**\n * Max limit of images to be captured in multi-capture mode\n */\nexport type MaxImageCount = number;\n/**\n * Title of instruction\n */\nexport type Title = string;\n/**\n * Message of instruction\n */\nexport type Message = string;\n/**\n * Can go back\n */\nexport type CanGoBack = boolean;\n\nexport type MultiAdditionalConfig = '1' | 'N';\n\nexport interface AdditionalMultiConfig {\n minCaptureCount: MultiAdditionalConfig;\n}\n\nexport type CaptureInput = BaseETRequest & {\n resolution: Resolution;\n fileSizeLimit: MaxFileSize;\n captureMode: CaptureMode;\n captureCountLimit?: MaxImageCount;\n additionalMultiConfig?: AdditionalMultiConfig;\n onSubmitET: (etOutput: CaptureOutput) => void;\n} & {\n jobIds: string[];\n objRefs: string[];\n};\n/**\n * Resolution of image to be captured\n */\nexport interface Resolution {\n length: Length;\n breadth: Breadth;\n}\n"],"mappings":""}
|
|
@@ -31,15 +31,12 @@ export async function getCompressionRatio(uri, maxSize) {
|
|
|
31
31
|
size: true
|
|
32
32
|
});
|
|
33
33
|
maxSize = Math.min(maxSize, 1024);
|
|
34
|
-
|
|
35
34
|
if (fileInfo.exists) {
|
|
36
35
|
let fileSize = fileInfo.size / 1024;
|
|
37
|
-
|
|
38
36
|
if (fileSize > maxSize) {
|
|
39
37
|
return maxSize / fileSize;
|
|
40
38
|
} else return 1;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
40
|
return 1;
|
|
44
41
|
} catch (error) {
|
|
45
42
|
Logger.getInstance().logEvent('getCompressionRatio', error.message, LOG_TYPE.SDK_ERROR);
|
|
@@ -59,11 +56,9 @@ export async function captureImage(imageWidth, imageHeight, fileSize) {
|
|
|
59
56
|
Alert.alert('Permissions Error', 'Camera permissions not provided!');
|
|
60
57
|
return null;
|
|
61
58
|
}
|
|
62
|
-
|
|
63
59
|
let response = await ImagePicker.launchCameraAsync({
|
|
64
60
|
quality: 1
|
|
65
61
|
});
|
|
66
|
-
|
|
67
62
|
if (!response.cancelled) {
|
|
68
63
|
let actionResize = {
|
|
69
64
|
resize: {
|
|
@@ -85,23 +80,26 @@ export async function captureImage(imageWidth, imageHeight, fileSize) {
|
|
|
85
80
|
}
|
|
86
81
|
} catch (exception) {
|
|
87
82
|
showToast(`Error ${exception.message}`);
|
|
83
|
+
console.error('capture image error: ', exception);
|
|
88
84
|
return null;
|
|
89
85
|
}
|
|
90
86
|
}
|
|
91
87
|
export async function getCaptureOutput(imageDataList, captureProps) {
|
|
92
|
-
|
|
88
|
+
var _captureProps$applica;
|
|
89
|
+
if (!imageDataList || imageDataList.length === 0) return {
|
|
90
|
+
...(await getBaseETResponse(EntityCode.IMAGE_CAPTURE, false, getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, false, (_captureProps$applica = captureProps.applicableReasons) === null || _captureProps$applica === void 0 ? void 0 : _captureProps$applica.failure), ''))
|
|
93
91
|
};else {
|
|
94
|
-
|
|
92
|
+
var _captureProps$applica2;
|
|
93
|
+
return {
|
|
94
|
+
...(await getBaseETResponse(EntityCode.IMAGE_CAPTURE, true, getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, true, (_captureProps$applica2 = captureProps.applicableReasons) === null || _captureProps$applica2 === void 0 ? void 0 : _captureProps$applica2.success), '')),
|
|
95
95
|
captures: await getImagesData(imageDataList, captureProps)
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
|
|
100
99
|
async function getImagesData(imagesDataList, captureProps) {
|
|
101
100
|
if (imagesDataList && imagesDataList.length > 0) {
|
|
102
101
|
let output = [];
|
|
103
102
|
const folderName = (await DispatchSdkCache.getInstance().getKeyFromCache(DispatchSdkCache.KEYS.FMS_FOLDER)) ?? 'NULL';
|
|
104
|
-
|
|
105
103
|
for (const data of imagesDataList) {
|
|
106
104
|
let insertID = await insertDocumentInDB(data.id, folderName, JSON.stringify(captureProps.jobIds), JSON.stringify(captureProps.objRefs), null, captureProps.title, data.path);
|
|
107
105
|
if (insertID) output.push({
|
|
@@ -113,7 +111,6 @@ async function getImagesData(imagesDataList, captureProps) {
|
|
|
113
111
|
}
|
|
114
112
|
});else throw new BaseError(BaseErrorCodes.SQLiteDBIssue, 'Unable to save Image');
|
|
115
113
|
}
|
|
116
|
-
|
|
117
114
|
return output;
|
|
118
115
|
} else return [];
|
|
119
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Alert","FileSystem","ImagePicker","PermissionStatus","showToast","ImageManipulator","Logger","LOG_TYPE","getBaseETResponse","getEventCodeByET","EntityCode","ExecutionTaskID","BaseError","BaseErrorCodes","DispatchSdkCache","insertDocumentInDB","deleteImage","imageData","images","deleteAsync","path","filtered","filter","img","id","getMaxImagesCount","props","captureCountLimit","getImagesFileName","Date","now","toString","getCompressionRatio","uri","maxSize","fileInfo","getInfoAsync","size","Math","min","exists","fileSize","error","getInstance","logEvent","message","SDK_ERROR","checkCameraPermissionUtil","response","getCameraPermissionsAsync","granted","resp","requestCameraPermissionsAsync","status","GRANTED","captureImage","imageWidth","imageHeight","alert","launchCameraAsync","quality","cancelled","actionResize","resize","width","height","compressionRatio","resizedImage","manipulateAsync","compress","then","SDK_DEBUG","catch","exception","getCaptureOutput","imageDataList","captureProps","length","IMAGE_CAPTURE","captures","getImagesData","imagesDataList","output","folderName","getKeyFromCache","KEYS","FMS_FOLDER","data","insertID","JSON","stringify","jobIds","objRefs","title","push","url","timestamp","file","folder","name","SQLiteDBIssue"],"sources":["CaptureUtils.ts"],"sourcesContent":["import type {\n CapturedImage,\n CaptureInput,\n CaptureOutput,\n ImageData,\n} from './CaptureSchema';\nimport { Alert } from 'react-native';\nimport * as FileSystem from 'expo-file-system';\nimport * as ImagePicker from 'expo-image-picker';\nimport { PermissionStatus } from 'expo-image-picker';\nimport { showToast } from '../../widgets/Toaster';\nimport type { ActionResize, ImageResult } from 'expo-image-manipulator';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes from '../../../errors/ErrorCodes';\nimport DispatchSdkCache from '../../../manager/sdk/DispatchSdkCache';\nimport { insertDocumentInDB } from '../../../utils/SyncManagerUtils';\n\nexport async function deleteImage(\n imageData: ImageData,\n images: ImageData[]\n): Promise<ImageData[]> {\n await FileSystem.deleteAsync(imageData.path);\n let filtered = images.filter((img) => {\n return img.id !== imageData.id;\n });\n return filtered;\n}\n\nexport function getMaxImagesCount(props: CaptureInput) {\n if (props && props.captureCountLimit) return props.captureCountLimit;\n else return 1;\n}\n\nexport function getImagesFileName() {\n return `IMG_${Date.now().toString()}.jpg`;\n}\n\nexport async function getCompressionRatio(\n uri: string,\n maxSize: number\n): Promise<number> {\n try {\n let fileInfo = await FileSystem.getInfoAsync(uri, {\n size: true,\n });\n maxSize = Math.min(maxSize, 1024);\n if (fileInfo.exists) {\n let fileSize = fileInfo.size / 1024;\n if (fileSize > maxSize) {\n return maxSize / fileSize;\n } else return 1;\n }\n return 1;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'getCompressionRatio',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return 1;\n }\n}\n\nexport async function checkCameraPermissionUtil(): Promise<boolean> {\n let response = await ImagePicker.getCameraPermissionsAsync();\n if (response.granted) return true;\n else {\n let resp = await ImagePicker.requestCameraPermissionsAsync();\n return resp.status === PermissionStatus.GRANTED;\n }\n}\n\nexport async function captureImage(\n imageWidth: number,\n imageHeight: number,\n fileSize: number\n): Promise<ImageResult | null> {\n try {\n if (!(await checkCameraPermissionUtil())) {\n Alert.alert('Permissions Error', 'Camera permissions not provided!');\n return null;\n }\n let response = await ImagePicker.launchCameraAsync({\n quality: 1,\n });\n if (!response.cancelled) {\n let actionResize: ActionResize = {\n resize: {\n width: imageWidth,\n height: imageHeight,\n },\n };\n let compressionRatio = await getCompressionRatio(response.uri, fileSize);\n let resizedImage = await ImageManipulator.manipulateAsync(\n response.uri,\n [actionResize],\n {\n compress: compressionRatio,\n }\n );\n FileSystem.deleteAsync(response.uri)\n .then(() =>\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n 'File deleted success',\n LOG_TYPE.SDK_DEBUG\n )\n )\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n return resizedImage;\n } else {\n showToast('User cancelled the action');\n return null;\n }\n } catch (exception: any) {\n showToast(`Error ${exception.message}`);\n return null;\n }\n}\n\nexport async function getCaptureOutput(\n imageDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CaptureOutput> {\n if (!imageDataList || imageDataList.length === 0)\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, false),\n ''\n )),\n };\n else {\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n true,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, true),\n ''\n )),\n captures: await getImagesData(imageDataList, captureProps),\n };\n }\n}\n\nasync function getImagesData(\n imagesDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CapturedImage[]> {\n if (imagesDataList && imagesDataList.length > 0) {\n let output: CapturedImage[] = [];\n const folderName =\n (await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.FMS_FOLDER\n )) ?? 'NULL';\n for (const data of imagesDataList) {\n let insertID = await insertDocumentInDB(\n data.id,\n folderName,\n JSON.stringify(captureProps.jobIds),\n JSON.stringify(captureProps.objRefs),\n null,\n captureProps.title,\n data.path\n );\n if (insertID)\n output.push({\n url: '',\n timestamp: data.timestamp,\n file: { folder: folderName, name: data.id },\n });\n else\n throw new BaseError(\n BaseErrorCodes.SQLiteDBIssue,\n 'Unable to save Image'\n );\n }\n return output;\n } else return [];\n}\n"],"mappings":"AAMA,SAASA,KAAT,QAAsB,cAAtB;AACA,OAAO,KAAKC,UAAZ,MAA4B,kBAA5B;AACA,OAAO,KAAKC,WAAZ,MAA6B,mBAA7B;AACA,SAASC,gBAAT,QAAiC,mBAAjC;AACA,SAASC,SAAT,QAA0B,uBAA1B;AAEA,OAAO,KAAKC,gBAAZ,MAAkC,wBAAlC;AACA,OAAOC,MAAP,IAAiBC,QAAjB,QAAiC,uBAAjC;AACA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SAASC,gBAAT,QAAiC,mDAAjC;AACA,SACEC,UADF,EAEEC,eAFF,QAGO,oCAHP;AAIA,SAASC,SAAT,QAA0B,2BAA1B;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,gBAAP,MAA6B,uCAA7B;AACA,SAASC,kBAAT,QAAmC,iCAAnC;AAEA,OAAO,eAAeC,WAAf,CACLC,SADK,EAELC,MAFK,EAGiB;EACtB,MAAMjB,UAAU,CAACkB,WAAX,CAAuBF,SAAS,CAACG,IAAjC,CAAN;EACA,IAAIC,QAAQ,GAAGH,MAAM,CAACI,MAAP,CAAeC,GAAD,IAAS;IACpC,OAAOA,GAAG,CAACC,EAAJ,KAAWP,SAAS,CAACO,EAA5B;EACD,C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vC;MASA,IAAIoE,QAAJ,EACEN,MAAM,CAACY,IAAP,CAAY;QACVC,GAAG,EAAE,EADK;QAEVC,SAAS,EAAET,IAAI,CAACS,SAFN;QAGVC,IAAI,EAAE;UAAEC,MAAM,EAAEf,UAAV;UAAsBgB,IAAI,EAAEZ,IAAI,CAAC/D;QAAjC;MAHI,CAAZ,EADF,KAOE,MAAM,IAAIZ,SAAJ,CACJC,cAAc,CAACuF,aADX,EAEJ,sBAFI,CAAN;IAIH;;IACD,OAAOlB,MAAP;EACD,CA7BD,MA6BO,OAAO,EAAP;AACR"}
|
|
1
|
+
{"version":3,"names":["Alert","FileSystem","ImagePicker","PermissionStatus","showToast","ImageManipulator","Logger","LOG_TYPE","getBaseETResponse","getEventCodeByET","EntityCode","ExecutionTaskID","BaseError","BaseErrorCodes","DispatchSdkCache","insertDocumentInDB","deleteImage","imageData","images","deleteAsync","path","filtered","filter","img","id","getMaxImagesCount","props","captureCountLimit","getImagesFileName","Date","now","toString","getCompressionRatio","uri","maxSize","fileInfo","getInfoAsync","size","Math","min","exists","fileSize","error","getInstance","logEvent","message","SDK_ERROR","checkCameraPermissionUtil","response","getCameraPermissionsAsync","granted","resp","requestCameraPermissionsAsync","status","GRANTED","captureImage","imageWidth","imageHeight","alert","launchCameraAsync","quality","cancelled","actionResize","resize","width","height","compressionRatio","resizedImage","manipulateAsync","compress","then","SDK_DEBUG","catch","exception","console","getCaptureOutput","imageDataList","captureProps","_captureProps$applica","length","IMAGE_CAPTURE","applicableReasons","failure","_captureProps$applica2","success","captures","getImagesData","imagesDataList","output","folderName","getKeyFromCache","KEYS","FMS_FOLDER","data","insertID","JSON","stringify","jobIds","objRefs","title","push","url","timestamp","file","folder","name","SQLiteDBIssue"],"sources":["CaptureUtils.ts"],"sourcesContent":["import type {\n CapturedImage,\n CaptureInput,\n CaptureOutput,\n ImageData,\n} from './CaptureSchema';\nimport { Alert } from 'react-native';\nimport * as FileSystem from 'expo-file-system';\nimport * as ImagePicker from 'expo-image-picker';\nimport { PermissionStatus } from 'expo-image-picker';\nimport { showToast } from '../../widgets/Toaster';\nimport type { ActionResize, ImageResult } from 'expo-image-manipulator';\nimport * as ImageManipulator from 'expo-image-manipulator';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { BaseError } from '../../../errors/BaseError';\nimport BaseErrorCodes from '../../../errors/ErrorCodes';\nimport DispatchSdkCache from '../../../manager/sdk/DispatchSdkCache';\nimport { insertDocumentInDB } from '../../../utils/SyncManagerUtils';\n\nexport async function deleteImage(\n imageData: ImageData,\n images: ImageData[]\n): Promise<ImageData[]> {\n await FileSystem.deleteAsync(imageData.path);\n let filtered = images.filter((img) => {\n return img.id !== imageData.id;\n });\n return filtered;\n}\n\nexport function getMaxImagesCount(props: CaptureInput) {\n if (props && props.captureCountLimit) return props.captureCountLimit;\n else return 1;\n}\n\nexport function getImagesFileName() {\n return `IMG_${Date.now().toString()}.jpg`;\n}\n\nexport async function getCompressionRatio(\n uri: string,\n maxSize: number\n): Promise<number> {\n try {\n let fileInfo = await FileSystem.getInfoAsync(uri, {\n size: true,\n });\n maxSize = Math.min(maxSize, 1024);\n if (fileInfo.exists) {\n let fileSize = fileInfo.size / 1024;\n if (fileSize > maxSize) {\n return maxSize / fileSize;\n } else return 1;\n }\n return 1;\n } catch (error: any) {\n Logger.getInstance().logEvent(\n 'getCompressionRatio',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n return 1;\n }\n}\n\nexport async function checkCameraPermissionUtil(): Promise<boolean> {\n let response = await ImagePicker.getCameraPermissionsAsync();\n if (response.granted) return true;\n else {\n let resp = await ImagePicker.requestCameraPermissionsAsync();\n return resp.status === PermissionStatus.GRANTED;\n }\n}\n\nexport async function captureImage(\n imageWidth: number,\n imageHeight: number,\n fileSize: number\n): Promise<ImageResult | null> {\n try {\n if (!(await checkCameraPermissionUtil())) {\n Alert.alert('Permissions Error', 'Camera permissions not provided!');\n return null;\n }\n let response = await ImagePicker.launchCameraAsync({\n quality: 1,\n });\n if (!response.cancelled) {\n let actionResize: ActionResize = {\n resize: {\n width: imageWidth,\n height: imageHeight,\n },\n };\n let compressionRatio = await getCompressionRatio(response.uri, fileSize);\n let resizedImage = await ImageManipulator.manipulateAsync(\n response.uri,\n [actionResize],\n {\n compress: compressionRatio,\n }\n );\n FileSystem.deleteAsync(response.uri)\n .then(() =>\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n 'File deleted success',\n LOG_TYPE.SDK_DEBUG\n )\n )\n .catch((error) => {\n Logger.getInstance().logEvent(\n 'CAPTURE_ET',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n });\n return resizedImage;\n } else {\n showToast('User cancelled the action');\n return null;\n }\n } catch (exception: any) {\n showToast(`Error ${exception.message}`);\n console.error('capture image error: ', exception);\n\n return null;\n }\n}\n\nexport async function getCaptureOutput(\n imageDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CaptureOutput> {\n if (!imageDataList || imageDataList.length === 0)\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n false,\n captureProps.applicableReasons?.failure\n ),\n ''\n )),\n };\n else {\n return {\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n true,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n true,\n captureProps.applicableReasons?.success\n ),\n ''\n )),\n captures: await getImagesData(imageDataList, captureProps),\n };\n }\n}\n\nasync function getImagesData(\n imagesDataList: ImageData[],\n captureProps: CaptureInput\n): Promise<CapturedImage[]> {\n if (imagesDataList && imagesDataList.length > 0) {\n let output: CapturedImage[] = [];\n const folderName =\n (await DispatchSdkCache.getInstance().getKeyFromCache(\n DispatchSdkCache.KEYS.FMS_FOLDER\n )) ?? 'NULL';\n for (const data of imagesDataList) {\n let insertID = await insertDocumentInDB(\n data.id,\n folderName,\n JSON.stringify(captureProps.jobIds),\n JSON.stringify(captureProps.objRefs),\n null,\n captureProps.title,\n data.path\n );\n if (insertID)\n output.push({\n url: '',\n timestamp: data.timestamp,\n file: { folder: folderName, name: data.id },\n });\n else\n throw new BaseError(\n BaseErrorCodes.SQLiteDBIssue,\n 'Unable to save Image'\n );\n }\n return output;\n } else return [];\n}\n"],"mappings":"AAMA,SAASA,KAAK,QAAQ,cAAc;AACpC,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,OAAO,KAAKC,WAAW,MAAM,mBAAmB;AAChD,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,SAAS,QAAQ,uBAAuB;AAEjD,OAAO,KAAKC,gBAAgB,MAAM,wBAAwB;AAC1D,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AACxD,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,gBAAgB,QAAQ,mDAAmD;AACpF,SACEC,UAAU,EACVC,eAAe,QACV,oCAAoC;AAC3C,SAASC,SAAS,QAAQ,2BAA2B;AACrD,OAAOC,cAAc,MAAM,4BAA4B;AACvD,OAAOC,gBAAgB,MAAM,uCAAuC;AACpE,SAASC,kBAAkB,QAAQ,iCAAiC;AAEpE,OAAO,eAAeC,WAAWA,CAC/BC,SAAoB,EACpBC,MAAmB,EACG;EACtB,MAAMjB,UAAU,CAACkB,WAAW,CAACF,SAAS,CAACG,IAAI,CAAC;EAC5C,IAAIC,QAAQ,GAAGH,MAAM,CAACI,MAAM,CAAEC,GAAG,IAAK;IACpC,OAAOA,GAAG,CAACC,EAAE,KAAKP,SAAS,CAACO,EAAE;EAChC,CAAC,CAAC;EACF,OAAOH,QAAQ;AACjB;AAEA,OAAO,SAASI,iBAAiBA,CAACC,KAAmB,EAAE;EACrD,IAAIA,KAAK,IAAIA,KAAK,CAACC,iBAAi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CAACC,SAAS,CAACnB,YAAY,CAACoB,MAAM,CAAC,EACnCF,IAAI,CAACC,SAAS,CAACnB,YAAY,CAACqB,OAAO,CAAC,EACpC,IAAI,EACJrB,YAAY,CAACsB,KAAK,EAClBN,IAAI,CAACzE,IAAI,CACV;MACD,IAAI0E,QAAQ,EACVN,MAAM,CAACY,IAAI,CAAC;QACVC,GAAG,EAAE,EAAE;QACPC,SAAS,EAAET,IAAI,CAACS,SAAS;QACzBC,IAAI,EAAE;UAAEC,MAAM,EAAEf,UAAU;UAAEgB,IAAI,EAAEZ,IAAI,CAACrE;QAAG;MAC5C,CAAC,CAAC,CAAC,KAEH,MAAM,IAAIZ,SAAS,CACjBC,cAAc,CAAC6F,aAAa,EAC5B,sBAAsB,CACvB;IACL;IACA,OAAOlB,MAAM;EACf,CAAC,MAAM,OAAO,EAAE;AAClB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useState, useLayoutEffect } from 'react';
|
|
2
2
|
import { FlatList, Image, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import * as CaptureUtils from './CaptureUtils';
|
|
4
4
|
import { getCaptureOutput } from './CaptureUtils';
|
|
5
|
-
import { Button } from 'react-native-paper';
|
|
6
5
|
import { showToast } from '../../widgets/Toaster';
|
|
7
6
|
import SdkColors, { ColorTheme } from '../../../styles/SdkColors';
|
|
8
7
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
@@ -10,7 +9,9 @@ import { CommonStyles, Fonts } from '../../../styles/executionTasks/CommonStyles
|
|
|
10
9
|
import { getBaseETResponse } from '../../../utils/ExecTaskUtils';
|
|
11
10
|
import { EntityCode, ExecutionTaskID } from '../../../models/execTasks/ETConfig';
|
|
12
11
|
import { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';
|
|
13
|
-
|
|
12
|
+
import { GO_BACK_EVENT_CODE } from '../../../constants/constants';
|
|
13
|
+
import { Button, Modal, Portal, Provider } from 'react-native-paper';
|
|
14
|
+
import Logger, { LOG_TYPE } from '../../../utils/Logger';
|
|
14
15
|
const ImageItem = _ref => {
|
|
15
16
|
let {
|
|
16
17
|
item,
|
|
@@ -37,36 +38,79 @@ const ImageItem = _ref => {
|
|
|
37
38
|
}
|
|
38
39
|
}));
|
|
39
40
|
};
|
|
40
|
-
|
|
41
41
|
const ImageCapture = props => {
|
|
42
42
|
const [images, setImages] = useState([]);
|
|
43
43
|
const [showCapture, setShowCapture] = useState(true);
|
|
44
44
|
const [disableProceed, setDisableProceed] = useState(false);
|
|
45
|
-
|
|
45
|
+
const [showBackModal, setShowBackModal] = useState(false);
|
|
46
|
+
useLayoutEffect(() => {
|
|
47
|
+
props.navigation.setOptions({
|
|
48
|
+
title: props.title,
|
|
49
|
+
headerLeft: () => {
|
|
50
|
+
var _props$taskMeta;
|
|
51
|
+
return (_props$taskMeta = props.taskMeta) !== null && _props$taskMeta !== void 0 && _props$taskMeta.enableGoBack ? /*#__PURE__*/React.createElement(Icon, {
|
|
52
|
+
onPress: async () => {
|
|
53
|
+
setShowBackModal(true);
|
|
54
|
+
},
|
|
55
|
+
name: "arrow-back",
|
|
56
|
+
color: 'black',
|
|
57
|
+
size: 25,
|
|
58
|
+
style: {
|
|
59
|
+
paddingRight: 15,
|
|
60
|
+
paddingTop: 5
|
|
61
|
+
}
|
|
62
|
+
}) : null;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}, [props.navigation, props.title]);
|
|
66
|
+
const renderModal = () => {
|
|
67
|
+
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Modal, {
|
|
68
|
+
visible: showBackModal,
|
|
69
|
+
dismissable: true,
|
|
70
|
+
contentContainerStyle: CommonStyles.modalContent
|
|
71
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
72
|
+
style: CommonStyles.modalView
|
|
73
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
74
|
+
style: CommonStyles.subText
|
|
75
|
+
}, 'Are you sure you want to go back?'), /*#__PURE__*/React.createElement(Button, {
|
|
76
|
+
labelStyle: CommonStyles.nextButtonLabel,
|
|
77
|
+
style: {
|
|
78
|
+
...CommonStyles.nextButton,
|
|
79
|
+
marginTop: 10
|
|
80
|
+
},
|
|
81
|
+
uppercase: false,
|
|
82
|
+
onPress: async () => {
|
|
83
|
+
props.onSubmitET({
|
|
84
|
+
...(await getBaseETResponse(EntityCode.IMAGE_CAPTURE, false, GO_BACK_EVENT_CODE, ''))
|
|
85
|
+
});
|
|
86
|
+
setShowBackModal(false);
|
|
87
|
+
}
|
|
88
|
+
}, "Yes"), /*#__PURE__*/React.createElement(Button, {
|
|
89
|
+
labelStyle: CommonStyles.cancelButtonLabel,
|
|
90
|
+
style: {
|
|
91
|
+
...CommonStyles.cancelButton,
|
|
92
|
+
marginTop: 10
|
|
93
|
+
},
|
|
94
|
+
uppercase: false,
|
|
95
|
+
onPress: () => setShowBackModal(false)
|
|
96
|
+
}, "No"))));
|
|
97
|
+
};
|
|
46
98
|
const handleSubmit = async () => {
|
|
47
99
|
try {
|
|
48
100
|
setDisableProceed(true);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (images.length
|
|
52
|
-
props.
|
|
53
|
-
|
|
54
|
-
showToast('No Images captured');
|
|
101
|
+
if (images.length > 0) {
|
|
102
|
+
var _props$additionalMult;
|
|
103
|
+
if (((_props$additionalMult = props.additionalMultiConfig) === null || _props$additionalMult === void 0 ? void 0 : _props$additionalMult.minCaptureCount) === 'N' && images.length < props.jobIds.length) {
|
|
104
|
+
showToast(`Min ${props.jobIds.length} image(s) required to be captured.`);
|
|
105
|
+
return;
|
|
55
106
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
props.onSubmitET(await getCaptureOutput(images, props));
|
|
60
|
-
} else {
|
|
61
|
-
showToast(`${props.captureCountLimit - images.length} Images left`);
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
if (images.length > 0) {
|
|
65
|
-
props.onSubmitET(await getCaptureOutput(images, props));
|
|
66
|
-
} else {
|
|
67
|
-
showToast('No Images captured');
|
|
68
|
-
}
|
|
107
|
+
if (props.captureMode === 'MULTI' && props.captureCountLimit && props.captureCountLimit > 0 && images.length > CaptureUtils.getMaxImagesCount(props)) {
|
|
108
|
+
showToast(`Max ${props.captureCountLimit} image(s) allowed.`);
|
|
109
|
+
return;
|
|
69
110
|
}
|
|
111
|
+
props.onSubmitET(await getCaptureOutput(images, props));
|
|
112
|
+
} else {
|
|
113
|
+
showToast('No Images captured');
|
|
70
114
|
}
|
|
71
115
|
} catch (error) {
|
|
72
116
|
setDisableProceed(false);
|
|
@@ -75,7 +119,6 @@ const ImageCapture = props => {
|
|
|
75
119
|
setDisableProceed(false);
|
|
76
120
|
}
|
|
77
121
|
};
|
|
78
|
-
|
|
79
122
|
useEffect(() => {
|
|
80
123
|
if (props.captureMode === 'SINGLE') {
|
|
81
124
|
if (images.length > 0) {
|
|
@@ -96,9 +139,7 @@ const ImageCapture = props => {
|
|
|
96
139
|
showToast(`Max Image Limit reached`);
|
|
97
140
|
return;
|
|
98
141
|
}
|
|
99
|
-
|
|
100
142
|
let imageDataResponse = await CaptureUtils.captureImage(props.resolution.breadth, props.resolution.length, props.fileSizeLimit);
|
|
101
|
-
|
|
102
143
|
if (imageDataResponse != null) {
|
|
103
144
|
setImages(prevState => {
|
|
104
145
|
return [...prevState, {
|
|
@@ -111,16 +152,15 @@ const ImageCapture = props => {
|
|
|
111
152
|
});
|
|
112
153
|
}
|
|
113
154
|
}, [props, showCapture]);
|
|
114
|
-
|
|
115
155
|
const deleteImage = async imageData => {
|
|
116
156
|
try {
|
|
117
157
|
let filteredImages = await CaptureUtils.deleteImage(imageData, images);
|
|
118
158
|
setImages(filteredImages);
|
|
119
159
|
} catch (err) {
|
|
120
|
-
|
|
160
|
+
Logger.getInstance().logEvent('deleteImageError', err.message, LOG_TYPE.SDK_ERROR);
|
|
161
|
+
return;
|
|
121
162
|
}
|
|
122
163
|
};
|
|
123
|
-
|
|
124
164
|
const renderItem = _ref2 => {
|
|
125
165
|
let {
|
|
126
166
|
item
|
|
@@ -132,8 +172,7 @@ const ImageCapture = props => {
|
|
|
132
172
|
}
|
|
133
173
|
});
|
|
134
174
|
};
|
|
135
|
-
|
|
136
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
175
|
+
return /*#__PURE__*/React.createElement(Provider, null, renderModal(), /*#__PURE__*/React.createElement(View, {
|
|
137
176
|
style: CommonStyles.mainContainer
|
|
138
177
|
}, props.message && /*#__PURE__*/React.createElement(View, {
|
|
139
178
|
style: styles.etMessageView
|
|
@@ -183,12 +222,13 @@ const ImageCapture = props => {
|
|
|
183
222
|
mode: "outlined",
|
|
184
223
|
labelStyle: CommonStyles.cancelButtonLabel,
|
|
185
224
|
onPress: async () => {
|
|
186
|
-
|
|
225
|
+
var _props$applicableReas;
|
|
226
|
+
props.onSubmitET({
|
|
227
|
+
...(await getBaseETResponse(EntityCode.IMAGE_CAPTURE, false, getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, false, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.failure), ''))
|
|
187
228
|
});
|
|
188
229
|
}
|
|
189
|
-
}, "Cancel")));
|
|
230
|
+
}, "Cancel"))));
|
|
190
231
|
};
|
|
191
|
-
|
|
192
232
|
const styles = StyleSheet.create({
|
|
193
233
|
imageEtContainer: {
|
|
194
234
|
display: 'flex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useState","FlatList","Image","StyleSheet","Text","View","CaptureUtils","getCaptureOutput","Button","showToast","SdkColors","ColorTheme","Icon","CommonStyles","Fonts","getBaseETResponse","EntityCode","ExecutionTaskID","getEventCodeByET","ImageItem","item","onPress","marginEnd","uri","path","styles","image","position","right","top","ImageCapture","props","images","setImages","showCapture","setShowCapture","disableProceed","setDisableProceed","handleSubmit","captureMode","length","onSubmitET","captureCountLimit","getMaxImagesCount","error","message","captureImage","imageDataResponse","resolution","breadth","fileSizeLimit","prevState","id","getImagesFileName","url","timestamp","Date","now","deleteImage","imageData","filteredImages","err","console","log","renderItem","mainContainer","etMessageView","etMessage","imageEtContainer","fontFamily","IBMPlexSans_400Regular","fontStyle","fontWeight","fontSize","alignItems","textAlign","letterSpacing","color","LIGHT","primaryButton","bottom","marginStart","nextButton","nextButtonLabel","cancelButton","marginTop","cancelButtonLabel","IMAGE_CAPTURE","create","display","borderWidth","borderColor","padding","borderStyle","backgroundColor","justifyContent","height","width","IBMPlexSans_600SemiBold","paddingStart","paddingEnd","paddingTop","paddingBottom"],"sources":["ImageCapture.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { FlatList, Image, StyleSheet, Text, View } from 'react-native';\nimport type { CaptureInput, ImageData } from './CaptureSchema';\nimport * as CaptureUtils from './CaptureUtils';\nimport { getCaptureOutput } from './CaptureUtils';\nimport { Button } from 'react-native-paper';\nimport { showToast } from '../../widgets/Toaster';\nimport SdkColors, { ColorTheme } from '../../../styles/SdkColors';\nimport Icon from 'react-native-vector-icons/MaterialIcons';\nimport {\n CommonStyles,\n Fonts,\n} from '../../../styles/executionTasks/CommonStyles';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\n\nconst ImageItem = ({ item, onPress }: { item: ImageData; onPress: any }) => (\n <View style={{ marginEnd: 8 }}>\n <Image source={{ uri: item.path }} style={styles.image} />\n <Icon\n onPress={onPress}\n name=\"highlight-remove\"\n color={'red'}\n size={32}\n style={{\n position: 'absolute',\n right: 5,\n top: 5,\n }}\n />\n </View>\n);\n\nconst ImageCapture = (props: CaptureInput) => {\n const [images, setImages] = useState<Array<ImageData>>([]);\n const [showCapture, setShowCapture] = useState(true);\n const [disableProceed, setDisableProceed] = useState(false);\n\n const handleSubmit = async () => {\n try {\n setDisableProceed(true);\n if (props.captureMode === 'SINGLE') {\n if (images.length > 0) {\n props.onSubmitET(await getCaptureOutput(images, props));\n } else {\n showToast('No Images captured');\n }\n } else {\n if (props.captureCountLimit && props.captureCountLimit > 0) {\n if (images.length === CaptureUtils.getMaxImagesCount(props)) {\n props.onSubmitET(await getCaptureOutput(images, props));\n } else {\n showToast(`${props.captureCountLimit - images.length} Images left`);\n }\n } else {\n if (images.length > 0) {\n props.onSubmitET(await getCaptureOutput(images, props));\n } else {\n showToast('No Images captured');\n }\n }\n }\n } catch (error: any) {\n setDisableProceed(false);\n showToast(error.message);\n } finally {\n setDisableProceed(false);\n }\n };\n\n useEffect(() => {\n if (props.captureMode === 'SINGLE') {\n if (images.length > 0) {\n setShowCapture(false);\n } else setShowCapture(true);\n } else if (\n props.captureMode === 'MULTI' &&\n props.captureCountLimit &&\n props.captureCountLimit > 0\n ) {\n if (images.length === CaptureUtils.getMaxImagesCount(props)) {\n setShowCapture(false);\n } else setShowCapture(true);\n } else {\n if (images.length > 0) {\n setShowCapture(true);\n }\n }\n }, [images, props, showCapture]);\n\n const captureImage = useCallback(async () => {\n if (!showCapture) {\n showToast(`Max Image Limit reached`);\n return;\n }\n let imageDataResponse = await CaptureUtils.captureImage(\n props.resolution.breadth,\n props.resolution.length,\n props.fileSizeLimit\n );\n if (imageDataResponse != null) {\n setImages((prevState) => {\n return [\n ...prevState,\n {\n id: CaptureUtils.getImagesFileName(), // @ts-ignore\n path: imageDataResponse.uri,\n url: '',\n timestamp: Date.now(),\n },\n ];\n });\n }\n }, [props, showCapture]);\n\n const deleteImage = async (imageData: ImageData) => {\n try {\n let filteredImages = await CaptureUtils.deleteImage(imageData, images);\n setImages(filteredImages);\n } catch (err) {\n console.log(err);\n }\n };\n\n const renderItem = ({ item }: { item: ImageData }) => {\n return (\n <ImageItem\n item={item}\n onPress={async () => {\n await deleteImage(item);\n }}\n />\n );\n };\n return (\n <View style={CommonStyles.mainContainer}>\n {props.message && (\n <View style={styles.etMessageView}>\n <Text style={styles.etMessage}>{props.message}</Text>\n </View>\n )}\n <View style={styles.imageEtContainer}>\n {images.length === 0 && (\n <Icon name={'photo-camera'} size={24} color={'#666666'} />\n )}\n {images.length > 0 && (\n <FlatList\n horizontal\n data={images}\n renderItem={renderItem}\n keyExtractor={(item) => item.id}\n />\n )}\n <Button\n onPress={() => captureImage()}\n uppercase={false}\n labelStyle={[\n {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n alignItems: 'center',\n textAlign: 'center',\n letterSpacing: 0.25,\n color: SdkColors[ColorTheme.LIGHT].primaryButton,\n },\n ]}\n >\n {images.length > 0 ? 'Click more' : 'Click Picture'}\n </Button>\n </View>\n <View style={[CommonStyles.bottom, { marginStart: 10, marginEnd: 10 }]}>\n <Button\n disabled={disableProceed}\n style={CommonStyles.nextButton}\n mode=\"contained\"\n labelStyle={CommonStyles.nextButtonLabel}\n onPress={async () => {\n await handleSubmit();\n }}\n >\n Proceed\n </Button>\n <Button\n style={[CommonStyles.cancelButton, { marginTop: 10 }]}\n mode=\"outlined\"\n labelStyle={CommonStyles.cancelButtonLabel}\n onPress={async () => {\n props.onSubmitET({\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(ExecutionTaskID.IMAGE_CAPTURE, false),\n ''\n )),\n });\n }}\n >\n Cancel\n </Button>\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n imageEtContainer: {\n display: 'flex',\n marginStart: 16,\n marginEnd: 16,\n borderWidth: 1,\n borderColor: 'rgba(0, 0, 0, 0.1)',\n padding: 10,\n marginTop: 15,\n borderStyle: 'dashed',\n backgroundColor: '#FFFFFF',\n alignItems: 'center',\n justifyContent: 'center',\n height: 300,\n },\n image: {\n height: 250,\n width: 200,\n },\n etMessage: {\n textAlign: 'center',\n fontStyle: 'normal',\n fontWeight: '600',\n fontSize: 18,\n display: 'flex',\n alignItems: 'center',\n letterSpacing: 0.25,\n color: '#000000',\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n },\n etMessageView: {\n marginTop: 14,\n paddingStart: 40,\n paddingEnd: 40,\n paddingTop: 15,\n paddingBottom: 15,\n backgroundColor: '#ffffff',\n },\n});\n\nexport default ImageCapture;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,SAA7B,EAAwCC,QAAxC,QAAwD,OAAxD;AACA,SAASC,QAAT,EAAmBC,KAAnB,EAA0BC,UAA1B,EAAsCC,IAAtC,EAA4CC,IAA5C,QAAwD,cAAxD;AAEA,OAAO,KAAKC,YAAZ,MAA8B,gBAA9B;AACA,SAASC,gBAAT,QAAiC,gBAAjC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,OAAOC,SAAP,IAAoBC,UAApB,QAAsC,2BAAtC;AACA,OAAOC,IAAP,MAAiB,yCAAjB;AACA,SACEC,YADF,EAEEC,KAFF,QAGO,6CAHP;AAIA,SAASC,iBAAT,QAAkC,8BAAlC;AACA,SACEC,UADF,EAEEC,eAFF,QAGO,oCAHP;AAIA,SAASC,gBAAT,QAAiC,mDAAjC;;AAEA,MAAMC,SAAS,GAAG;EAAA,IAAC;IAAEC,IAAF;IAAQC;EAAR,CAAD;EAAA,oBAChB,oBAAC,IAAD;IAAM,KAAK,EAAE;MAAEC,SAAS,EAAE;IAAb;EAAb,gBACE,oBAAC,KAAD;IAAO,MAAM,EAAE;MAAEC,GAAG,EAAEH,IAAI,CAACI;IAAZ,CAAf;IAAmC,KAAK,EAAEC,MAAM,CAACC;EAAjD,EADF,eAEE,oBAAC,IAAD;IACE,OAAO,EAAEL,OADX;IAEE,IAAI,EAAC,kBAFP;IAGE,KAAK,EAAE,KAHT;IAIE,IAAI,EAAE,EAJR;IAKE,KAAK,EAAE;MACLM,QAAQ,EAAE,UADL;M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Af;AAwCA,eAAehE,YAAf"}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useState","useLayoutEffect","FlatList","Image","StyleSheet","Text","View","CaptureUtils","getCaptureOutput","showToast","SdkColors","ColorTheme","Icon","CommonStyles","Fonts","getBaseETResponse","EntityCode","ExecutionTaskID","getEventCodeByET","GO_BACK_EVENT_CODE","Button","Modal","Portal","Provider","Logger","LOG_TYPE","ImageItem","_ref","item","onPress","createElement","style","marginEnd","source","uri","path","styles","image","name","color","size","position","right","top","ImageCapture","props","images","setImages","showCapture","setShowCapture","disableProceed","setDisableProceed","showBackModal","setShowBackModal","navigation","setOptions","title","headerLeft","_props$taskMeta","taskMeta","enableGoBack","paddingRight","paddingTop","renderModal","visible","dismissable","contentContainerStyle","modalContent","modalView","subText","labelStyle","nextButtonLabel","nextButton","marginTop","uppercase","onSubmitET","IMAGE_CAPTURE","cancelButtonLabel","cancelButton","handleSubmit","length","_props$additionalMult","additionalMultiConfig","minCaptureCount","jobIds","captureMode","captureCountLimit","getMaxImagesCount","error","message","captureImage","imageDataResponse","resolution","breadth","fileSizeLimit","prevState","id","getImagesFileName","url","timestamp","Date","now","deleteImage","imageData","filteredImages","err","getInstance","logEvent","SDK_ERROR","renderItem","_ref2","mainContainer","etMessageView","etMessage","imageEtContainer","horizontal","data","keyExtractor","fontFamily","IBMPlexSans_400Regular","fontStyle","fontWeight","fontSize","alignItems","textAlign","letterSpacing","LIGHT","primaryButton","bottom","marginStart","disabled","mode","_props$applicableReas","applicableReasons","failure","create","display","borderWidth","borderColor","padding","borderStyle","backgroundColor","justifyContent","height","width","IBMPlexSans_600SemiBold","paddingStart","paddingEnd","paddingBottom"],"sources":["ImageCapture.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useState,\n useLayoutEffect,\n} from 'react';\nimport { FlatList, Image, StyleSheet, Text, View } from 'react-native';\nimport type { CaptureInput, ImageData } from './CaptureSchema';\nimport * as CaptureUtils from './CaptureUtils';\nimport { getCaptureOutput } from './CaptureUtils';\nimport { showToast } from '../../widgets/Toaster';\nimport SdkColors, { ColorTheme } from '../../../styles/SdkColors';\nimport Icon from 'react-native-vector-icons/MaterialIcons';\nimport {\n CommonStyles,\n Fonts,\n} from '../../../styles/executionTasks/CommonStyles';\nimport { getBaseETResponse } from '../../../utils/ExecTaskUtils';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../models/execTasks/ETConfig';\nimport { getEventCodeByET } from '../../../manager/dispatchCodes/EventCodeContainer';\nimport { GO_BACK_EVENT_CODE } from '../../../constants/constants';\nimport { Button, Modal, Portal, Provider } from 'react-native-paper';\nimport Logger, { LOG_TYPE } from '../../../utils/Logger';\n\nconst ImageItem = ({ item, onPress }: { item: ImageData; onPress: any }) => (\n <View style={{ marginEnd: 8 }}>\n <Image source={{ uri: item.path }} style={styles.image} />\n <Icon\n onPress={onPress}\n name=\"highlight-remove\"\n color={'red'}\n size={32}\n style={{\n position: 'absolute',\n right: 5,\n top: 5,\n }}\n />\n </View>\n);\n\nconst ImageCapture = (props: CaptureInput) => {\n const [images, setImages] = useState<Array<ImageData>>([]);\n const [showCapture, setShowCapture] = useState(true);\n const [disableProceed, setDisableProceed] = useState(false);\n const [showBackModal, setShowBackModal] = useState(false);\n useLayoutEffect(() => {\n props.navigation.setOptions({\n title: props.title,\n headerLeft: () =>\n props.taskMeta?.enableGoBack ? (\n <Icon\n onPress={async () => {\n setShowBackModal(true);\n }}\n name=\"arrow-back\"\n color={'black'}\n size={25}\n style={{\n paddingRight: 15,\n paddingTop: 5,\n }}\n />\n ) : null,\n });\n }, [props.navigation, props.title]);\n\n const renderModal = () => {\n return (\n <Portal>\n <Modal\n visible={showBackModal}\n dismissable={true}\n contentContainerStyle={CommonStyles.modalContent}\n >\n <View style={CommonStyles.modalView}>\n <Text style={CommonStyles.subText}>\n {'Are you sure you want to go back?'}\n </Text>\n <Button\n labelStyle={CommonStyles.nextButtonLabel}\n style={{ ...CommonStyles.nextButton, marginTop: 10 }}\n uppercase={false}\n onPress={async () => {\n props.onSubmitET({\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n GO_BACK_EVENT_CODE,\n ''\n )),\n });\n setShowBackModal(false);\n }}\n >\n Yes\n </Button>\n <Button\n labelStyle={CommonStyles.cancelButtonLabel}\n style={{ ...CommonStyles.cancelButton, marginTop: 10 }}\n uppercase={false}\n onPress={() => setShowBackModal(false)}\n >\n No\n </Button>\n </View>\n </Modal>\n </Portal>\n );\n };\n\n const handleSubmit = async () => {\n try {\n setDisableProceed(true);\n if (images.length > 0) {\n if (\n props.additionalMultiConfig?.minCaptureCount === 'N' &&\n images.length < props.jobIds.length\n ) {\n showToast(\n `Min ${props.jobIds.length} image(s) required to be captured.`\n );\n return;\n }\n if (\n props.captureMode === 'MULTI' &&\n props.captureCountLimit &&\n props.captureCountLimit > 0 &&\n images.length > CaptureUtils.getMaxImagesCount(props)\n ) {\n showToast(`Max ${props.captureCountLimit} image(s) allowed.`);\n return;\n }\n props.onSubmitET(await getCaptureOutput(images, props));\n } else {\n showToast('No Images captured');\n }\n } catch (error: any) {\n setDisableProceed(false);\n showToast(error.message);\n } finally {\n setDisableProceed(false);\n }\n };\n\n useEffect(() => {\n if (props.captureMode === 'SINGLE') {\n if (images.length > 0) {\n setShowCapture(false);\n } else setShowCapture(true);\n } else if (\n props.captureMode === 'MULTI' &&\n props.captureCountLimit &&\n props.captureCountLimit > 0\n ) {\n if (images.length === CaptureUtils.getMaxImagesCount(props)) {\n setShowCapture(false);\n } else setShowCapture(true);\n } else {\n if (images.length > 0) {\n setShowCapture(true);\n }\n }\n }, [images, props, showCapture]);\n\n const captureImage = useCallback(async () => {\n if (!showCapture) {\n showToast(`Max Image Limit reached`);\n return;\n }\n let imageDataResponse = await CaptureUtils.captureImage(\n props.resolution.breadth,\n props.resolution.length,\n props.fileSizeLimit\n );\n if (imageDataResponse != null) {\n setImages((prevState) => {\n return [\n ...prevState,\n {\n id: CaptureUtils.getImagesFileName(), // @ts-ignore\n path: imageDataResponse.uri,\n url: '',\n timestamp: Date.now(),\n },\n ];\n });\n }\n }, [props, showCapture]);\n\n const deleteImage = async (imageData: ImageData) => {\n try {\n let filteredImages = await CaptureUtils.deleteImage(imageData, images);\n setImages(filteredImages);\n } catch (err: any) {\n Logger.getInstance().logEvent(\n 'deleteImageError',\n err.message,\n LOG_TYPE.SDK_ERROR\n );\n return;\n }\n };\n\n const renderItem = ({ item }: { item: ImageData }) => {\n return (\n <ImageItem\n item={item}\n onPress={async () => {\n await deleteImage(item);\n }}\n />\n );\n };\n return (\n <Provider>\n {renderModal()}\n <View style={CommonStyles.mainContainer}>\n {props.message && (\n <View style={styles.etMessageView}>\n <Text style={styles.etMessage}>{props.message}</Text>\n </View>\n )}\n <View style={styles.imageEtContainer}>\n {images.length === 0 && (\n <Icon name={'photo-camera'} size={24} color={'#666666'} />\n )}\n {images.length > 0 && (\n <FlatList\n horizontal\n data={images}\n renderItem={renderItem}\n keyExtractor={(item) => item.id}\n />\n )}\n <Button\n onPress={() => captureImage()}\n uppercase={false}\n labelStyle={[\n {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n alignItems: 'center',\n textAlign: 'center',\n letterSpacing: 0.25,\n color: SdkColors[ColorTheme.LIGHT].primaryButton,\n },\n ]}\n >\n {images.length > 0 ? 'Click more' : 'Click Picture'}\n </Button>\n </View>\n <View style={[CommonStyles.bottom, { marginStart: 10, marginEnd: 10 }]}>\n <Button\n disabled={disableProceed}\n style={CommonStyles.nextButton}\n mode=\"contained\"\n labelStyle={CommonStyles.nextButtonLabel}\n onPress={async () => {\n await handleSubmit();\n }}\n >\n Proceed\n </Button>\n <Button\n style={[CommonStyles.cancelButton, { marginTop: 10 }]}\n mode=\"outlined\"\n labelStyle={CommonStyles.cancelButtonLabel}\n onPress={async () => {\n props.onSubmitET({\n ...(await getBaseETResponse(\n EntityCode.IMAGE_CAPTURE,\n false,\n getEventCodeByET(\n ExecutionTaskID.IMAGE_CAPTURE,\n false,\n props.applicableReasons?.failure\n ),\n ''\n )),\n });\n }}\n >\n Cancel\n </Button>\n </View>\n </View>\n </Provider>\n );\n};\n\nconst styles = StyleSheet.create({\n imageEtContainer: {\n display: 'flex',\n marginStart: 16,\n marginEnd: 16,\n borderWidth: 1,\n borderColor: 'rgba(0, 0, 0, 0.1)',\n padding: 10,\n marginTop: 15,\n borderStyle: 'dashed',\n backgroundColor: '#FFFFFF',\n alignItems: 'center',\n justifyContent: 'center',\n height: 300,\n },\n image: {\n height: 250,\n width: 200,\n },\n etMessage: {\n textAlign: 'center',\n fontStyle: 'normal',\n fontWeight: '600',\n fontSize: 18,\n display: 'flex',\n alignItems: 'center',\n letterSpacing: 0.25,\n color: '#000000',\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n },\n etMessageView: {\n marginTop: 14,\n paddingStart: 40,\n paddingEnd: 40,\n paddingTop: 15,\n paddingBottom: 15,\n backgroundColor: '#ffffff',\n },\n});\n\nexport default ImageCapture;\n"],"mappings":"AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,eAAe,QACV,OAAO;AACd,SAASC,QAAQ,EAAEC,KAAK,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAEtE,OAAO,KAAKC,YAAY,MAAM,gBAAgB;AAC9C,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,SAAS,QAAQ,uBAAuB;AACjD,OAAOC,SAAS,IAAIC,UAAU,QAAQ,2BAA2B;AACjE,OAAOC,IAAI,MAAM,yCAAyC;AAC1D,SACEC,YAAY,EACZC,KAAK,QACA,6CAA6C;AACpD,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SACEC,UAAU,EACVC,eAAe,QACV,oCAAoC;AAC3C,SAASC,gBAAgB,QAAQ,mDAAmD;AACpF,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,MAAM,EAAEC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IACpBmB,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE;EACV,CAAC;EACD1G,KAAK,EAAE;IACL0G,MAAM,EAAE,GAAG;IACXC,KAAK,EAAE;EACT,CAAC;EACD/B,SAAS,EAAE;IACTW,SAAS,EAAE,QAAQ;IACnBJ,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE,EAAE;IACZc,OAAO,EAAE,MAAM;IACfb,UAAU,EAAE,QAAQ;IACpBE,aAAa,EAAE,IAAI;IACnBtF,KAAK,EAAE,SAAS;IAChB+E,UAAU,EAAExG,KAAK,CAACmI;EACpB,CAAC;EACDjC,aAAa,EAAE;IACbvC,SAAS,EAAE,EAAE;IACbyE,YAAY,EAAE,EAAE;IAChBC,UAAU,EAAE,EAAE;IACdrF,UAAU,EAAE,EAAE;IACdsF,aAAa,EAAE,EAAE;IACjBP,eAAe,EAAE;EACnB;AACF,CAAC,CAAC;AAEF,eAAejG,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","Fonts","PaymentStyles","create","amountStyle","fontSize","fontWeight","fontStyle","backgroundColor","textAlign","alignItems","paddingTop","paddingBottom","fontFamily","IBMPlexSans_600SemiBold","messageStyle","IBMPlexSans_400Regular","color","padding","textStyle1","marginTop","marginStart","marginEnd","reasonTextStyle","flex","flexWrap","lineHeight","letterSpacing","reasonItemStyle","flexDirection","paddingStart","paddingEnd","heading","item","margin","borderWidth","btn","width","borderRadius","paddingHorizontal","paddingVertical","marginVertical","loader","justifyContent"],"sources":["PaymentStyles.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { Fonts } from '../../../styles/executionTasks/CommonStyles';\n\nexport const PaymentStyles = StyleSheet.create({\n amountStyle: {\n fontSize: 18,\n fontWeight: '600',\n fontStyle: 'normal',\n backgroundColor: 'white',\n textAlign: 'center',\n alignItems: 'center',\n paddingTop: 25,\n paddingBottom: 25,\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n },\n messageStyle: {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n backgroundColor: '#FFFFFF',\n color: '#111111',\n padding: 20,\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n },\n textStyle1: {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n marginTop: 20,\n marginStart: 20,\n marginEnd: 20,\n color: '#9D9D9D',\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n },\n reasonTextStyle: {\n flex: 1,\n flexWrap: 'wrap',\n fontFamily: Fonts.IBMPlexSans_400Regular,\n fontStyle: 'normal',\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n textAlign: 'justify',\n color: '#111111',\n },\n\n reasonItemStyle: {\n flexDirection: 'row',\n paddingTop: 10,\n paddingStart: 20,\n paddingEnd: 20,\n backgroundColor: 'white',\n },\n heading: {\n marginTop: 30,\n marginStart: 25,\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n fontFamily: 'IBMPlexSans_400Regular',\n color: '#9D9D9D',\n },\n item: {\n margin: 10,\n padding: 15,\n borderWidth: 0.2,\n },\n btn: {\n width: 240,\n borderRadius: 4,\n backgroundColor: '#62d1bc',\n paddingHorizontal: 24,\n paddingVertical: 12,\n marginVertical: 8,\n },\n\n loader: { flex: 1, justifyContent: 'center', alignItems: 'center' },\n});\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"names":["StyleSheet","Fonts","PaymentStyles","create","amountStyle","fontSize","fontWeight","fontStyle","backgroundColor","textAlign","alignItems","paddingTop","paddingBottom","fontFamily","IBMPlexSans_600SemiBold","messageStyle","IBMPlexSans_400Regular","color","padding","textStyle1","marginTop","marginStart","marginEnd","reasonTextStyle","flex","flexWrap","lineHeight","letterSpacing","reasonItemStyle","flexDirection","paddingStart","paddingEnd","heading","item","margin","borderWidth","btn","width","borderRadius","paddingHorizontal","paddingVertical","marginVertical","loader","justifyContent"],"sources":["PaymentStyles.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { Fonts } from '../../../styles/executionTasks/CommonStyles';\n\nexport const PaymentStyles = StyleSheet.create({\n amountStyle: {\n fontSize: 18,\n fontWeight: '600',\n fontStyle: 'normal',\n backgroundColor: 'white',\n textAlign: 'center',\n alignItems: 'center',\n paddingTop: 25,\n paddingBottom: 25,\n fontFamily: Fonts.IBMPlexSans_600SemiBold,\n },\n messageStyle: {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n backgroundColor: '#FFFFFF',\n color: '#111111',\n padding: 20,\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n },\n textStyle1: {\n fontFamily: Fonts.IBMPlexSans_400Regular,\n marginTop: 20,\n marginStart: 20,\n marginEnd: 20,\n color: '#9D9D9D',\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n },\n reasonTextStyle: {\n flex: 1,\n flexWrap: 'wrap',\n fontFamily: Fonts.IBMPlexSans_400Regular,\n fontStyle: 'normal',\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n textAlign: 'justify',\n color: '#111111',\n },\n\n reasonItemStyle: {\n flexDirection: 'row',\n paddingTop: 10,\n paddingStart: 20,\n paddingEnd: 20,\n backgroundColor: 'white',\n },\n heading: {\n marginTop: 30,\n marginStart: 25,\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n fontFamily: 'IBMPlexSans_400Regular',\n color: '#9D9D9D',\n },\n item: {\n margin: 10,\n padding: 15,\n borderWidth: 0.2,\n },\n btn: {\n width: 240,\n borderRadius: 4,\n backgroundColor: '#62d1bc',\n paddingHorizontal: 24,\n paddingVertical: 12,\n marginVertical: 8,\n },\n\n loader: { flex: 1, justifyContent: 'center', alignItems: 'center' },\n});\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,KAAK,QAAQ,6CAA6C;AAEnE,OAAO,MAAMC,aAAa,GAAGF,UAAU,CAACG,MAAM,CAAC;EAC7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,EAAE,EAAE;IACZqB,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBd,UAAU,EAAE,wBAAwB;IACpCI,KAAK,EAAE;EACT,CAAC;EACDgB,IAAI,EAAE;IACJC,MAAM,EAAE,EAAE;IACVhB,OAAO,EAAE,EAAE;IACXiB,WAAW,EAAE;EACf,CAAC;EACDC,GAAG,EAAE;IACHC,KAAK,EAAE,GAAG;IACVC,YAAY,EAAE,CAAC;IACf9B,eAAe,EAAE,SAAS;IAC1B+B,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,cAAc,EAAE;EAClB,CAAC;EAEDC,MAAM,EAAE;IAAElB,IAAI,EAAE,CAAC;IAAEmB,cAAc,EAAE,QAAQ;IAAEjC,UAAU,EAAE;EAAS;AACpE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getUniqueTransactionID","amt","Date","now","toString","getPaymentValue","minorUnit","Math","pow"],"sources":["PaymentUtils.ts"],"sourcesContent":["export function getUniqueTransactionID(amt: number): string {\n return `TID${Date.now().toString() + amt.toString()}`;\n}\nexport function getPaymentValue(amt: number, minorUnit?: number): number {\n if (!minorUnit) return amt;\n return amt / Math.pow(10, minorUnit);\n}\n"],"mappings":"AAAA,OAAO,SAASA,
|
|
1
|
+
{"version":3,"names":["getUniqueTransactionID","amt","Date","now","toString","getPaymentValue","minorUnit","Math","pow"],"sources":["PaymentUtils.ts"],"sourcesContent":["export function getUniqueTransactionID(amt: number): string {\n return `TID${Date.now().toString() + amt.toString()}`;\n}\nexport function getPaymentValue(amt: number, minorUnit?: number): number {\n if (!minorUnit) return amt;\n return amt / Math.pow(10, minorUnit);\n}\n"],"mappings":"AAAA,OAAO,SAASA,sBAAsBA,CAACC,GAAW,EAAU;EAC1D,OAAQ,MAAKC,IAAI,CAACC,GAAG,EAAE,CAACC,QAAQ,EAAE,GAAGH,GAAG,CAACG,QAAQ,EAAG,EAAC;AACvD;AACA,OAAO,SAASC,eAAeA,CAACJ,GAAW,EAAEK,SAAkB,EAAU;EACvE,IAAI,CAACA,SAAS,EAAE,OAAOL,GAAG;EAC1B,OAAOA,GAAG,GAAGM,IAAI,CAACC,GAAG,CAAC,EAAE,EAAEF,SAAS,CAAC;AACtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useLayoutEffect } from 'react';
|
|
2
2
|
import { getBaseETResponse } from '../../../../utils/ExecTaskUtils';
|
|
3
3
|
import { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';
|
|
4
4
|
import { EntityCode, ExecutionTaskID } from '../../../../models/execTasks/ETConfig';
|
|
@@ -7,10 +7,67 @@ import { StyleSheet, View } from 'react-native';
|
|
|
7
7
|
import { CommonStyles, DeliverPickupStyles, Fonts } from '../../../../styles/executionTasks/CommonStyles';
|
|
8
8
|
import { getPaymentValue } from '../PaymentUtils';
|
|
9
9
|
import { PaymentStyles } from '../PaymentStyles';
|
|
10
|
-
|
|
10
|
+
import { GO_BACK_EVENT_CODE } from '../../../../constants/constants';
|
|
11
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
11
12
|
const CompletePaymentET = etProps => {
|
|
12
13
|
const [disableProceed, setDisableProceed] = useState(false);
|
|
13
|
-
|
|
14
|
+
const [showBackModal, setShowBackModal] = useState(false);
|
|
15
|
+
useLayoutEffect(() => {
|
|
16
|
+
etProps.navigation.setOptions({
|
|
17
|
+
title: etProps.title,
|
|
18
|
+
headerLeft: () => {
|
|
19
|
+
var _etProps$taskMeta;
|
|
20
|
+
return (_etProps$taskMeta = etProps.taskMeta) !== null && _etProps$taskMeta !== void 0 && _etProps$taskMeta.enableGoBack ? /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
+
onPress: async () => {
|
|
22
|
+
setShowBackModal(true);
|
|
23
|
+
},
|
|
24
|
+
name: "arrow-back",
|
|
25
|
+
color: 'black',
|
|
26
|
+
size: 25,
|
|
27
|
+
style: {
|
|
28
|
+
paddingRight: 15,
|
|
29
|
+
paddingTop: 5
|
|
30
|
+
}
|
|
31
|
+
}) : null;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [etProps.navigation, etProps.title]);
|
|
35
|
+
const renderModal = () => {
|
|
36
|
+
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Modal, {
|
|
37
|
+
visible: showBackModal,
|
|
38
|
+
dismissable: true,
|
|
39
|
+
contentContainerStyle: CommonStyles.modalContent
|
|
40
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: CommonStyles.modalView
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
43
|
+
style: CommonStyles.subText
|
|
44
|
+
}, 'Are you sure you want to go back?'), /*#__PURE__*/React.createElement(Button, {
|
|
45
|
+
labelStyle: CommonStyles.nextButtonLabel,
|
|
46
|
+
style: {
|
|
47
|
+
...CommonStyles.nextButton,
|
|
48
|
+
marginTop: 10
|
|
49
|
+
},
|
|
50
|
+
uppercase: false,
|
|
51
|
+
onPress: async () => {
|
|
52
|
+
etProps.onSubmitET({
|
|
53
|
+
paymentMode: etProps.paymentMode,
|
|
54
|
+
collectedAmount: etProps.collectedAmount,
|
|
55
|
+
tenantTransactionId: etProps.tenantTransactionId,
|
|
56
|
+
...(await getBaseETResponse(EntityCode.COMPLETE_PAYMENT, false, GO_BACK_EVENT_CODE, ''))
|
|
57
|
+
});
|
|
58
|
+
setShowBackModal(false);
|
|
59
|
+
}
|
|
60
|
+
}, "Yes"), /*#__PURE__*/React.createElement(Button, {
|
|
61
|
+
labelStyle: CommonStyles.cancelButtonLabel,
|
|
62
|
+
style: {
|
|
63
|
+
...CommonStyles.cancelButton,
|
|
64
|
+
marginTop: 10
|
|
65
|
+
},
|
|
66
|
+
uppercase: false,
|
|
67
|
+
onPress: () => setShowBackModal(false)
|
|
68
|
+
}, "No"))));
|
|
69
|
+
};
|
|
70
|
+
return /*#__PURE__*/React.createElement(Provider, null, renderModal(), /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
14
71
|
style: DeliverPickupStyles.mainContainer
|
|
15
72
|
}, /*#__PURE__*/React.createElement(Modal, {
|
|
16
73
|
dismissable: false,
|
|
@@ -35,12 +92,13 @@ const CompletePaymentET = etProps => {
|
|
|
35
92
|
marginTop: 20
|
|
36
93
|
}],
|
|
37
94
|
onPress: async () => {
|
|
95
|
+
var _etProps$applicableRe;
|
|
38
96
|
let etOutput = {
|
|
39
97
|
paymentMode: etProps.paymentMode,
|
|
40
98
|
collectedAmount: etProps.collectedAmount,
|
|
41
99
|
tenantTransactionId: etProps.tenantTransactionId,
|
|
42
100
|
// todo Hardcoded for SL Release and is only for CASH Payment Type
|
|
43
|
-
...(await getBaseETResponse(EntityCode.COMPLETE_PAYMENT, true, getEventCodeByET(ExecutionTaskID.COMPLETE_PAYMENT, true), ''))
|
|
101
|
+
...(await getBaseETResponse(EntityCode.COMPLETE_PAYMENT, true, getEventCodeByET(ExecutionTaskID.COMPLETE_PAYMENT, true, (_etProps$applicableRe = etProps.applicableReasons) === null || _etProps$applicableRe === void 0 ? void 0 : _etProps$applicableRe.success), ''))
|
|
44
102
|
};
|
|
45
103
|
setDisableProceed(true);
|
|
46
104
|
etProps.onSubmitET(etOutput);
|
|
@@ -52,19 +110,19 @@ const CompletePaymentET = etProps => {
|
|
|
52
110
|
}],
|
|
53
111
|
mode: 'outlined',
|
|
54
112
|
onPress: async () => {
|
|
113
|
+
var _etProps$applicableRe2;
|
|
55
114
|
let etOutput = {
|
|
56
115
|
paymentMode: etProps.paymentMode,
|
|
57
116
|
collectedAmount: etProps.collectedAmount,
|
|
58
117
|
tenantTransactionId: etProps.tenantTransactionId,
|
|
59
118
|
// todo Hardcoded for SL Release and is only for CASH Payment Type
|
|
60
|
-
...(await getBaseETResponse(EntityCode.COMPLETE_PAYMENT, false, getEventCodeByET(ExecutionTaskID.COMPLETE_PAYMENT, false), ''))
|
|
119
|
+
...(await getBaseETResponse(EntityCode.COMPLETE_PAYMENT, false, getEventCodeByET(ExecutionTaskID.COMPLETE_PAYMENT, false, (_etProps$applicableRe2 = etProps.applicableReasons) === null || _etProps$applicableRe2 === void 0 ? void 0 : _etProps$applicableRe2.failure), ''))
|
|
61
120
|
};
|
|
62
121
|
setDisableProceed(true);
|
|
63
122
|
etProps.onSubmitET(etOutput);
|
|
64
123
|
}
|
|
65
124
|
}, "Cancel"))))));
|
|
66
125
|
};
|
|
67
|
-
|
|
68
126
|
export default CompletePaymentET;
|
|
69
127
|
const styles = StyleSheet.create({
|
|
70
128
|
title: {
|