@os1-platform/dispatch-mobile 2.1.12 → 2.1.14
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/imageCapture/ImageCapture.js +3 -0
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +9 -6
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +66 -27
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +4 -2
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +0 -13
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +9 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +9 -1
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/utils/Constants.js +9 -0
- package/lib/commonjs/utils/Constants.js.map +1 -0
- package/lib/commonjs/utils/Enums.js +12 -0
- package/lib/commonjs/utils/Enums.js.map +1 -0
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +3 -0
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +9 -6
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +67 -28
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js +4 -2
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +0 -13
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +9 -1
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +9 -1
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/utils/Constants.js +3 -0
- package/lib/module/utils/Constants.js.map +1 -0
- package/lib/module/utils/Enums.js +6 -0
- package/lib/module/utils/Enums.js.map +1 -0
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +2 -0
- package/lib/typescript/utils/Constants.d.ts +1 -0
- package/lib/typescript/utils/Enums.d.ts +4 -0
- package/package.json +2 -2
- package/src/components/executiontasks/imageCapture/ImageCapture.tsx +36 -31
- package/src/components/executiontasks/scan/ScanET.tsx +23 -23
- package/src/components/executiontasks/scan/interfaces.ts +2 -0
- package/src/components/executiontasks/scan/sub_components/SummaryPage.tsx +107 -80
- package/src/components/executiontasks/scan/utils.ts +4 -1
- package/src/manager/syncmanager/document/DocumentSyncManager.ts +45 -62
- package/src/ui/screens/DeliverScreen.tsx +9 -7
- package/src/ui/screens/FormsScreen.tsx +14 -7
- package/src/ui/screens/ImageCaptureScreen.tsx +1 -1
- package/src/utils/Constants.ts +2 -0
- package/src/utils/Enums.ts +4 -0
- package/src/utils/storage.ts +9 -9
|
@@ -42,7 +42,7 @@ export default class DocumentSyncManager {
|
|
|
42
42
|
this._retries = value;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
private constructor() {}
|
|
45
|
+
private constructor() { }
|
|
46
46
|
|
|
47
47
|
public init(baseURL: string, retryCount: number) {
|
|
48
48
|
if (isEmptyOrBlank(baseURL))
|
|
@@ -72,21 +72,6 @@ export default class DocumentSyncManager {
|
|
|
72
72
|
await this.docManager.getUnsyncedDocument();
|
|
73
73
|
if (documentRows?.length > 0) {
|
|
74
74
|
await this.uploadDocToServer(documentRows[0]);
|
|
75
|
-
let cta = 'startDocumentSync-DataAvailable'
|
|
76
|
-
fireEventWithScreenName({
|
|
77
|
-
severityLevel: SeverityLevelValue.LOG,
|
|
78
|
-
eventName: SentryEventNameSdkConstants.APP_LOG,
|
|
79
|
-
screenName: cta,
|
|
80
|
-
cta: cta,
|
|
81
|
-
extraParams: {
|
|
82
|
-
msg: JSON.stringify(documentRows[0])
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
Logger.getInstance().logEvent(
|
|
86
|
-
cta,
|
|
87
|
-
JSON.stringify(documentRows[0]),
|
|
88
|
-
LOG_TYPE.SDK_ERROR
|
|
89
|
-
);
|
|
90
75
|
} else {
|
|
91
76
|
let cta = 'startDocumentSync-NoData'
|
|
92
77
|
fireEventWithScreenName({
|
|
@@ -95,7 +80,7 @@ export default class DocumentSyncManager {
|
|
|
95
80
|
screenName: cta,
|
|
96
81
|
cta: cta,
|
|
97
82
|
extraParams: {
|
|
98
|
-
msg:'No data to sync'
|
|
83
|
+
msg: 'No data to sync'
|
|
99
84
|
},
|
|
100
85
|
});
|
|
101
86
|
Logger.getInstance().logEvent(
|
|
@@ -112,7 +97,7 @@ export default class DocumentSyncManager {
|
|
|
112
97
|
screenName: cta,
|
|
113
98
|
cta: cta,
|
|
114
99
|
extraParams: {
|
|
115
|
-
msg:'No Network'
|
|
100
|
+
msg: 'No Network'
|
|
116
101
|
},
|
|
117
102
|
});
|
|
118
103
|
Logger.getInstance().logEvent(
|
|
@@ -129,7 +114,7 @@ export default class DocumentSyncManager {
|
|
|
129
114
|
screenName: cta,
|
|
130
115
|
cta: cta,
|
|
131
116
|
extraParams: {
|
|
132
|
-
msg:flattenObject(error)
|
|
117
|
+
msg: flattenObject(error)
|
|
133
118
|
},
|
|
134
119
|
});
|
|
135
120
|
Logger.getInstance().logEvent(
|
|
@@ -153,7 +138,7 @@ export default class DocumentSyncManager {
|
|
|
153
138
|
screenName: cta,
|
|
154
139
|
cta: cta,
|
|
155
140
|
extraParams: {
|
|
156
|
-
msg:flattenObject(extraParameters)
|
|
141
|
+
msg: flattenObject(extraParameters)
|
|
157
142
|
},
|
|
158
143
|
});
|
|
159
144
|
Logger.getInstance().logEvent(
|
|
@@ -171,7 +156,7 @@ export default class DocumentSyncManager {
|
|
|
171
156
|
screenName: cta,
|
|
172
157
|
cta: cta,
|
|
173
158
|
extraParams: {
|
|
174
|
-
msg:'sync already in progress or max count reached'
|
|
159
|
+
msg: 'sync already in progress or max count reached'
|
|
175
160
|
},
|
|
176
161
|
});
|
|
177
162
|
Logger.getInstance().logEvent(
|
|
@@ -221,7 +206,7 @@ export default class DocumentSyncManager {
|
|
|
221
206
|
if (!this.docManager) {
|
|
222
207
|
this.docManager = await DocumentManager.getInstance();
|
|
223
208
|
}
|
|
224
|
-
console.log('insertDocument1:',fmsFolderID);
|
|
209
|
+
console.log('insertDocument1:', fmsFolderID);
|
|
225
210
|
let insertResponse = await this.docManager?.insertDocument(
|
|
226
211
|
fmsFolderID,
|
|
227
212
|
desc,
|
|
@@ -244,7 +229,7 @@ export default class DocumentSyncManager {
|
|
|
244
229
|
screenName: cta,
|
|
245
230
|
cta: cta,
|
|
246
231
|
extraParams: {
|
|
247
|
-
msg:'INIT DOC SYNC AGAIN'
|
|
232
|
+
msg: 'INIT DOC SYNC AGAIN'
|
|
248
233
|
},
|
|
249
234
|
});
|
|
250
235
|
Logger.getInstance().logEvent(
|
|
@@ -309,7 +294,7 @@ export default class DocumentSyncManager {
|
|
|
309
294
|
screenName: cta,
|
|
310
295
|
cta: cta,
|
|
311
296
|
extraParams: {
|
|
312
|
-
msg:flattenObject(extraParameters)
|
|
297
|
+
msg: flattenObject(extraParameters)
|
|
313
298
|
},
|
|
314
299
|
});
|
|
315
300
|
Logger.getInstance().logEvent(
|
|
@@ -319,7 +304,7 @@ export default class DocumentSyncManager {
|
|
|
319
304
|
);
|
|
320
305
|
// Calling update method for attempt count and sync to update event row of type POD_DOC
|
|
321
306
|
await eventsManager.markPODDocEventSynced(sync, attempt, podId);
|
|
322
|
-
if(sync == 1){
|
|
307
|
+
if (sync == 1) {
|
|
323
308
|
const lastSyncedEventId = await Storage.getInstance().getSharedItem(
|
|
324
309
|
LAST_SYNCED_EVENT_ID
|
|
325
310
|
);
|
|
@@ -338,7 +323,7 @@ export default class DocumentSyncManager {
|
|
|
338
323
|
screenName: cta,
|
|
339
324
|
cta: cta,
|
|
340
325
|
extraParams: {
|
|
341
|
-
msg:flattenObject(err)
|
|
326
|
+
msg: flattenObject(err)
|
|
342
327
|
},
|
|
343
328
|
});
|
|
344
329
|
Logger.getInstance().logEvent(
|
|
@@ -349,7 +334,7 @@ export default class DocumentSyncManager {
|
|
|
349
334
|
}
|
|
350
335
|
}
|
|
351
336
|
|
|
352
|
-
|
|
337
|
+
// This function is updating processed_file_path column for the base64 overlayed data and overlayed image file for POD. Also if it is base 64 then it is also storing temprary file path in file_path as original bae64 image.
|
|
353
338
|
private async updateDocumentProcessedPath(
|
|
354
339
|
documentRow: DocumentRow,
|
|
355
340
|
origialFilePath: String,
|
|
@@ -370,7 +355,7 @@ export default class DocumentSyncManager {
|
|
|
370
355
|
screenName: cta,
|
|
371
356
|
cta: cta,
|
|
372
357
|
extraParams: {
|
|
373
|
-
msg:flattenObject(err)
|
|
358
|
+
msg: flattenObject(err)
|
|
374
359
|
},
|
|
375
360
|
});
|
|
376
361
|
Logger.getInstance().logEvent(
|
|
@@ -393,7 +378,7 @@ export default class DocumentSyncManager {
|
|
|
393
378
|
screenName: cta,
|
|
394
379
|
cta: cta,
|
|
395
380
|
extraParams: {
|
|
396
|
-
msg:flattenObject(err)
|
|
381
|
+
msg: flattenObject(err)
|
|
397
382
|
},
|
|
398
383
|
});
|
|
399
384
|
Logger.getInstance().logEvent(
|
|
@@ -422,9 +407,9 @@ export default class DocumentSyncManager {
|
|
|
422
407
|
let cta = 'processImageData-started';
|
|
423
408
|
let extra = {
|
|
424
409
|
msg: 'processImageData-started',
|
|
425
|
-
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4): '',
|
|
426
|
-
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4): '',
|
|
427
|
-
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9): ''
|
|
410
|
+
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
411
|
+
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|
|
412
|
+
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
|
|
428
413
|
};
|
|
429
414
|
fireEventWithScreenName({
|
|
430
415
|
severityLevel: SeverityLevelValue.LOG,
|
|
@@ -446,7 +431,7 @@ export default class DocumentSyncManager {
|
|
|
446
431
|
let lng = objGeoStamp.lng; // Longitude
|
|
447
432
|
let accuracy = objGeoStamp.accuracy; // Location accuracy
|
|
448
433
|
let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format
|
|
449
|
-
let strDMSWithAccuracy = strDMS;
|
|
434
|
+
let strDMSWithAccuracy = strDMS;
|
|
450
435
|
if (accuracy !== '') {
|
|
451
436
|
strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
|
|
452
437
|
}
|
|
@@ -459,7 +444,7 @@ export default class DocumentSyncManager {
|
|
|
459
444
|
src: documentRow.file_path,
|
|
460
445
|
scale: 1,
|
|
461
446
|
},
|
|
462
|
-
watermarkTexts: [
|
|
447
|
+
watermarkTexts: [
|
|
463
448
|
{
|
|
464
449
|
text: `${dateTime}\n${strDMSWithAccuracy}`, //Overlay text
|
|
465
450
|
position: {
|
|
@@ -478,7 +463,7 @@ export default class DocumentSyncManager {
|
|
|
478
463
|
},
|
|
479
464
|
],
|
|
480
465
|
scale: 0,
|
|
481
|
-
quality: 100,
|
|
466
|
+
quality: 100,
|
|
482
467
|
filename: pFilePath,
|
|
483
468
|
saveFormat: ImageFormat.jpg, // Saving in jpeg format
|
|
484
469
|
};
|
|
@@ -495,15 +480,15 @@ export default class DocumentSyncManager {
|
|
|
495
480
|
documentRow.file_path, //original file path catprued from camera
|
|
496
481
|
completeFilePath // completeFilePath is the path with file:// of processed file
|
|
497
482
|
);
|
|
498
|
-
documentRow.processed_file_path = completeFilePath;
|
|
483
|
+
documentRow.processed_file_path = completeFilePath;
|
|
499
484
|
}
|
|
500
485
|
}
|
|
501
486
|
let cta = 'processImageData-completed';
|
|
502
487
|
let extra = {
|
|
503
488
|
msg: 'processImageData-completed',
|
|
504
|
-
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4): '',
|
|
505
|
-
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4): '',
|
|
506
|
-
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9): ''
|
|
489
|
+
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
490
|
+
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|
|
491
|
+
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
|
|
507
492
|
};
|
|
508
493
|
fireEventWithScreenName({
|
|
509
494
|
severityLevel: SeverityLevelValue.LOG,
|
|
@@ -522,7 +507,6 @@ export default class DocumentSyncManager {
|
|
|
522
507
|
|
|
523
508
|
// This function will generate overlay base64 data and update documents table for processed_file_path columns with overlayed base64 data.
|
|
524
509
|
private async processBase64Data(documentRow: DocumentRow) {
|
|
525
|
-
// If base64 overlayed data already existing then do not generate it again.
|
|
526
510
|
if (
|
|
527
511
|
documentRow.processed_file_path === null ||
|
|
528
512
|
documentRow.processed_file_path === ''
|
|
@@ -530,9 +514,9 @@ export default class DocumentSyncManager {
|
|
|
530
514
|
let cta = 'processBase64Data-started';
|
|
531
515
|
let extra = {
|
|
532
516
|
msg: 'processBase64Data-started',
|
|
533
|
-
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4): '',
|
|
534
|
-
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4): '',
|
|
535
|
-
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9): ''
|
|
517
|
+
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
518
|
+
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|
|
519
|
+
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
|
|
536
520
|
};
|
|
537
521
|
fireEventWithScreenName({
|
|
538
522
|
severityLevel: SeverityLevelValue.LOG,
|
|
@@ -568,7 +552,7 @@ export default class DocumentSyncManager {
|
|
|
568
552
|
let lng = objGeoStamp.lng; // Longitude
|
|
569
553
|
let accuracy = objGeoStamp.accuracy; // Location accuracy
|
|
570
554
|
let strDMS = latlngToDms(`${lat}, ${lng}`); // Location in degree format
|
|
571
|
-
let strDMSWithAccuracy = strDMS;
|
|
555
|
+
let strDMSWithAccuracy = strDMS;
|
|
572
556
|
if (accuracy !== '') {
|
|
573
557
|
strDMSWithAccuracy = strDMS + ' (Accuracy: ' + accuracy + 'm)'; // Appedning accuracy in location
|
|
574
558
|
}
|
|
@@ -618,9 +602,9 @@ export default class DocumentSyncManager {
|
|
|
618
602
|
let cta = 'processBase64Data-completed';
|
|
619
603
|
let extra = {
|
|
620
604
|
msg: 'processBase64Data-completed',
|
|
621
|
-
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4): '',
|
|
622
|
-
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4): '',
|
|
623
|
-
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9): ''
|
|
605
|
+
fName: documentRow.file_name && documentRow.file_name.length != 0 ? documentRow.file_name.substring(4) : '',
|
|
606
|
+
dName: documentRow.fms_folder_id && documentRow.fms_folder_id.length != 0 ? documentRow.fms_folder_id.substring(4) : '',
|
|
607
|
+
dispId: documentRow.dispatch_id && documentRow.dispatch_id.length != 0 ? documentRow.dispatch_id.substring(9) : ''
|
|
624
608
|
};
|
|
625
609
|
fireEventWithScreenName({
|
|
626
610
|
severityLevel: SeverityLevelValue.LOG,
|
|
@@ -651,15 +635,15 @@ export default class DocumentSyncManager {
|
|
|
651
635
|
let docRow = documentRow;
|
|
652
636
|
let cta = 'uploadDocToServer-geoStamp';
|
|
653
637
|
let geoStampAvailable = false
|
|
654
|
-
if(documentRow.geo_timestamp && documentRow.geo_timestamp.length != 0){
|
|
638
|
+
if (documentRow.geo_timestamp && documentRow.geo_timestamp.length != 0) {
|
|
655
639
|
geoStampAvailable = true;
|
|
656
640
|
docRow = await this.processPODData(documentRow);
|
|
657
641
|
}
|
|
658
642
|
let extra = {
|
|
659
643
|
msg: geoStampAvailable ? "geoStamp availale" : 'geoStamp not availale',
|
|
660
|
-
fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4): '',
|
|
661
|
-
dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4): '',
|
|
662
|
-
dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9): ''
|
|
644
|
+
fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4) : '',
|
|
645
|
+
dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4) : '',
|
|
646
|
+
dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9) : ''
|
|
663
647
|
};
|
|
664
648
|
fireEventWithScreenName({
|
|
665
649
|
severityLevel: SeverityLevelValue.LOG,
|
|
@@ -673,18 +657,17 @@ export default class DocumentSyncManager {
|
|
|
673
657
|
flattenObject(extra),
|
|
674
658
|
LOG_TYPE.SDK_ERROR
|
|
675
659
|
);
|
|
676
|
-
console.log('uploadDocToServer999:', docRow);
|
|
677
660
|
let fmsID = await this.documentHttpClient?.uploadDocument(docRow);
|
|
678
661
|
|
|
679
662
|
let extraParameters = {
|
|
680
663
|
fmsID: fmsID ?? '',
|
|
681
|
-
fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4): '',
|
|
682
|
-
dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4): '',
|
|
683
|
-
dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9): ''
|
|
664
|
+
fName: docRow.file_name && docRow.file_name.length != 0 ? docRow.file_name.substring(4) : '',
|
|
665
|
+
dName: docRow.fms_folder_id && docRow.fms_folder_id.length != 0 ? docRow.fms_folder_id.substring(4) : '',
|
|
666
|
+
dispId: docRow.dispatch_id && docRow.dispatch_id.length != 0 ? docRow.dispatch_id.substring(9) : ''
|
|
684
667
|
};
|
|
685
668
|
// TODO: SOLELY DEPENDS ON FMS_ID WHICH IS WRONG => IT SHOULD BE Response.status = 202
|
|
686
669
|
if (fmsID) {
|
|
687
|
-
|
|
670
|
+
// Calling function updating document row along with attempt count and sync as true.
|
|
688
671
|
await this.updateDocumentWithAttempt(
|
|
689
672
|
documentRow,
|
|
690
673
|
fmsID,
|
|
@@ -692,7 +675,7 @@ export default class DocumentSyncManager {
|
|
|
692
675
|
1
|
|
693
676
|
);
|
|
694
677
|
this._retries = 0;
|
|
695
|
-
|
|
678
|
+
// await this.updateDocument(docRow, fmsID);
|
|
696
679
|
} else {
|
|
697
680
|
// Calling function updating document row withalong attempt count and sync as false.
|
|
698
681
|
await this.updateDocumentWithAttempt(
|
|
@@ -719,8 +702,8 @@ export default class DocumentSyncManager {
|
|
|
719
702
|
await this.updateDocError(docRow, 'Unexpected Error');
|
|
720
703
|
}
|
|
721
704
|
} catch (error: any) {
|
|
722
|
-
|
|
723
|
-
|
|
705
|
+
// Calling function updating document row withalong attempt count and sync as false.
|
|
706
|
+
await this.updateDocumentWithAttempt(
|
|
724
707
|
documentRow,
|
|
725
708
|
'',
|
|
726
709
|
this._retries + 1,
|
|
@@ -754,8 +737,8 @@ export default class DocumentSyncManager {
|
|
|
754
737
|
}
|
|
755
738
|
}
|
|
756
739
|
|
|
757
|
-
private async startSyncAfterMaxRetry(extraParameters:any, error:any){
|
|
758
|
-
if(this.retries >= this.maxRetryCount){
|
|
740
|
+
private async startSyncAfterMaxRetry(extraParameters: any, error: any) {
|
|
741
|
+
if (this.retries >= this.maxRetryCount) {
|
|
759
742
|
let cta = 'startSyncAfterMaxRetry-max-retry-reached'
|
|
760
743
|
fireEventWithScreenName({
|
|
761
744
|
severityLevel: SeverityLevelValue.LOG,
|
|
@@ -773,7 +756,7 @@ export default class DocumentSyncManager {
|
|
|
773
756
|
this.docManager = await DocumentManager.getInstance();
|
|
774
757
|
}
|
|
775
758
|
let documentRows: DocumentRow[] =
|
|
776
|
-
|
|
759
|
+
await this.docManager.getUnsyncedDocument();
|
|
777
760
|
if (documentRows?.length > 0) {
|
|
778
761
|
await this.docManager.updateDocPriority(documentRows[0].id, documentRows[0].priority + 1);
|
|
779
762
|
this._retries = 0;
|
|
@@ -10,15 +10,11 @@ import CancelOrderDialog from '../../components/widgets/CancelOrderDialog';
|
|
|
10
10
|
import { onTaskStart } from '../../utils/ExecTaskUtils';
|
|
11
11
|
import { DispatchExecutor } from '@os1-platform/platform-coreos-execution-engine-sdk';
|
|
12
12
|
import Storage from '../../utils/storage';
|
|
13
|
-
import {
|
|
14
|
-
SCAN_MERGED_OBJ_ID_OUTPUT,
|
|
15
|
-
SHARED_PREFERENCE_SCAN_OUTPUT,
|
|
16
|
-
} from '../../manager/syncmanager/constants';
|
|
17
13
|
import { GO_BACK_EVENT_CODE } from '../../constants/constants';
|
|
18
14
|
import Helper from '../../utils/helper';
|
|
19
15
|
import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../analytics/sentry/SentrySdkConstants';
|
|
20
16
|
import { fireEventWithScreenName } from '../../analytics/sentry/SentryAnalyticsUtils';
|
|
21
|
-
import
|
|
17
|
+
import { PROGRESS_GROUP } from '../../utils/Constants';
|
|
22
18
|
|
|
23
19
|
const DeliverScreen = ({
|
|
24
20
|
navigation,
|
|
@@ -69,8 +65,14 @@ const DeliverScreen = ({
|
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
const getMergedReturnPackageCount = async () => {
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
let progressGroup = null;
|
|
69
|
+
try {
|
|
70
|
+
progressGroup = await Storage.getInstance().getSharedItem(PROGRESS_GROUP, false);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
progressGroup = null;
|
|
73
|
+
}
|
|
74
|
+
const count = await DispatchExecutor.getShipmentsCountForDeliverET(
|
|
75
|
+
mergedObjectiveId, progressGroup
|
|
74
76
|
);
|
|
75
77
|
setReturnPackageCount(count.totalCount);
|
|
76
78
|
setShipCount(count.shipCount);
|
|
@@ -16,7 +16,8 @@ import { AjvError } from '@rjsf/core';
|
|
|
16
16
|
import Helper from '../../utils/helper';
|
|
17
17
|
import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../analytics/sentry/SentrySdkConstants';
|
|
18
18
|
import { fireEventWithScreenName } from '../../analytics/sentry/SentryAnalyticsUtils';
|
|
19
|
-
import
|
|
19
|
+
import { PROGRESS_GROUP } from '../../utils/Constants';
|
|
20
|
+
import Storage from '../../utils/storage';
|
|
20
21
|
|
|
21
22
|
const FormsScreen = ({
|
|
22
23
|
route,
|
|
@@ -48,12 +49,18 @@ const FormsScreen = ({
|
|
|
48
49
|
);
|
|
49
50
|
|
|
50
51
|
if (route.params[RouteParams.ROOT_META_DATA]) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
//Call objectiveDetails fn and fetch sds ids
|
|
53
|
+
let progressGroup = null;
|
|
54
|
+
try {
|
|
55
|
+
progressGroup = await Storage.getInstance().getSharedItem(PROGRESS_GROUP, false);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
progressGroup = null;
|
|
58
|
+
}
|
|
59
|
+
const { contact } = await dispatchExecutor.getObjectiveTaskDetails(
|
|
60
|
+
mergedObjectiveId[0],
|
|
61
|
+
progressGroup,
|
|
62
|
+
route.params[RouteParams.ROOT_META_DATA].statusFilter
|
|
63
|
+
);
|
|
57
64
|
|
|
58
65
|
// run callback to get corresponding phone numbers
|
|
59
66
|
const phoneNumbers = await callbackHandler.getPhoneNumbers(contact);
|
|
@@ -33,7 +33,7 @@ const ImageCaptureScreen = ({
|
|
|
33
33
|
useEffect(() => {
|
|
34
34
|
(async () => {
|
|
35
35
|
//fire sentry event
|
|
36
|
-
fireEventWithScreenName({severityLevel:SeverityLevelValue.LOG, eventName:SentryEventNameSdkConstants.CAPTURE_IMAGE_ET_OPENED, screenName:ScreenNameSdkConstants.CAPTURE_IMAGE_ET_SCREEN});
|
|
36
|
+
fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.CAPTURE_IMAGE_ET_OPENED, screenName: ScreenNameSdkConstants.CAPTURE_IMAGE_ET_SCREEN });
|
|
37
37
|
//
|
|
38
38
|
onTaskStart(
|
|
39
39
|
route.params[RouteParams.NEXT_STATES],
|
package/src/utils/storage.ts
CHANGED
|
@@ -203,13 +203,13 @@ class Storage {
|
|
|
203
203
|
/**
|
|
204
204
|
* Shared preferences
|
|
205
205
|
*/
|
|
206
|
-
async setSharedItem(key: string, value: string, prefix:boolean = true): Promise<void> {
|
|
206
|
+
async setSharedItem(key: string, value: string, prefix: boolean = true): Promise<void> {
|
|
207
207
|
if (Platform.OS === 'android') {
|
|
208
208
|
await SharedPreferencesModule.setItem(key, value);
|
|
209
209
|
} else {
|
|
210
|
-
if(prefix){
|
|
210
|
+
if (prefix) {
|
|
211
211
|
await this.setItem(key, value);
|
|
212
|
-
}else{
|
|
212
|
+
} else {
|
|
213
213
|
await AsyncStorage.setItem(key, value);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -225,14 +225,14 @@ class Storage {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
async getSharedItem(key: string, prefix:boolean = true): Promise<any> {
|
|
228
|
+
async getSharedItem(key: string, prefix: boolean = true): Promise<any> {
|
|
229
229
|
if (Platform.OS === 'android') {
|
|
230
230
|
return await SharedPreferencesModule.getItem(key);
|
|
231
231
|
} else {
|
|
232
|
-
if(prefix){
|
|
232
|
+
if (prefix) {
|
|
233
233
|
let item = await this.getItem(key);
|
|
234
234
|
return item;
|
|
235
|
-
}else{
|
|
235
|
+
} else {
|
|
236
236
|
let item = await AsyncStorage.getItem(key);
|
|
237
237
|
return item;
|
|
238
238
|
}
|
|
@@ -280,13 +280,13 @@ class Storage {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
async removeSharedItem(key: string, prefix:boolean = true): Promise<void> {
|
|
283
|
+
async removeSharedItem(key: string, prefix: boolean = true): Promise<void> {
|
|
284
284
|
if (Platform.OS === 'android') {
|
|
285
285
|
await SharedPreferencesModule.removeItem(key);
|
|
286
286
|
} else {
|
|
287
|
-
if(prefix){
|
|
287
|
+
if (prefix) {
|
|
288
288
|
await this.deleteItem(key);
|
|
289
|
-
}else{
|
|
289
|
+
} else {
|
|
290
290
|
await AsyncStorage.removeItem(key);
|
|
291
291
|
}
|
|
292
292
|
}
|