@os1-platform/dispatch-mobile 2.1.1 → 2.1.3
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/lib/commonjs/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +9 -4
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +78 -36
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -3
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +223 -127
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/camera.svg +3 -0
- package/lib/commonjs/components/executiontasks/imageCapture/circle-xmark.svg +5 -0
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickpSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/constants/constants.js +1 -1
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/Str.js +3 -1
- package/lib/commonjs/locale/Str.js.map +1 -1
- package/lib/commonjs/locale/en.json +2 -1
- package/lib/commonjs/locale/i18n.js +5 -1
- package/lib/commonjs/locale/i18n.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js +1 -1
- package/lib/commonjs/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +2 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +24 -5
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +22 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +24 -5
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +22 -1
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +24 -5
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +25 -4
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +31 -5
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/utils/helper.js +46 -3
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/DeliverETInput.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +9 -4
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +78 -36
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashSchema.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js +1 -1
- package/lib/module/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/module/components/executiontasks/forms/FormSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureSchema.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js +2 -3
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +226 -130
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/camera.svg +3 -0
- package/lib/module/components/executiontasks/imageCapture/circle-xmark.svg +5 -0
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/completePayment/CompletePaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickpSchema.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/constants/constants.js +1 -1
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/locale/Str.js +3 -1
- package/lib/module/locale/Str.js.map +1 -1
- package/lib/module/locale/en.json +2 -1
- package/lib/module/locale/i18n.js +5 -1
- package/lib/module/locale/i18n.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/styles/executionTasks/CommonStyles.js +2 -1
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +24 -5
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +22 -1
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +25 -5
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +22 -1
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +24 -5
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +25 -4
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +31 -5
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/utils/helper.js +46 -4
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/typescript/components/executiontasks/deliver/DeliverETInput.d.ts +1 -0
- package/lib/typescript/components/executiontasks/doodle/SignatureSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/dropCash/DropCashSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/forms/FormSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/imageCapture/CaptureSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/imageCapture/CaptureUtils.d.ts +6 -1
- package/lib/typescript/components/executiontasks/imageCapture/ImageCapture.d.ts +1 -2
- package/lib/typescript/components/executiontasks/payments/completePayment/CompletePaymentSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/payments/init/InitPaymentSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/payments/processPayment/ProcessPaymentSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/pickup/PickpSchema.d.ts +1 -0
- package/lib/typescript/constants/constants.d.ts +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/locale/Str.d.ts +2 -0
- package/lib/typescript/manager/syncmanager/DBConfig.d.ts +1 -1
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +1 -0
- package/lib/typescript/utils/helper.d.ts +4 -3
- package/package.json +4 -5
- package/src/components/executiontasks/deliver/DeliverETInput.ts +1 -0
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +13 -6
- package/src/components/executiontasks/doodle/SignatureET.tsx +48 -43
- package/src/components/executiontasks/doodle/SignatureSchema.ts +1 -0
- package/src/components/executiontasks/dropCash/DropCashSchema.ts +1 -0
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +4 -4
- package/src/components/executiontasks/forms/FormGenerator.tsx +4 -3
- package/src/components/executiontasks/forms/FormSchema.ts +1 -0
- package/src/components/executiontasks/imageCapture/CaptureSchema.ts +1 -0
- package/src/components/executiontasks/imageCapture/CaptureUtils.ts +4 -9
- package/src/components/executiontasks/imageCapture/ImageCapture.tsx +279 -185
- package/src/components/executiontasks/imageCapture/camera.svg +3 -0
- package/src/components/executiontasks/imageCapture/circle-xmark.svg +5 -0
- package/src/components/executiontasks/payments/completePayment/CompletePaymentET.tsx +2 -1
- package/src/components/executiontasks/payments/completePayment/CompletePaymentSchema.ts +1 -0
- package/src/components/executiontasks/payments/init/InitPaymentET.tsx +2 -3
- package/src/components/executiontasks/payments/init/InitPaymentSchema.ts +1 -0
- package/src/components/executiontasks/payments/processPayment/ProcessPaymentET.tsx +3 -2
- package/src/components/executiontasks/payments/processPayment/ProcessPaymentSchema.ts +1 -0
- package/src/components/executiontasks/pickup/PickpSchema.ts +1 -0
- package/src/components/executiontasks/pickup/SLPickupET.tsx +5 -3
- package/src/constants/constants.ts +1 -1
- package/src/index.tsx +4 -2
- package/src/locale/Str.ts +3 -1
- package/src/locale/en.json +2 -1
- package/src/locale/i18n.ts +5 -1
- package/src/manager/syncmanager/DBConfig.ts +1 -1
- package/src/styles/executionTasks/CommonStyles.ts +1 -0
- package/src/ui/screens/DeliverScreen.tsx +27 -8
- package/src/ui/screens/DoodleScreen.tsx +25 -2
- package/src/ui/screens/DropCashScreen.tsx +27 -8
- package/src/ui/screens/FormsScreen.tsx +23 -1
- package/src/ui/screens/ImageCaptureScreen.tsx +29 -11
- package/src/ui/screens/PaymentScreen.tsx +32 -10
- package/src/ui/screens/PickupScreen.tsx +35 -8
- package/src/utils/helper.ts +47 -4
|
@@ -17,7 +17,7 @@ import { PaymentStyles } from '../PaymentStyles';
|
|
|
17
17
|
import { isEmptyOrBlank } from '../../../../utils/utils';
|
|
18
18
|
import { CommonStyles } from '../../../../styles/executionTasks/CommonStyles';
|
|
19
19
|
import { getPaymentValue } from '../PaymentUtils';
|
|
20
|
-
import { Button,
|
|
20
|
+
import { Button, Provider, TextInput } from 'react-native-paper';
|
|
21
21
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
22
22
|
import { GO_BACK_EVENT_CODE } from '../../../../constants/constants';
|
|
23
23
|
import GoBackModal from '../../../../components/widgets/GoBackModal';
|
|
@@ -170,7 +170,7 @@ const ProcessPaymentET = (props: ProcessPaymentInput) => {
|
|
|
170
170
|
marginEnd: 10,
|
|
171
171
|
}}
|
|
172
172
|
>
|
|
173
|
-
<Button
|
|
173
|
+
{(props.isSelfLoop == false) && <Button
|
|
174
174
|
style={[
|
|
175
175
|
CommonStyles.cancelButton,
|
|
176
176
|
{
|
|
@@ -207,6 +207,7 @@ const ProcessPaymentET = (props: ProcessPaymentInput) => {
|
|
|
207
207
|
>
|
|
208
208
|
Cancel
|
|
209
209
|
</Button>
|
|
210
|
+
}
|
|
210
211
|
<Button
|
|
211
212
|
disabled={disableNext}
|
|
212
213
|
style={[
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BackHandler, StyleSheet, Text, View, Modal, Platform, TouchableOpacity } from 'react-native';
|
|
2
|
-
import React, { useState, useLayoutEffect, useCallback } from 'react';
|
|
2
|
+
import React, { useState, useLayoutEffect, useCallback, useEffect } from 'react';
|
|
3
3
|
import { Button, Portal, Provider } from 'react-native-paper';
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -29,6 +29,7 @@ import Str from '../../../locale/Str';
|
|
|
29
29
|
import CircleMark from '../../../icons/circleMark.svg';
|
|
30
30
|
import ModalWidget from '../../../components/widgets/ModalWidget';
|
|
31
31
|
|
|
32
|
+
|
|
32
33
|
const ListItem = ({ lineItem }: { lineItem: LineItem }) => (
|
|
33
34
|
<View style={{ justifyContent: 'center' }}>
|
|
34
35
|
<Text style={DeliverPickupStyles.itemTextStyle}>
|
|
@@ -58,6 +59,7 @@ const SLPickupET = (props: PickupETInput) => {
|
|
|
58
59
|
const [showPickupModal, setShowPickupModal] = useState(true);
|
|
59
60
|
const [goBack, setGoBack] = useState(false);
|
|
60
61
|
|
|
62
|
+
|
|
61
63
|
useFocusEffect(
|
|
62
64
|
useCallback(() => {
|
|
63
65
|
const onBackPress = () => {
|
|
@@ -260,7 +262,7 @@ const SLPickupET = (props: PickupETInput) => {
|
|
|
260
262
|
>
|
|
261
263
|
Yes
|
|
262
264
|
</Button>
|
|
263
|
-
<Button
|
|
265
|
+
{(props?.isSelfLoop == false) && <Button
|
|
264
266
|
disabled={disableProceed}
|
|
265
267
|
uppercase={false}
|
|
266
268
|
style={[CommonStyles.cancelButton, { marginTop: 5 }]}
|
|
@@ -286,7 +288,7 @@ const SLPickupET = (props: PickupETInput) => {
|
|
|
286
288
|
}}
|
|
287
289
|
>
|
|
288
290
|
No
|
|
289
|
-
</Button>
|
|
291
|
+
</Button>}
|
|
290
292
|
</View>
|
|
291
293
|
</View>
|
|
292
294
|
</View>
|
|
@@ -7,6 +7,6 @@ export const DEFAULT_PICKUP_MESSAGE = 'Confirm Pickup of $ orders';
|
|
|
7
7
|
export const DEFAULT_DELIVER_TITLE = 'Drop Order';
|
|
8
8
|
export const DEFAULT_DELIVER_MESSAGE = 'Confirm Drop of $ orders';
|
|
9
9
|
export const DEFAULT_SIGN_ET_MESSAGE =
|
|
10
|
-
'Please
|
|
10
|
+
'Please sign here';
|
|
11
11
|
export const REASON_NOT_USED = 'NOT_TO_BE_USED';
|
|
12
12
|
export const GO_BACK_EVENT_CODE = 'E-099';
|
package/src/index.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import useFCMMessage, {
|
|
|
14
14
|
getFCMToken,
|
|
15
15
|
registerBackgroundHandler,
|
|
16
16
|
requestFirebasePermissions,
|
|
17
|
-
onNotificationOpenedApp,
|
|
17
|
+
onNotificationOpenedApp,
|
|
18
18
|
onTokenRefresh,
|
|
19
19
|
getInitialNotification,
|
|
20
20
|
} from './utils/fcm/FcmUtils';
|
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
IDispatch,
|
|
46
46
|
IDispatchExecutor,
|
|
47
47
|
} from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
48
|
+
import Helper from './utils/helper';
|
|
48
49
|
|
|
49
50
|
export { DispatchExecutor, IDispatch, IDispatchExecutor };
|
|
50
51
|
export { Storage, DispatchExecNavigator };
|
|
@@ -61,7 +62,7 @@ export {
|
|
|
61
62
|
requestFirebasePermissions,
|
|
62
63
|
FCM,
|
|
63
64
|
registerBackgroundHandler,
|
|
64
|
-
onNotificationOpenedApp,
|
|
65
|
+
onNotificationOpenedApp,
|
|
65
66
|
onTokenRefresh,
|
|
66
67
|
getInitialNotification,
|
|
67
68
|
DispatchStateContainer,
|
|
@@ -78,3 +79,4 @@ export { DispatchSDKManager };
|
|
|
78
79
|
|
|
79
80
|
export type { MTSStartRequest, MTSInitRequest };
|
|
80
81
|
export { MtsSdk };
|
|
82
|
+
export { Helper };
|
package/src/locale/Str.ts
CHANGED
|
@@ -5,9 +5,11 @@ export default {
|
|
|
5
5
|
//string constants
|
|
6
6
|
DEFAULT_PICKUP_MESSAGE: 'DEFAULT_PICKUP_MESSAGE',
|
|
7
7
|
DEFAULT_DELIVER_MESSAGE: 'DEFAULT_DELIVER_MESSAGE',
|
|
8
|
+
DEFAULT_RETURN_MESSAGE: 'DEFAULT_RETURN_MESSAGE',
|
|
8
9
|
Expected_Shipments: 'Expected_Shipments',
|
|
9
10
|
Expected_Shipment: 'Expected_Shipment',
|
|
10
11
|
Shipment_handed_over: 'Shipment_handed_over',
|
|
11
12
|
Shipments_handed_over: 'Shipments_handed_over',
|
|
12
|
-
shipments: 'shipments'
|
|
13
|
+
shipments: 'shipments',
|
|
14
|
+
skip: 'skip'
|
|
13
15
|
}
|
package/src/locale/en.json
CHANGED
package/src/locale/i18n.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { I18n } from "i18n-js";
|
|
|
2
2
|
import en from './en.json';
|
|
3
3
|
|
|
4
4
|
const i18n = new I18n({
|
|
5
|
-
...en,
|
|
6
5
|
en: {
|
|
6
|
+
...en,
|
|
7
7
|
DEFAULT_PICKUP_MESSAGE: {
|
|
8
8
|
one: "Confirm Pickup of 1 order",
|
|
9
9
|
other: "Confirm Pickup of %{count} orders",
|
|
@@ -12,6 +12,10 @@ const i18n = new I18n({
|
|
|
12
12
|
one: "Confirm Drop of 1 order",
|
|
13
13
|
other: "Confirm Drop of %{count} orders"
|
|
14
14
|
},
|
|
15
|
+
DEFAULT_RETURN_MESSAGE: {
|
|
16
|
+
one: "Confirm Return of 1 order",
|
|
17
|
+
other: "Confirm Return of %{count} orders"
|
|
18
|
+
},
|
|
15
19
|
shipments: {
|
|
16
20
|
one: "(%{count} shipment)?",
|
|
17
21
|
other: "(%{count} shipments)?"
|
|
@@ -7,7 +7,7 @@ export enum DispatchSyncType {
|
|
|
7
7
|
DISPATCH_SUB_STATUS_UPDATE = 'DISPATCH_SUB_STATUS_UPDATE',
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const DATABASE_NAME = '
|
|
10
|
+
export const DATABASE_NAME = 'OS1_Driver_App_DB';
|
|
11
11
|
export const EVENTS_TABLE = 'EVENTS_TABLE';
|
|
12
12
|
export const REASONS_TABLE = 'REASONS_TABLE';
|
|
13
13
|
export const EVENT_CODES_TABLE = 'EVENT_CODES_TABLE';
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
SHARED_PREFERENCE_SCAN_OUTPUT,
|
|
16
16
|
} from '../../manager/syncmanager/constants';
|
|
17
17
|
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
18
|
+
import Helper from '../../utils/helper';
|
|
18
19
|
|
|
19
20
|
const DeliverScreen = ({
|
|
20
21
|
navigation,
|
|
@@ -25,13 +26,37 @@ const DeliverScreen = ({
|
|
|
25
26
|
navigation: any;
|
|
26
27
|
baseETProps: BaseETProps;
|
|
27
28
|
}) => {
|
|
29
|
+
const helperInstance = Helper.getInstance();
|
|
28
30
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
29
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
31
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
30
32
|
getDataFromNextState(nextState);
|
|
31
33
|
|
|
32
34
|
const [returnPackageCount, setReturnPackageCount] = useState(0);
|
|
33
35
|
const [shipCount, setShipCount] = useState(0);
|
|
34
36
|
const [items, setItems] = useState([]);
|
|
37
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
(async () => {
|
|
41
|
+
onTaskStart(
|
|
42
|
+
nextState,
|
|
43
|
+
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
44
|
+
);
|
|
45
|
+
getMergedReturnPackageCount();
|
|
46
|
+
await getSelfLoopBool();
|
|
47
|
+
})();
|
|
48
|
+
}, [])
|
|
49
|
+
|
|
50
|
+
const getSelfLoopBool = async () => {
|
|
51
|
+
try {
|
|
52
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
53
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(splitArr[1], taskName)
|
|
54
|
+
setSelfLoop(isSelfLoopTrue);
|
|
55
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
35
60
|
|
|
36
61
|
const getMergedReturnPackageCount = async () => {
|
|
37
62
|
const count = await DispatchExecutor.getScannedShipmentsCount(
|
|
@@ -40,13 +65,6 @@ const DeliverScreen = ({
|
|
|
40
65
|
setReturnPackageCount(count.totalCount);
|
|
41
66
|
setShipCount(count.shipCount);
|
|
42
67
|
};
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
onTaskStart(
|
|
45
|
-
nextState,
|
|
46
|
-
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
47
|
-
);
|
|
48
|
-
getMergedReturnPackageCount();
|
|
49
|
-
}, []);
|
|
50
68
|
|
|
51
69
|
useEffect(() => {
|
|
52
70
|
if (returnPackageCount === 1) {
|
|
@@ -79,6 +97,7 @@ const DeliverScreen = ({
|
|
|
79
97
|
{...input}
|
|
80
98
|
items={items}
|
|
81
99
|
navigation={navigation}
|
|
100
|
+
isSelfLoop={isSelfLoopTrue}
|
|
82
101
|
taskMeta={taskMeta}
|
|
83
102
|
mergedObjectiveId={mergedObjectiveId}
|
|
84
103
|
returnPackageCount={returnPackageCount}
|
|
@@ -8,7 +8,9 @@ import { RouteParams, getDataFromNextState } from '../uiConfig/RouteParams';
|
|
|
8
8
|
import { View } from 'react-native';
|
|
9
9
|
import CancelOrderDialog from '../../components/widgets/CancelOrderDialog';
|
|
10
10
|
import { onTaskStart } from '../../utils/ExecTaskUtils';
|
|
11
|
-
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
11
|
+
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
12
|
+
import Helper from '../../utils/helper';
|
|
13
|
+
|
|
12
14
|
const DoodleScreen = ({
|
|
13
15
|
route,
|
|
14
16
|
navigation,
|
|
@@ -18,8 +20,9 @@ const DoodleScreen = ({
|
|
|
18
20
|
navigation: any;
|
|
19
21
|
baseETProps: BaseETProps;
|
|
20
22
|
}) => {
|
|
23
|
+
const helperInstance = Helper.getInstance();
|
|
21
24
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
22
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
25
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
23
26
|
getDataFromNextState(nextState);
|
|
24
27
|
useEffect(() => {
|
|
25
28
|
onTaskStart(
|
|
@@ -29,6 +32,25 @@ const DoodleScreen = ({
|
|
|
29
32
|
}, []);
|
|
30
33
|
const [showAlert, setShowAlert] = useState(false);
|
|
31
34
|
const [sResponse, setResponse] = useState<any>();
|
|
35
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
(async () => {
|
|
39
|
+
await getSelfLoopBool();
|
|
40
|
+
})();
|
|
41
|
+
}, [])
|
|
42
|
+
|
|
43
|
+
const getSelfLoopBool = async () => {
|
|
44
|
+
try {
|
|
45
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
46
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(splitArr[1], taskName)
|
|
47
|
+
setSelfLoop(isSelfLoopTrue);
|
|
48
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
32
54
|
const submitOutput = useCallback(
|
|
33
55
|
async (base64Data: any) => {
|
|
34
56
|
await DispatchStateContainer.getInstance().navigateToNextTask(
|
|
@@ -52,6 +74,7 @@ const DoodleScreen = ({
|
|
|
52
74
|
// jobIDs={getJobIDs(route.params[RouteParams.NEXT_STATES])}
|
|
53
75
|
// objRefs={getObjectiveRefs(route.params[RouteParams.NEXT_STATES])}
|
|
54
76
|
navigation={navigation}
|
|
77
|
+
isSelfLoop={isSelfLoopTrue}
|
|
55
78
|
taskMeta={taskMeta}
|
|
56
79
|
mergedObjectiveId={mergedObjectiveId}
|
|
57
80
|
onSubmitET={async (base64Data) => {
|
|
@@ -12,6 +12,8 @@ import { onTaskStart } from '../../utils/ExecTaskUtils';
|
|
|
12
12
|
|
|
13
13
|
import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
14
14
|
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
15
|
+
import Helper from '../../utils/helper';
|
|
16
|
+
|
|
15
17
|
// OLD CODE
|
|
16
18
|
// function getTotalExpected(nextStates: any[]): ETAmount {
|
|
17
19
|
// let totalAmount = 0;
|
|
@@ -35,8 +37,9 @@ const DropCashScreen = ({
|
|
|
35
37
|
navigation: any;
|
|
36
38
|
baseETProps: BaseETProps;
|
|
37
39
|
}) => {
|
|
40
|
+
const helperInstance = Helper.getInstance();
|
|
38
41
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
39
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
42
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
40
43
|
getDataFromNextState(nextState);
|
|
41
44
|
|
|
42
45
|
const [expectedAmount, setExpectedAmount] = useState<ETAmount>({
|
|
@@ -44,6 +47,18 @@ const DropCashScreen = ({
|
|
|
44
47
|
minorUnit: input.expectedAmount.minorUnit,
|
|
45
48
|
currencyCode: input.expectedAmount.currencyCode,
|
|
46
49
|
});
|
|
50
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
(async () => {
|
|
54
|
+
onTaskStart(
|
|
55
|
+
nextState,
|
|
56
|
+
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
57
|
+
);
|
|
58
|
+
getTotalExpected();
|
|
59
|
+
await getSelfLoopBool();
|
|
60
|
+
})();
|
|
61
|
+
}, [])
|
|
47
62
|
|
|
48
63
|
const getTotalExpected = async () => {
|
|
49
64
|
const totalAmount: number = await DispatchExecutor.getTotalAmountMWI(
|
|
@@ -52,13 +67,16 @@ const DropCashScreen = ({
|
|
|
52
67
|
setExpectedAmount({ ...expectedAmount, value: totalAmount });
|
|
53
68
|
};
|
|
54
69
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
const getSelfLoopBool = async () => {
|
|
71
|
+
try {
|
|
72
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
73
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(splitArr[1], taskName)
|
|
74
|
+
setSelfLoop(isSelfLoopTrue);
|
|
75
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
62
80
|
|
|
63
81
|
const [showAlert, setShowAlert] = useState(false);
|
|
64
82
|
const [sResponse, setResponse] = useState<any>();
|
|
@@ -82,6 +100,7 @@ const DropCashScreen = ({
|
|
|
82
100
|
<SLDropCash
|
|
83
101
|
{...input}
|
|
84
102
|
expectedAmount={expectedAmount}
|
|
103
|
+
isSelfLoop={isSelfLoopTrue}
|
|
85
104
|
navigation={navigation}
|
|
86
105
|
mergedObjectiveId={mergedObjectiveId}
|
|
87
106
|
taskMeta={taskMeta}
|
|
@@ -13,6 +13,7 @@ import SnackBarCustom, {
|
|
|
13
13
|
import callbackHandler from '../../manager/sdk/callbacksHandler';
|
|
14
14
|
import { DispatchExecutor as dispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
15
15
|
import { AjvError } from '@rjsf/core';
|
|
16
|
+
import Helper from '../../utils/helper';
|
|
16
17
|
|
|
17
18
|
const FormsScreen = ({
|
|
18
19
|
route,
|
|
@@ -23,15 +24,18 @@ const FormsScreen = ({
|
|
|
23
24
|
navigation: any;
|
|
24
25
|
baseETProps: BaseETProps;
|
|
25
26
|
}) => {
|
|
27
|
+
const helperInstance = Helper.getInstance();
|
|
26
28
|
const [snackBar, setSnackBar] = useState({
|
|
27
29
|
show: false,
|
|
28
30
|
type: SnackBarType.SUCCESS,
|
|
29
31
|
message: '',
|
|
30
32
|
});
|
|
31
33
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
32
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
34
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
33
35
|
getDataFromNextState(nextState);
|
|
34
36
|
const [_input, setInputs] = useState(input);
|
|
37
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
38
|
+
|
|
35
39
|
useEffect(() => {
|
|
36
40
|
(async () => {
|
|
37
41
|
onTaskStart(
|
|
@@ -77,11 +81,29 @@ const FormsScreen = ({
|
|
|
77
81
|
})();
|
|
78
82
|
}, []);
|
|
79
83
|
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
(async () => {
|
|
86
|
+
await getSelfLoopBool();
|
|
87
|
+
})();
|
|
88
|
+
}, [])
|
|
89
|
+
|
|
90
|
+
const getSelfLoopBool = async () => {
|
|
91
|
+
try {
|
|
92
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
93
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(splitArr[1], taskName)
|
|
94
|
+
setSelfLoop(isSelfLoopTrue);
|
|
95
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
80
101
|
return (
|
|
81
102
|
<>
|
|
82
103
|
<FormGenerator
|
|
83
104
|
{..._input}
|
|
84
105
|
navigation={navigation}
|
|
106
|
+
isSelfLoop={isSelfLoopTrue}
|
|
85
107
|
mergedObjectiveId={mergedObjectiveId}
|
|
86
108
|
taskMeta={taskMeta}
|
|
87
109
|
onError={(error: AjvError[] | AjvError) => {
|
|
@@ -6,8 +6,9 @@ import withBaseDispatchScreen from './WithBaseDispatchScreen';
|
|
|
6
6
|
import DispatchStateContainer from '../../manager/dispatch/DispatchStateContainer';
|
|
7
7
|
import { RouteParams, getDataFromNextState } from '../uiConfig/RouteParams';
|
|
8
8
|
import { onTaskStart } from '../../utils/ExecTaskUtils';
|
|
9
|
-
|
|
10
9
|
import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
10
|
+
import Helper from '../../utils/helper';
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
const ImageCaptureScreen = ({
|
|
13
14
|
route,
|
|
@@ -18,12 +19,36 @@ const ImageCaptureScreen = ({
|
|
|
18
19
|
navigation: any;
|
|
19
20
|
baseETProps: BaseETProps;
|
|
20
21
|
}) => {
|
|
22
|
+
const helperInstance = Helper.getInstance();
|
|
21
23
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
22
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
24
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
23
25
|
getDataFromNextState(nextState);
|
|
24
26
|
const firstInput = input;
|
|
25
27
|
const [inputs, setInputs] = useState(firstInput);
|
|
26
28
|
const [captureCount, setCaptureCount] = useState(0);
|
|
29
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
(async () => {
|
|
33
|
+
onTaskStart(
|
|
34
|
+
route.params[RouteParams.NEXT_STATES],
|
|
35
|
+
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
36
|
+
);
|
|
37
|
+
getMergedCaptureCount();
|
|
38
|
+
await getSelfLoopBool();
|
|
39
|
+
})();
|
|
40
|
+
}, [])
|
|
41
|
+
|
|
42
|
+
const getSelfLoopBool = async () => {
|
|
43
|
+
try {
|
|
44
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
45
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(splitArr[1], taskName)
|
|
46
|
+
setSelfLoop(isSelfLoopTrue);
|
|
47
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
27
52
|
|
|
28
53
|
const getMergedCaptureCount = async () => {
|
|
29
54
|
const count = await DispatchExecutor.getScannedShipmentsCount(
|
|
@@ -32,14 +57,6 @@ const ImageCaptureScreen = ({
|
|
|
32
57
|
setCaptureCount(count.totalCount);
|
|
33
58
|
};
|
|
34
59
|
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
onTaskStart(
|
|
37
|
-
route.params[RouteParams.NEXT_STATES],
|
|
38
|
-
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
39
|
-
);
|
|
40
|
-
getMergedCaptureCount();
|
|
41
|
-
}, []);
|
|
42
|
-
|
|
43
60
|
useEffect(() => {
|
|
44
61
|
let _captureCountLimit = captureCount * input.captureCountLimit;
|
|
45
62
|
|
|
@@ -53,12 +70,13 @@ const ImageCaptureScreen = ({
|
|
|
53
70
|
<ImageCapture
|
|
54
71
|
{...inputs}
|
|
55
72
|
captureCount={captureCount}
|
|
73
|
+
isSelfLoop={isSelfLoopTrue}
|
|
56
74
|
navigation={navigation}
|
|
57
75
|
taskMeta={taskMeta}
|
|
58
76
|
mergedObjectiveId={mergedObjectiveId}
|
|
59
77
|
// jobIds={getJobIDs(route.params[RouteParams.NEXT_STATES])}
|
|
60
78
|
// objRefs={getObjectiveRefs(route.params[RouteParams.NEXT_STATES])}
|
|
61
|
-
onSubmitET={async (imageDataList) => {
|
|
79
|
+
onSubmitET={async (imageDataList: { success: boolean; }) => {
|
|
62
80
|
await DispatchStateContainer.getInstance().navigateToNextTask(
|
|
63
81
|
navigation,
|
|
64
82
|
route,
|
|
@@ -20,6 +20,8 @@ import { getEventCodeByET } from '../../manager/dispatchCodes/EventCodeContainer
|
|
|
20
20
|
import { useEffect } from 'react';
|
|
21
21
|
import { IDispatch } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
22
22
|
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
23
|
+
import Helper from '../../utils/helper';
|
|
24
|
+
|
|
23
25
|
const PaymentScreen = ({
|
|
24
26
|
navigation,
|
|
25
27
|
route,
|
|
@@ -29,21 +31,38 @@ const PaymentScreen = ({
|
|
|
29
31
|
navigation: any;
|
|
30
32
|
baseETProps: BaseETProps;
|
|
31
33
|
}) => {
|
|
34
|
+
const helperInstance = Helper.getInstance();
|
|
32
35
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
33
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
36
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
34
37
|
getDataFromNextState(nextState);
|
|
35
38
|
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
onTaskStart(
|
|
38
|
-
route.params[RouteParams.NEXT_STATES],
|
|
39
|
-
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
40
|
-
);
|
|
41
|
-
}, []);
|
|
42
39
|
let currentState = route.params[
|
|
43
40
|
RouteParams.NEXT_STATES
|
|
44
41
|
] as IDispatch.IExecutionTaskQueryResponse;
|
|
45
42
|
const [showAlert, setShowAlert] = useState(false);
|
|
46
43
|
const [sResponse, setResponse] = useState<any>();
|
|
44
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
(async () => {
|
|
48
|
+
onTaskStart(
|
|
49
|
+
route.params[RouteParams.NEXT_STATES],
|
|
50
|
+
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
51
|
+
);
|
|
52
|
+
await getSelfLoopBool();
|
|
53
|
+
})();
|
|
54
|
+
}, [])
|
|
55
|
+
|
|
56
|
+
const getSelfLoopBool = async () => {
|
|
57
|
+
try {
|
|
58
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
59
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(splitArr[1], taskName)
|
|
60
|
+
setSelfLoop(isSelfLoopTrue);
|
|
61
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
47
66
|
|
|
48
67
|
const taskId = currentState.taskId as ExecutionTaskID;
|
|
49
68
|
|
|
@@ -69,6 +88,7 @@ const PaymentScreen = ({
|
|
|
69
88
|
<InitPaymentET
|
|
70
89
|
{...input}
|
|
71
90
|
navigation={navigation}
|
|
91
|
+
isSelfLoop={isSelfLoopTrue}
|
|
72
92
|
taskMeta={taskMeta}
|
|
73
93
|
mergedObjectiveId={mergedObjectiveId}
|
|
74
94
|
onSubmitET={async (etOutput) => {
|
|
@@ -135,12 +155,13 @@ const PaymentScreen = ({
|
|
|
135
155
|
<ProcessPaymentET
|
|
136
156
|
{...input}
|
|
137
157
|
navigation={navigation}
|
|
158
|
+
isSelfLoop={isSelfLoopTrue}
|
|
138
159
|
mergedObjectiveId={mergedObjectiveId}
|
|
139
160
|
taskMeta={taskMeta}
|
|
140
161
|
onSubmitET={async (etOutput) => {
|
|
141
|
-
if (
|
|
142
|
-
etOutput.success ||
|
|
143
|
-
etOutput.eventCode == GO_BACK_EVENT_CODE
|
|
162
|
+
if (
|
|
163
|
+
etOutput.success ||
|
|
164
|
+
etOutput.eventCode == GO_BACK_EVENT_CODE
|
|
144
165
|
) {
|
|
145
166
|
await submitOutput(etOutput);
|
|
146
167
|
} else {
|
|
@@ -169,6 +190,7 @@ const PaymentScreen = ({
|
|
|
169
190
|
<CompletePaymentET
|
|
170
191
|
{...input}
|
|
171
192
|
navigation={navigation}
|
|
193
|
+
isSelfLoop={isSelfLoopTrue}
|
|
172
194
|
taskMeta={taskMeta}
|
|
173
195
|
mergedObjectiveId={mergedObjectiveId}
|
|
174
196
|
onSubmitET={async (etOut) => {
|
|
@@ -9,6 +9,7 @@ import { onTaskStart } from '../../utils/ExecTaskUtils';
|
|
|
9
9
|
|
|
10
10
|
import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
11
11
|
import SLPickupET from '../../components/executiontasks/pickup/SLPickupET';
|
|
12
|
+
import Helper from '../../utils/helper';
|
|
12
13
|
|
|
13
14
|
const PickupScreen = ({
|
|
14
15
|
route,
|
|
@@ -19,13 +20,27 @@ const PickupScreen = ({
|
|
|
19
20
|
navigation: any;
|
|
20
21
|
baseETProps: BaseETProps;
|
|
21
22
|
}) => {
|
|
23
|
+
const helperInstance = Helper.getInstance();
|
|
24
|
+
|
|
22
25
|
const nextState = route.params[RouteParams.NEXT_STATES];
|
|
23
|
-
const { taskMeta, mergedObjectiveId, input, wfMeta } =
|
|
26
|
+
const { taskMeta, mergedObjectiveId, input, wfMeta, taskName } =
|
|
24
27
|
getDataFromNextState(nextState);
|
|
25
28
|
|
|
26
29
|
const [pickupCount, setPickupCount] = useState(0);
|
|
27
30
|
const [shipCount, setShipCount] = useState(0);
|
|
28
31
|
const [items, setItems] = useState([]);
|
|
32
|
+
const [isSelfLoopTrue, setSelfLoop] = useState(false);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
(async () => {
|
|
36
|
+
onTaskStart(
|
|
37
|
+
nextState,
|
|
38
|
+
route.params[RouteParams.ROOT_META_DATA].customEventsData
|
|
39
|
+
);
|
|
40
|
+
getMergedPickCount();
|
|
41
|
+
await getSelfLoopBool();
|
|
42
|
+
})();
|
|
43
|
+
}, []);
|
|
29
44
|
|
|
30
45
|
const getMergedPickCount = async () => {
|
|
31
46
|
const count = await DispatchExecutor.getScannedShipmentsCount(
|
|
@@ -34,13 +49,24 @@ const PickupScreen = ({
|
|
|
34
49
|
setPickupCount(count.totalCount);
|
|
35
50
|
setShipCount(count.shipCount);
|
|
36
51
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
|
|
53
|
+
const getSelfLoopBool = async () => {
|
|
54
|
+
try {
|
|
55
|
+
const splitArr = mergedObjectiveId[0]?.split('#');
|
|
56
|
+
console.log("aks::workflowId", JSON.stringify(splitArr))
|
|
57
|
+
//
|
|
58
|
+
const workflowId = splitArr[1];
|
|
59
|
+
console.log("aks::workflowId", workflowId)
|
|
60
|
+
//
|
|
61
|
+
const isSelfLoopTrue: boolean = await helperInstance.isSelfLoopExistOnET(workflowId, taskName)
|
|
62
|
+
console.log("aks::isSelfLoopTrue", isSelfLoopTrue)
|
|
63
|
+
//
|
|
64
|
+
setSelfLoop(isSelfLoopTrue);
|
|
65
|
+
console.log('isSelfLoopTrue code execution successful!');
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.log('isSelfLoopTrue code execution error', error);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
44
70
|
|
|
45
71
|
useEffect(() => {
|
|
46
72
|
if (pickupCount === 1) {
|
|
@@ -67,6 +93,7 @@ const PickupScreen = ({
|
|
|
67
93
|
shipCount={shipCount}
|
|
68
94
|
navigation={navigation}
|
|
69
95
|
taskMeta={taskMeta}
|
|
96
|
+
isSelfLoop={isSelfLoopTrue}
|
|
70
97
|
onSubmitET={async (pickupOutput) => {
|
|
71
98
|
await DispatchStateContainer.getInstance().navigateToNextTask(
|
|
72
99
|
navigation,
|