@monkvision/inspection-capture-web 5.0.7 → 5.0.9
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/hooks/useTracking.js +0 -1
- package/lib/hooks/useUploadQueue.js +12 -7
- package/package.json +15 -15
package/lib/hooks/useTracking.js
CHANGED
|
@@ -48,11 +48,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
exports.useUploadQueue = void 0;
|
|
49
49
|
var common_1 = require("@monkvision/common");
|
|
50
50
|
var network_1 = require("@monkvision/network");
|
|
51
|
+
var types_1 = require("@monkvision/types");
|
|
51
52
|
var react_1 = require("react");
|
|
52
53
|
var monitoring_1 = require("@monkvision/monitoring");
|
|
53
|
-
var
|
|
54
|
-
function createAddImageOptions(upload, inspectionId, siblingId, enableThumbnail, additionalTasks, compliance) {
|
|
55
|
-
if (upload.mode ===
|
|
54
|
+
var types_2 = require("../types");
|
|
55
|
+
function createAddImageOptions(upload, inspectionId, siblingId, enableThumbnail, additionalTasks, compliance, wheelAnalysisCloseUp) {
|
|
56
|
+
if (upload.mode === types_2.CaptureMode.SIGHT) {
|
|
56
57
|
return {
|
|
57
58
|
uploadType: network_1.ImageUploadType.BEAUTY_SHOT,
|
|
58
59
|
picture: upload.picture,
|
|
@@ -61,9 +62,10 @@ function createAddImageOptions(upload, inspectionId, siblingId, enableThumbnail,
|
|
|
61
62
|
inspectionId: inspectionId,
|
|
62
63
|
compliance: compliance,
|
|
63
64
|
useThumbnailCaching: enableThumbnail,
|
|
65
|
+
wheelAnalysisCloseUp: wheelAnalysisCloseUp,
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
|
-
if (upload.mode ===
|
|
68
|
+
if (upload.mode === types_2.CaptureMode.ADD_DAMAGE_PART_SELECT_SHOT) {
|
|
67
69
|
return {
|
|
68
70
|
uploadType: network_1.ImageUploadType.PART_SELECT_SHOT,
|
|
69
71
|
picture: upload.picture,
|
|
@@ -77,7 +79,7 @@ function createAddImageOptions(upload, inspectionId, siblingId, enableThumbnail,
|
|
|
77
79
|
uploadType: network_1.ImageUploadType.CLOSE_UP_2_SHOT,
|
|
78
80
|
picture: upload.picture,
|
|
79
81
|
siblingKey: "closeup-sibling-key-".concat(siblingId),
|
|
80
|
-
firstShot: upload.mode ===
|
|
82
|
+
firstShot: upload.mode === types_2.CaptureMode.ADD_DAMAGE_1ST_SHOT,
|
|
81
83
|
inspectionId: inspectionId,
|
|
82
84
|
compliance: compliance,
|
|
83
85
|
useThumbnailCaching: enableThumbnail,
|
|
@@ -88,23 +90,26 @@ function createAddImageOptions(upload, inspectionId, siblingId, enableThumbnail,
|
|
|
88
90
|
*/
|
|
89
91
|
function useUploadQueue(_a) {
|
|
90
92
|
var _this = this;
|
|
93
|
+
var _b;
|
|
91
94
|
var inspectionId = _a.inspectionId, apiConfig = _a.apiConfig, additionalTasks = _a.additionalTasks, complianceOptions = _a.complianceOptions, eventHandlers = _a.eventHandlers;
|
|
92
95
|
var handleError = (0, monitoring_1.useMonitoring)().handleError;
|
|
93
96
|
var siblingIdRef = (0, react_1.useRef)(0);
|
|
94
97
|
var addImage = (0, network_1.useMonkApi)(apiConfig).addImage;
|
|
98
|
+
var state = (0, common_1.useMonkState)().state;
|
|
99
|
+
var wheelAnalysisCloseUp = (_b = state.tasks.find(function (task) { return task.name === types_1.TaskName.WHEEL_ANALYSIS && task.wheelAnalysisCloseUp; })) === null || _b === void 0 ? void 0 : _b.wheelAnalysisCloseUp;
|
|
95
100
|
return (0, common_1.useQueue)(function (upload) { return __awaiter(_this, void 0, void 0, function () {
|
|
96
101
|
var startTs, uploadDurationMs_1, err_1;
|
|
97
102
|
return __generator(this, function (_a) {
|
|
98
103
|
switch (_a.label) {
|
|
99
104
|
case 0:
|
|
100
|
-
if (upload.mode ===
|
|
105
|
+
if (upload.mode === types_2.CaptureMode.ADD_DAMAGE_1ST_SHOT) {
|
|
101
106
|
siblingIdRef.current += 1;
|
|
102
107
|
}
|
|
103
108
|
_a.label = 1;
|
|
104
109
|
case 1:
|
|
105
110
|
_a.trys.push([1, 3, , 4]);
|
|
106
111
|
startTs = Date.now();
|
|
107
|
-
return [4 /*yield*/, addImage(createAddImageOptions(upload, inspectionId, siblingIdRef.current, true, additionalTasks, complianceOptions))];
|
|
112
|
+
return [4 /*yield*/, addImage(createAddImageOptions(upload, inspectionId, siblingIdRef.current, true, additionalTasks, complianceOptions, wheelAnalysisCloseUp))];
|
|
108
113
|
case 2:
|
|
109
114
|
_a.sent();
|
|
110
115
|
uploadDurationMs_1 = Date.now() - startTs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monkvision/inspection-capture-web",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.9",
|
|
4
4
|
"license": "BSD-3-Clause-Clear",
|
|
5
5
|
"packageManager": "yarn@3.2.4",
|
|
6
6
|
"description": "MonkJs inspection capture package for React (web) used to implement the Monk inspection capture workflow",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"lint:fix": "yarn run prettier:fix && yarn run eslint:fix"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@monkvision/analytics": "5.0.
|
|
32
|
-
"@monkvision/camera-web": "5.0.
|
|
33
|
-
"@monkvision/common": "5.0.
|
|
34
|
-
"@monkvision/common-ui-web": "5.0.
|
|
35
|
-
"@monkvision/network": "5.0.
|
|
36
|
-
"@monkvision/sights": "5.0.
|
|
31
|
+
"@monkvision/analytics": "5.0.9",
|
|
32
|
+
"@monkvision/camera-web": "5.0.9",
|
|
33
|
+
"@monkvision/common": "5.0.9",
|
|
34
|
+
"@monkvision/common-ui-web": "5.0.9",
|
|
35
|
+
"@monkvision/network": "5.0.9",
|
|
36
|
+
"@monkvision/sights": "5.0.9",
|
|
37
37
|
"i18next": "^23.4.5",
|
|
38
38
|
"react-i18next": "^13.2.0"
|
|
39
39
|
},
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"react-router-dom": "^6.22.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@monkvision/eslint-config-base": "5.0.
|
|
48
|
-
"@monkvision/eslint-config-typescript": "5.0.
|
|
49
|
-
"@monkvision/eslint-config-typescript-react": "5.0.
|
|
50
|
-
"@monkvision/jest-config": "5.0.
|
|
51
|
-
"@monkvision/prettier-config": "5.0.
|
|
52
|
-
"@monkvision/test-utils": "5.0.
|
|
53
|
-
"@monkvision/typescript-config": "5.0.
|
|
47
|
+
"@monkvision/eslint-config-base": "5.0.9",
|
|
48
|
+
"@monkvision/eslint-config-typescript": "5.0.9",
|
|
49
|
+
"@monkvision/eslint-config-typescript-react": "5.0.9",
|
|
50
|
+
"@monkvision/jest-config": "5.0.9",
|
|
51
|
+
"@monkvision/prettier-config": "5.0.9",
|
|
52
|
+
"@monkvision/test-utils": "5.0.9",
|
|
53
|
+
"@monkvision/typescript-config": "5.0.9",
|
|
54
54
|
"@testing-library/react": "^12.1.5",
|
|
55
55
|
"@testing-library/react-hooks": "^8.0.1",
|
|
56
56
|
"@types/copyfiles": "^2",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"url": "https://github.com/monkvision/monkjs/issues"
|
|
94
94
|
},
|
|
95
95
|
"homepage": "https://github.com/monkvision/monkjs",
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "0a5c205106b6224ad0f7a7e9f16204dd36e485ef"
|
|
97
97
|
}
|