@djb25/digit-ui-module-vendor 1.0.59 → 1.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +291 -122
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +291 -122
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -202,6 +202,7 @@ const AddSurveyor = _ref => {
|
|
|
202
202
|
surveyor: {
|
|
203
203
|
tenantId: tenantId,
|
|
204
204
|
description: (data === null || data === void 0 ? void 0 : data.description) || "",
|
|
205
|
+
correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress,
|
|
205
206
|
additionalDetails: {
|
|
206
207
|
serviceType: "ekyc"
|
|
207
208
|
},
|
|
@@ -213,8 +214,7 @@ const AddSurveyor = _ref => {
|
|
|
213
214
|
gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || "OTHERS",
|
|
214
215
|
dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : null,
|
|
215
216
|
emailId: data === null || data === void 0 ? void 0 : data.emailId,
|
|
216
|
-
mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber
|
|
217
|
-
correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress
|
|
217
|
+
mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
};
|
|
@@ -227,7 +227,7 @@ const AddSurveyor = _ref => {
|
|
|
227
227
|
showSuccessToast: true,
|
|
228
228
|
message: {
|
|
229
229
|
key: "success",
|
|
230
|
-
action: "ES_VENDOR_ADD_SURVEYOR_SUCCESS"
|
|
230
|
+
action: t("ES_VENDOR_ADD_SURVEYOR_SUCCESS")
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
});
|
|
@@ -635,7 +635,7 @@ const DropdownStatus = _ref => {
|
|
|
635
635
|
};
|
|
636
636
|
|
|
637
637
|
const RegisteredVendorSearch = _ref => {
|
|
638
|
-
var _matchedRoles$wt, _matchedRoles$wt2, _matchedRoles$ekyc, _matchedRoles$ekyc2, _matchedRoles$wt3, _matchedRoles$ekyc3, _matchedRoles$wt4, _matchedRoles$wt5, _matchedRoles$ekyc4, _matchedRoles$ekyc5, _matchedRoles$ekyc6;
|
|
638
|
+
var _matchedRoles$wt, _matchedRoles$wt2, _matchedRoles$ekyc, _matchedRoles$ekyc2, _matchedRoles$wt3, _matchedRoles$ekyc3, _matchedRoles$wt4, _matchedRoles$wt5, _matchedRoles$ekyc4, _matchedRoles$ekyc5, _matchedRoles$ekyc6, _matchedRoles$ekyc7, _matchedRoles$ekyc8;
|
|
639
639
|
let onSearch = _ref.onSearch,
|
|
640
640
|
type = _ref.type,
|
|
641
641
|
onClose = _ref.onClose,
|
|
@@ -799,13 +799,13 @@ const RegisteredVendorSearch = _ref => {
|
|
|
799
799
|
clearSearch();
|
|
800
800
|
onTabChange("DRIVER");
|
|
801
801
|
}
|
|
802
|
-
}, t("ES_FSM_REGISTRY_INBOX_TAB_DRIVER")), (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc4 = matchedRoles.ekyc) === null || _matchedRoles$ekyc4 === void 0 ? void 0 : _matchedRoles$ekyc4.includes("EKYC_VENDOR")) && /*#__PURE__*/React__default.createElement("button", {
|
|
802
|
+
}, t("ES_FSM_REGISTRY_INBOX_TAB_DRIVER")), ((matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc4 = matchedRoles.ekyc) === null || _matchedRoles$ekyc4 === void 0 ? void 0 : _matchedRoles$ekyc4.includes("EKYC_VENDOR")) || (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc5 = matchedRoles.ekyc) === null || _matchedRoles$ekyc5 === void 0 ? void 0 : _matchedRoles$ekyc5.includes("EMPLOYEE"))) && /*#__PURE__*/React__default.createElement("button", {
|
|
803
803
|
className: selectedTab === "SUPERVISOR" ? "search-tab-head-selected" : "search-tab-head",
|
|
804
804
|
onClick: () => {
|
|
805
805
|
clearSearch();
|
|
806
806
|
onTabChange("SUPERVISOR");
|
|
807
807
|
}
|
|
808
|
-
}, t("ES_FSM_REGISTRY_INBOX_TAB_SUPERVISOR")), ((matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$
|
|
808
|
+
}, t("ES_FSM_REGISTRY_INBOX_TAB_SUPERVISOR")), ((matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc6 = matchedRoles.ekyc) === null || _matchedRoles$ekyc6 === void 0 ? void 0 : _matchedRoles$ekyc6.includes("EKYC_SUPERVISOR")) || (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc7 = matchedRoles.ekyc) === null || _matchedRoles$ekyc7 === void 0 ? void 0 : _matchedRoles$ekyc7.includes("EKYC_VENDOR")) || (matchedRoles === null || matchedRoles === void 0 ? void 0 : (_matchedRoles$ekyc8 = matchedRoles.ekyc) === null || _matchedRoles$ekyc8 === void 0 ? void 0 : _matchedRoles$ekyc8.includes("EMPLOYEE"))) && /*#__PURE__*/React__default.createElement("button", {
|
|
809
809
|
className: selectedTab === "SURVEYOR" ? "search-tab-head-selected" : "search-tab-head",
|
|
810
810
|
onClick: () => {
|
|
811
811
|
clearSearch();
|
|
@@ -918,8 +918,8 @@ const getSelectedSupervisorOption = function (row, supervisorsList) {
|
|
|
918
918
|
const supervisorId = (_row27 = row) === null || _row27 === void 0 ? void 0 : _row27.supervisorId;
|
|
919
919
|
if (!supervisorId) return null;
|
|
920
920
|
return supervisorsList.find(s => {
|
|
921
|
-
var _s$owner;
|
|
922
|
-
return s.id === supervisorId || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid) === supervisorId;
|
|
921
|
+
var _s$owner, _s$owner2;
|
|
922
|
+
return s.id === supervisorId || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid) === supervisorId || s.name === supervisorId || ((_s$owner2 = s.owner) === null || _s$owner2 === void 0 ? void 0 : _s$owner2.name) === supervisorId;
|
|
923
923
|
}) || null;
|
|
924
924
|
};
|
|
925
925
|
const getVendorFillingPoints = function (vendor) {
|
|
@@ -1188,9 +1188,10 @@ const VendorInbox = props => {
|
|
|
1188
1188
|
const onVendorUpdate = row => {
|
|
1189
1189
|
var _formDetails$owner, _formDetails$owner2, _formDetails$owner3, _formDetails$owner4;
|
|
1190
1190
|
let formDetails = row.original.dsoDetails;
|
|
1191
|
+
const isDisable = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE";
|
|
1191
1192
|
const formData = {
|
|
1192
1193
|
vendor: _extends({}, formDetails, {
|
|
1193
|
-
status:
|
|
1194
|
+
status: isDisable ? "DISABLED" : "ACTIVE",
|
|
1194
1195
|
owner: _extends({}, formDetails.owner, {
|
|
1195
1196
|
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner = formDetails.owner) === null || _formDetails$owner === void 0 ? void 0 : _formDetails$owner.gender) || "OTHER",
|
|
1196
1197
|
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner2 = formDetails.owner) === null || _formDetails$owner2 === void 0 ? void 0 : _formDetails$owner2.dob) || new Date("1/1/1970").getTime(),
|
|
@@ -1203,48 +1204,72 @@ const VendorInbox = props => {
|
|
|
1203
1204
|
onError: (error, variables) => {
|
|
1204
1205
|
setShowToast({
|
|
1205
1206
|
key: "error",
|
|
1206
|
-
action: error
|
|
1207
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || "UPDATE_FAILED"
|
|
1207
1208
|
});
|
|
1208
1209
|
},
|
|
1209
1210
|
onSuccess: (data, variables) => {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1211
|
+
var _data$Errors, _data$data, _data$data$Errors;
|
|
1212
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors = data.Errors) === null || _data$Errors === void 0 ? void 0 : _data$Errors.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$Errors = _data$data.Errors) === null || _data$data$Errors === void 0 ? void 0 : _data$data$Errors.length) > 0;
|
|
1213
|
+
if (isError) {
|
|
1214
|
+
var _data$data2, _data$data2$Errors, _data$data2$Errors$, _data$Errors2, _data$Errors2$;
|
|
1215
|
+
setShowToast({
|
|
1216
|
+
key: "error",
|
|
1217
|
+
action: (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$Errors = _data$data2.Errors) === null || _data$data2$Errors === void 0 ? void 0 : (_data$data2$Errors$ = _data$data2$Errors[0]) === null || _data$data2$Errors$ === void 0 ? void 0 : _data$data2$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors2 = data.Errors) === null || _data$Errors2 === void 0 ? void 0 : (_data$Errors2$ = _data$Errors2[0]) === null || _data$Errors2$ === void 0 ? void 0 : _data$Errors2$.message) || (data === null || data === void 0 ? void 0 : data.message) || "UPDATE_FAILED"
|
|
1218
|
+
});
|
|
1219
|
+
} else {
|
|
1220
|
+
setShowToast({
|
|
1221
|
+
key: "success",
|
|
1222
|
+
action: "VENDOR",
|
|
1223
|
+
isDisable
|
|
1224
|
+
});
|
|
1225
|
+
queryClient.invalidateQueries("DSO_SEARCH");
|
|
1226
|
+
props.refetchData();
|
|
1227
|
+
}
|
|
1216
1228
|
}
|
|
1217
1229
|
});
|
|
1218
1230
|
};
|
|
1219
1231
|
const onVehicleUpdate = row => {
|
|
1220
1232
|
var _row$original;
|
|
1233
|
+
const isDisable = ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.status) === "ACTIVE";
|
|
1221
1234
|
const formData = getVehicleUpdatePayload(row.original, {
|
|
1222
|
-
status:
|
|
1235
|
+
status: isDisable ? "DISABLED" : "ACTIVE"
|
|
1223
1236
|
});
|
|
1224
1237
|
mutateVehicle(formData, {
|
|
1225
1238
|
onError: (error, variables) => {
|
|
1226
1239
|
setShowToast({
|
|
1227
1240
|
key: "error",
|
|
1228
|
-
action: error
|
|
1241
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || "UPDATE_FAILED"
|
|
1229
1242
|
});
|
|
1230
1243
|
},
|
|
1231
1244
|
onSuccess: (data, variables) => {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1245
|
+
var _data$Errors3, _data$data3, _data$data3$Errors;
|
|
1246
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors3 = data.Errors) === null || _data$Errors3 === void 0 ? void 0 : _data$Errors3.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$Errors = _data$data3.Errors) === null || _data$data3$Errors === void 0 ? void 0 : _data$data3$Errors.length) > 0;
|
|
1247
|
+
if (isError) {
|
|
1248
|
+
var _data$data4, _data$data4$Errors, _data$data4$Errors$, _data$Errors4, _data$Errors4$;
|
|
1249
|
+
setShowToast({
|
|
1250
|
+
key: "error",
|
|
1251
|
+
action: (data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$Errors = _data$data4.Errors) === null || _data$data4$Errors === void 0 ? void 0 : (_data$data4$Errors$ = _data$data4$Errors[0]) === null || _data$data4$Errors$ === void 0 ? void 0 : _data$data4$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors4 = data.Errors) === null || _data$Errors4 === void 0 ? void 0 : (_data$Errors4$ = _data$Errors4[0]) === null || _data$Errors4$ === void 0 ? void 0 : _data$Errors4$.message) || (data === null || data === void 0 ? void 0 : data.message) || "UPDATE_FAILED"
|
|
1252
|
+
});
|
|
1253
|
+
} else {
|
|
1254
|
+
setShowToast({
|
|
1255
|
+
key: "success",
|
|
1256
|
+
action: "VEHICLE",
|
|
1257
|
+
isDisable
|
|
1258
|
+
});
|
|
1259
|
+
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
1260
|
+
props.refetchVendor();
|
|
1261
|
+
props.refetchData();
|
|
1262
|
+
}
|
|
1239
1263
|
}
|
|
1240
1264
|
});
|
|
1241
1265
|
};
|
|
1242
1266
|
const onDriverUpdate = row => {
|
|
1243
1267
|
var _formDetails$owner5, _formDetails$owner6, _formDetails$owner7, _formDetails$owner8;
|
|
1244
1268
|
let formDetails = row.original;
|
|
1269
|
+
const isDisable = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE";
|
|
1245
1270
|
const formData = {
|
|
1246
1271
|
driver: _extends({}, formDetails, {
|
|
1247
|
-
status:
|
|
1272
|
+
status: isDisable ? "DISABLED" : "ACTIVE",
|
|
1248
1273
|
owner: _extends({}, formDetails.owner, {
|
|
1249
1274
|
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner5 = formDetails.owner) === null || _formDetails$owner5 === void 0 ? void 0 : _formDetails$owner5.gender) || "OTHER",
|
|
1250
1275
|
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner6 = formDetails.owner) === null || _formDetails$owner6 === void 0 ? void 0 : _formDetails$owner6.dob) || new Date("1/1/1970").getTime(),
|
|
@@ -1257,17 +1282,28 @@ const VendorInbox = props => {
|
|
|
1257
1282
|
onError: (error, variables) => {
|
|
1258
1283
|
setShowToast({
|
|
1259
1284
|
key: "error",
|
|
1260
|
-
action: error
|
|
1285
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || "UPDATE_FAILED"
|
|
1261
1286
|
});
|
|
1262
1287
|
},
|
|
1263
1288
|
onSuccess: (data, variables) => {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1289
|
+
var _data$Errors5, _data$data5, _data$data5$Errors;
|
|
1290
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors5 = data.Errors) === null || _data$Errors5 === void 0 ? void 0 : _data$Errors5.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : (_data$data5$Errors = _data$data5.Errors) === null || _data$data5$Errors === void 0 ? void 0 : _data$data5$Errors.length) > 0;
|
|
1291
|
+
if (isError) {
|
|
1292
|
+
var _data$data6, _data$data6$Errors, _data$data6$Errors$, _data$Errors6, _data$Errors6$;
|
|
1293
|
+
setShowToast({
|
|
1294
|
+
key: "error",
|
|
1295
|
+
action: (data === null || data === void 0 ? void 0 : (_data$data6 = data.data) === null || _data$data6 === void 0 ? void 0 : (_data$data6$Errors = _data$data6.Errors) === null || _data$data6$Errors === void 0 ? void 0 : (_data$data6$Errors$ = _data$data6$Errors[0]) === null || _data$data6$Errors$ === void 0 ? void 0 : _data$data6$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors6 = data.Errors) === null || _data$Errors6 === void 0 ? void 0 : (_data$Errors6$ = _data$Errors6[0]) === null || _data$Errors6$ === void 0 ? void 0 : _data$Errors6$.message) || (data === null || data === void 0 ? void 0 : data.message) || "UPDATE_FAILED"
|
|
1296
|
+
});
|
|
1297
|
+
} else {
|
|
1298
|
+
setShowToast({
|
|
1299
|
+
key: "success",
|
|
1300
|
+
action: "DRIVER",
|
|
1301
|
+
isDisable
|
|
1302
|
+
});
|
|
1303
|
+
queryClient.invalidateQueries("FSM_DRIVER_SEARCH");
|
|
1304
|
+
props.refetchVendor();
|
|
1305
|
+
props.refetchData();
|
|
1306
|
+
}
|
|
1271
1307
|
}
|
|
1272
1308
|
});
|
|
1273
1309
|
};
|
|
@@ -1336,10 +1372,20 @@ const VendorInbox = props => {
|
|
|
1336
1372
|
onError: error => {
|
|
1337
1373
|
setShowToast({
|
|
1338
1374
|
key: "error",
|
|
1339
|
-
action: error
|
|
1375
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || "UPDATE_FAILED"
|
|
1340
1376
|
});
|
|
1341
1377
|
},
|
|
1342
|
-
onSuccess:
|
|
1378
|
+
onSuccess: data => {
|
|
1379
|
+
var _data$Errors7, _data$data7, _data$data7$Errors;
|
|
1380
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors7 = data.Errors) === null || _data$Errors7 === void 0 ? void 0 : _data$Errors7.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data7 = data.data) === null || _data$data7 === void 0 ? void 0 : (_data$data7$Errors = _data$data7.Errors) === null || _data$data7$Errors === void 0 ? void 0 : _data$data7$Errors.length) > 0;
|
|
1381
|
+
if (isError) {
|
|
1382
|
+
var _data$data8, _data$data8$Errors, _data$data8$Errors$, _data$Errors8, _data$Errors8$;
|
|
1383
|
+
setShowToast({
|
|
1384
|
+
key: "error",
|
|
1385
|
+
action: (data === null || data === void 0 ? void 0 : (_data$data8 = data.data) === null || _data$data8 === void 0 ? void 0 : (_data$data8$Errors = _data$data8.Errors) === null || _data$data8$Errors === void 0 ? void 0 : (_data$data8$Errors$ = _data$data8$Errors[0]) === null || _data$data8$Errors$ === void 0 ? void 0 : _data$data8$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors8 = data.Errors) === null || _data$Errors8 === void 0 ? void 0 : (_data$Errors8$ = _data$Errors8[0]) === null || _data$Errors8$ === void 0 ? void 0 : _data$Errors8$.message) || (data === null || data === void 0 ? void 0 : data.message) || "UPDATE_FAILED"
|
|
1386
|
+
});
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1343
1389
|
updateVehicleRowState(currentVehicle === null || currentVehicle === void 0 ? void 0 : currentVehicle.id, {
|
|
1344
1390
|
vendor: updatedSelectedVendor,
|
|
1345
1391
|
fillingPoint: null,
|
|
@@ -1348,7 +1394,8 @@ const VendorInbox = props => {
|
|
|
1348
1394
|
});
|
|
1349
1395
|
setShowToast({
|
|
1350
1396
|
key: "success",
|
|
1351
|
-
action: "VEHICLE"
|
|
1397
|
+
action: "VEHICLE",
|
|
1398
|
+
isDisable: false
|
|
1352
1399
|
});
|
|
1353
1400
|
queryClient.invalidateQueries("DSO_SEARCH");
|
|
1354
1401
|
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
@@ -1365,10 +1412,22 @@ const VendorInbox = props => {
|
|
|
1365
1412
|
onError: error => {
|
|
1366
1413
|
setShowToast({
|
|
1367
1414
|
key: "error",
|
|
1368
|
-
action: error
|
|
1415
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || "UPDATE_FAILED"
|
|
1369
1416
|
});
|
|
1370
1417
|
},
|
|
1371
|
-
onSuccess:
|
|
1418
|
+
onSuccess: data => {
|
|
1419
|
+
var _data$Errors9, _data$data9, _data$data9$Errors;
|
|
1420
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors9 = data.Errors) === null || _data$Errors9 === void 0 ? void 0 : _data$Errors9.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data9 = data.data) === null || _data$data9 === void 0 ? void 0 : (_data$data9$Errors = _data$data9.Errors) === null || _data$data9$Errors === void 0 ? void 0 : _data$data9$Errors.length) > 0;
|
|
1421
|
+
if (isError) {
|
|
1422
|
+
var _data$data0, _data$data0$Errors, _data$data0$Errors$, _data$Errors0, _data$Errors0$;
|
|
1423
|
+
setShowToast({
|
|
1424
|
+
key: "error",
|
|
1425
|
+
action: (data === null || data === void 0 ? void 0 : (_data$data0 = data.data) === null || _data$data0 === void 0 ? void 0 : (_data$data0$Errors = _data$data0.Errors) === null || _data$data0$Errors === void 0 ? void 0 : (_data$data0$Errors$ = _data$data0$Errors[0]) === null || _data$data0$Errors$ === void 0 ? void 0 : _data$data0$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors0 = data.Errors) === null || _data$Errors0 === void 0 ? void 0 : (_data$Errors0$ = _data$Errors0[0]) === null || _data$Errors0$ === void 0 ? void 0 : _data$Errors0$.message) || (data === null || data === void 0 ? void 0 : data.message) || "UPDATE_FAILED"
|
|
1426
|
+
});
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
addVehicleToSelectedVendor();
|
|
1430
|
+
}
|
|
1372
1431
|
});
|
|
1373
1432
|
return;
|
|
1374
1433
|
}
|
|
@@ -1382,17 +1441,27 @@ const VendorInbox = props => {
|
|
|
1382
1441
|
onError: (error, variables) => {
|
|
1383
1442
|
setShowToast({
|
|
1384
1443
|
key: "error",
|
|
1385
|
-
action: error
|
|
1444
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || "UPDATE_FAILED"
|
|
1386
1445
|
});
|
|
1387
1446
|
},
|
|
1388
1447
|
onSuccess: (data, variables) => {
|
|
1389
|
-
var _row$original2;
|
|
1448
|
+
var _data$Errors1, _data$data1, _data$data1$Errors, _row$original2;
|
|
1449
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors1 = data.Errors) === null || _data$Errors1 === void 0 ? void 0 : _data$Errors1.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data1 = data.data) === null || _data$data1 === void 0 ? void 0 : (_data$data1$Errors = _data$data1.Errors) === null || _data$data1$Errors === void 0 ? void 0 : _data$data1$Errors.length) > 0;
|
|
1450
|
+
if (isError) {
|
|
1451
|
+
var _data$data10, _data$data10$Errors, _data$data10$Errors$, _data$Errors10, _data$Errors10$;
|
|
1452
|
+
setShowToast({
|
|
1453
|
+
key: "error",
|
|
1454
|
+
action: (data === null || data === void 0 ? void 0 : (_data$data10 = data.data) === null || _data$data10 === void 0 ? void 0 : (_data$data10$Errors = _data$data10.Errors) === null || _data$data10$Errors === void 0 ? void 0 : (_data$data10$Errors$ = _data$data10$Errors[0]) === null || _data$data10$Errors$ === void 0 ? void 0 : _data$data10$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors10 = data.Errors) === null || _data$Errors10 === void 0 ? void 0 : (_data$Errors10$ = _data$Errors10[0]) === null || _data$Errors10$ === void 0 ? void 0 : _data$Errors10$.message) || (data === null || data === void 0 ? void 0 : data.message) || "UPDATE_FAILED"
|
|
1455
|
+
});
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1390
1458
|
updateVehicleRowState((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.id, {
|
|
1391
1459
|
driverData: selectedOption
|
|
1392
1460
|
});
|
|
1393
1461
|
setShowToast({
|
|
1394
1462
|
key: "success",
|
|
1395
|
-
action: "VEHICLE"
|
|
1463
|
+
action: "VEHICLE",
|
|
1464
|
+
isDisable: false
|
|
1396
1465
|
});
|
|
1397
1466
|
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
1398
1467
|
queryClient.invalidateQueries("DSO_SEARCH");
|
|
@@ -1413,8 +1482,17 @@ const VendorInbox = props => {
|
|
|
1413
1482
|
label: (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || "Failed to map filling point"
|
|
1414
1483
|
});
|
|
1415
1484
|
},
|
|
1416
|
-
onSuccess:
|
|
1417
|
-
var _row$original3;
|
|
1485
|
+
onSuccess: data => {
|
|
1486
|
+
var _data$Errors11, _data$data11, _data$data11$Errors, _row$original3;
|
|
1487
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors11 = data.Errors) === null || _data$Errors11 === void 0 ? void 0 : _data$Errors11.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data11 = data.data) === null || _data$data11 === void 0 ? void 0 : (_data$data11$Errors = _data$data11.Errors) === null || _data$data11$Errors === void 0 ? void 0 : _data$data11$Errors.length) > 0;
|
|
1488
|
+
if (isError) {
|
|
1489
|
+
var _data$data12, _data$data12$Errors, _data$data12$Errors$, _data$Errors12, _data$Errors12$;
|
|
1490
|
+
setShowToast({
|
|
1491
|
+
key: "error",
|
|
1492
|
+
label: (data === null || data === void 0 ? void 0 : (_data$data12 = data.data) === null || _data$data12 === void 0 ? void 0 : (_data$data12$Errors = _data$data12.Errors) === null || _data$data12$Errors === void 0 ? void 0 : (_data$data12$Errors$ = _data$data12$Errors[0]) === null || _data$data12$Errors$ === void 0 ? void 0 : _data$data12$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors12 = data.Errors) === null || _data$Errors12 === void 0 ? void 0 : (_data$Errors12$ = _data$Errors12[0]) === null || _data$Errors12$ === void 0 ? void 0 : _data$Errors12$.message) || (data === null || data === void 0 ? void 0 : data.message) || "Failed to map filling point"
|
|
1493
|
+
});
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1418
1496
|
const mappedVendor = getSelectedVendorOption(row.original, vendors);
|
|
1419
1497
|
const vendorDrivers = getVendorDriversForFillingPoint(mappedVendor, selectedOption);
|
|
1420
1498
|
const selectedDriver = getSelectedDriverOption(row.original, vendorDrivers);
|
|
@@ -1438,11 +1516,12 @@ const VendorInbox = props => {
|
|
|
1438
1516
|
});
|
|
1439
1517
|
};
|
|
1440
1518
|
const onSurveyorSupervisorSelect = (row, selectedSupervisor) => {
|
|
1441
|
-
var _selectedSupervisor$o, _formDetails$owner9, _formDetails$owner0, _formDetails$owner1, _formDetails$owner10;
|
|
1519
|
+
var _selectedSupervisor$o, _selectedSupervisor$o2, _formDetails$owner9, _formDetails$owner0, _formDetails$owner1, _formDetails$owner10;
|
|
1442
1520
|
let formDetails = row.original;
|
|
1443
1521
|
const formData = {
|
|
1444
1522
|
surveyor: _extends({}, formDetails, {
|
|
1445
|
-
supervisorId: (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : selectedSupervisor.
|
|
1523
|
+
supervisorId: (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : selectedSupervisor.name) || (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : (_selectedSupervisor$o = selectedSupervisor.owner) === null || _selectedSupervisor$o === void 0 ? void 0 : _selectedSupervisor$o.name) || null,
|
|
1524
|
+
supervisorName: (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : selectedSupervisor.name) || (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : (_selectedSupervisor$o2 = selectedSupervisor.owner) === null || _selectedSupervisor$o2 === void 0 ? void 0 : _selectedSupervisor$o2.name) || null,
|
|
1446
1525
|
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1447
1526
|
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner9 = formDetails.owner) === null || _formDetails$owner9 === void 0 ? void 0 : _formDetails$owner9.gender) || "OTHERS",
|
|
1448
1527
|
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner0 = formDetails.owner) === null || _formDetails$owner0 === void 0 ? void 0 : _formDetails$owner0.dob) || new Date("1/1/1970").getTime(),
|
|
@@ -1458,7 +1537,17 @@ const VendorInbox = props => {
|
|
|
1458
1537
|
label: (error === null || error === void 0 ? void 0 : error.message) || error || t("ES_FSM_REGISTRY_INBOX_FAILED_TO_UPDATE_SUPERVISOR")
|
|
1459
1538
|
});
|
|
1460
1539
|
},
|
|
1461
|
-
onSuccess:
|
|
1540
|
+
onSuccess: data => {
|
|
1541
|
+
var _data$Errors13, _data$data13, _data$data13$Errors;
|
|
1542
|
+
const isError = (data === null || data === void 0 ? void 0 : data.error) === true || (data === null || data === void 0 ? void 0 : (_data$Errors13 = data.Errors) === null || _data$Errors13 === void 0 ? void 0 : _data$Errors13.length) > 0 || (data === null || data === void 0 ? void 0 : (_data$data13 = data.data) === null || _data$data13 === void 0 ? void 0 : (_data$data13$Errors = _data$data13.Errors) === null || _data$data13$Errors === void 0 ? void 0 : _data$data13$Errors.length) > 0;
|
|
1543
|
+
if (isError) {
|
|
1544
|
+
var _data$data14, _data$data14$Errors, _data$data14$Errors$, _data$Errors14, _data$Errors14$;
|
|
1545
|
+
setShowToast({
|
|
1546
|
+
key: "error",
|
|
1547
|
+
label: (data === null || data === void 0 ? void 0 : (_data$data14 = data.data) === null || _data$data14 === void 0 ? void 0 : (_data$data14$Errors = _data$data14.Errors) === null || _data$data14$Errors === void 0 ? void 0 : (_data$data14$Errors$ = _data$data14$Errors[0]) === null || _data$data14$Errors$ === void 0 ? void 0 : _data$data14$Errors$.message) || (data === null || data === void 0 ? void 0 : (_data$Errors14 = data.Errors) === null || _data$Errors14 === void 0 ? void 0 : (_data$Errors14$ = _data$Errors14[0]) === null || _data$Errors14$ === void 0 ? void 0 : _data$Errors14$.message) || (data === null || data === void 0 ? void 0 : data.message) || t("ES_FSM_REGISTRY_INBOX_FAILED_TO_UPDATE_SUPERVISOR")
|
|
1548
|
+
});
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1462
1551
|
setShowToast({
|
|
1463
1552
|
key: "success",
|
|
1464
1553
|
label: t("ES_FSM_REGISTRY_INBOX_SUPERVISOR_MAPPED_SUCCESSFULLY")
|
|
@@ -1521,9 +1610,9 @@ const VendorInbox = props => {
|
|
|
1521
1610
|
const supervisors = React__default.useMemo(() => {
|
|
1522
1611
|
const list = (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisors) || (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisor) || [];
|
|
1523
1612
|
return list.map(s => {
|
|
1524
|
-
var _s$
|
|
1613
|
+
var _s$owner3, _s$owner4;
|
|
1525
1614
|
return _extends({}, s, {
|
|
1526
|
-
displayName: (s.name || ((_s$
|
|
1615
|
+
displayName: (s.name || ((_s$owner3 = s.owner) === null || _s$owner3 === void 0 ? void 0 : _s$owner3.name) || "N/A") + " (" + (((_s$owner4 = s.owner) === null || _s$owner4 === void 0 ? void 0 : _s$owner4.mobileNumber) || s.mobileNo || "N/A") + ")"
|
|
1527
1616
|
});
|
|
1528
1617
|
});
|
|
1529
1618
|
}, [supervisorSearchResponse]);
|
|
@@ -2050,70 +2139,61 @@ const VendorInbox = props => {
|
|
|
2050
2139
|
}];
|
|
2051
2140
|
case "SURVEYOR":
|
|
2052
2141
|
return [{
|
|
2053
|
-
Header: t("
|
|
2142
|
+
Header: t("USER_ID"),
|
|
2054
2143
|
exportAccessor: row => {
|
|
2055
2144
|
var _row$owner5;
|
|
2056
2145
|
return (row === null || row === void 0 ? void 0 : (_row$owner5 = row.owner) === null || _row$owner5 === void 0 ? void 0 : _row$owner5.userName) || "NA";
|
|
2057
2146
|
}
|
|
2058
2147
|
}, {
|
|
2059
|
-
Header: t("
|
|
2148
|
+
Header: t("USER_NAME"),
|
|
2149
|
+
exportAccessor: row => (row === null || row === void 0 ? void 0 : row.name) || "NA"
|
|
2150
|
+
}, {
|
|
2151
|
+
Header: t("VENDOR_NAME"),
|
|
2060
2152
|
exportAccessor: row => {
|
|
2061
|
-
var _row$
|
|
2062
|
-
return (
|
|
2153
|
+
var _row$vendorData0, _row$vendor0;
|
|
2154
|
+
return (row === null || row === void 0 ? void 0 : row.vendorName) || (row === null || row === void 0 ? void 0 : (_row$vendorData0 = row.vendorData) === null || _row$vendorData0 === void 0 ? void 0 : _row$vendorData0.name) || (row === null || row === void 0 ? void 0 : (_row$vendor0 = row.vendor) === null || _row$vendor0 === void 0 ? void 0 : _row$vendor0.name) || "NA";
|
|
2063
2155
|
}
|
|
2064
2156
|
}, {
|
|
2065
|
-
Header: t("
|
|
2157
|
+
Header: t("SUPERVISOR_NAME"),
|
|
2066
2158
|
exportAccessor: row => {
|
|
2067
|
-
var _selectedSupervisor$
|
|
2159
|
+
var _selectedSupervisor$o3, _row$reportingManager2;
|
|
2068
2160
|
const selectedSupervisor = getSelectedSupervisorOption(row, supervisors);
|
|
2069
|
-
return selectedSupervisor ? selectedSupervisor.name || ((_selectedSupervisor$
|
|
2161
|
+
return selectedSupervisor ? selectedSupervisor.name || ((_selectedSupervisor$o3 = selectedSupervisor.owner) === null || _selectedSupervisor$o3 === void 0 ? void 0 : _selectedSupervisor$o3.name) || "NA" : (row === null || row === void 0 ? void 0 : row.supervisorName) || (row === null || row === void 0 ? void 0 : (_row$reportingManager2 = row.reportingManager) === null || _row$reportingManager2 === void 0 ? void 0 : _row$reportingManager2.name) || "NA";
|
|
2070
2162
|
}
|
|
2071
2163
|
}, {
|
|
2072
|
-
Header: t("
|
|
2164
|
+
Header: t("CREATION_DATE"),
|
|
2073
2165
|
exportAccessor: row => {
|
|
2074
2166
|
var _row$auditDetails7, _row$auditDetails8;
|
|
2075
2167
|
return row !== null && row !== void 0 && (_row$auditDetails7 = row.auditDetails) !== null && _row$auditDetails7 !== void 0 && _row$auditDetails7.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails8 = row.auditDetails) === null || _row$auditDetails8 === void 0 ? void 0 : _row$auditDetails8.createdTime) : "";
|
|
2076
2168
|
}
|
|
2077
|
-
}, {
|
|
2078
|
-
Header: t("ES_FSM_REGISTRY_INBOX_VENDOR_NAME"),
|
|
2079
|
-
exportAccessor: row => {
|
|
2080
|
-
var _row$vendorData0, _row$vendor0, _row$vendorData1, _row$vendorData10, _row$vendorData10$own, _row$vendor1, _row$vendor10, _row$vendor10$owner;
|
|
2081
|
-
return ((row === null || row === void 0 ? void 0 : (_row$vendorData0 = row.vendorData) === null || _row$vendorData0 === void 0 ? void 0 : _row$vendorData0.name) || (row === null || row === void 0 ? void 0 : (_row$vendor0 = row.vendor) === null || _row$vendor0 === void 0 ? void 0 : _row$vendor0.name) || "NA") + " " + ((row === null || row === void 0 ? void 0 : (_row$vendorData1 = row.vendorData) === null || _row$vendorData1 === void 0 ? void 0 : _row$vendorData1.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendorData10 = row.vendorData) === null || _row$vendorData10 === void 0 ? void 0 : (_row$vendorData10$own = _row$vendorData10.owner) === null || _row$vendorData10$own === void 0 ? void 0 : _row$vendorData10$own.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendor1 = row.vendor) === null || _row$vendor1 === void 0 ? void 0 : _row$vendor1.mobileNumber) || (row === null || row === void 0 ? void 0 : (_row$vendor10 = row.vendor) === null || _row$vendor10 === void 0 ? void 0 : (_row$vendor10$owner = _row$vendor10.owner) === null || _row$vendor10$owner === void 0 ? void 0 : _row$vendor10$owner.mobileNumber) || "NA");
|
|
2082
|
-
}
|
|
2083
2169
|
}, {
|
|
2084
2170
|
Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
|
|
2085
2171
|
exportAccessor: row => (row === null || row === void 0 ? void 0 : row.status) || "NA"
|
|
2086
2172
|
}];
|
|
2087
2173
|
case "SUPERVISOR":
|
|
2088
2174
|
return [{
|
|
2089
|
-
Header: t("
|
|
2175
|
+
Header: t("USER_ID"),
|
|
2090
2176
|
exportAccessor: row => {
|
|
2091
|
-
var _row$
|
|
2092
|
-
return (row === null || row === void 0 ? void 0 : (_row$
|
|
2177
|
+
var _row$owner6;
|
|
2178
|
+
return (row === null || row === void 0 ? void 0 : (_row$owner6 = row.owner) === null || _row$owner6 === void 0 ? void 0 : _row$owner6.userName) || "NA";
|
|
2093
2179
|
}
|
|
2094
2180
|
}, {
|
|
2095
|
-
Header: t("
|
|
2096
|
-
exportAccessor: row =>
|
|
2097
|
-
var _row$owner8;
|
|
2098
|
-
return ((row === null || row === void 0 ? void 0 : row.name) || "NA") + " (" + ((row === null || row === void 0 ? void 0 : (_row$owner8 = row.owner) === null || _row$owner8 === void 0 ? void 0 : _row$owner8.mobileNumber) || "NA") + ")";
|
|
2099
|
-
}
|
|
2181
|
+
Header: t("USER_NAME"),
|
|
2182
|
+
exportAccessor: row => (row === null || row === void 0 ? void 0 : row.name) || "NA"
|
|
2100
2183
|
}, {
|
|
2101
|
-
Header: t("
|
|
2102
|
-
exportAccessor: row =>
|
|
2103
|
-
var _row$auditDetails9, _row$auditDetails0;
|
|
2104
|
-
return row !== null && row !== void 0 && (_row$auditDetails9 = row.auditDetails) !== null && _row$auditDetails9 !== void 0 && _row$auditDetails9.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails0 = row.auditDetails) === null || _row$auditDetails0 === void 0 ? void 0 : _row$auditDetails0.createdTime) : "";
|
|
2105
|
-
}
|
|
2184
|
+
Header: t("ZONE"),
|
|
2185
|
+
exportAccessor: row => (row === null || row === void 0 ? void 0 : row.assignedZoneId) || "NA"
|
|
2106
2186
|
}, {
|
|
2107
|
-
Header: t("
|
|
2187
|
+
Header: t("VENDOR_NAME"),
|
|
2108
2188
|
exportAccessor: row => {
|
|
2109
|
-
var _row$
|
|
2110
|
-
return (
|
|
2189
|
+
var _row$vendorData1, _row$vendor1;
|
|
2190
|
+
return (row === null || row === void 0 ? void 0 : row.vendorName) || (row === null || row === void 0 ? void 0 : (_row$vendorData1 = row.vendorData) === null || _row$vendorData1 === void 0 ? void 0 : _row$vendorData1.name) || (row === null || row === void 0 ? void 0 : (_row$vendor1 = row.vendor) === null || _row$vendor1 === void 0 ? void 0 : _row$vendor1.name) || "NA";
|
|
2111
2191
|
}
|
|
2112
2192
|
}, {
|
|
2113
|
-
Header: t("
|
|
2193
|
+
Header: t("CREATION_DATE"),
|
|
2114
2194
|
exportAccessor: row => {
|
|
2115
|
-
var _row$
|
|
2116
|
-
return
|
|
2195
|
+
var _row$auditDetails9, _row$auditDetails0;
|
|
2196
|
+
return row !== null && row !== void 0 && (_row$auditDetails9 = row.auditDetails) !== null && _row$auditDetails9 !== void 0 && _row$auditDetails9.createdTime ? Digit.DateUtils.ConvertEpochToDate(row === null || row === void 0 ? void 0 : (_row$auditDetails0 = row.auditDetails) === null || _row$auditDetails0 === void 0 ? void 0 : _row$auditDetails0.createdTime) : "";
|
|
2117
2197
|
}
|
|
2118
2198
|
}, {
|
|
2119
2199
|
Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
|
|
@@ -2124,8 +2204,64 @@ const VendorInbox = props => {
|
|
|
2124
2204
|
}
|
|
2125
2205
|
}, [props.selectedTab, supervisors, t]);
|
|
2126
2206
|
const getCSVExportData = React__default.useCallback(function () {
|
|
2127
|
-
|
|
2128
|
-
|
|
2207
|
+
try {
|
|
2208
|
+
let _exit = false;
|
|
2209
|
+
function _temp8(_result) {
|
|
2210
|
+
let _exit2 = false;
|
|
2211
|
+
if (_exit) return _result;
|
|
2212
|
+
const _temp6 = function () {
|
|
2213
|
+
if (props.selectedTab === "SURVEYOR") {
|
|
2214
|
+
return _catch(function () {
|
|
2215
|
+
var _props$searchParams;
|
|
2216
|
+
return Promise.resolve(Digit.FSMService.surveyorSearch(tenantId, {
|
|
2217
|
+
status: "ACTIVE,DISABLED",
|
|
2218
|
+
name: (_props$searchParams = props.searchParams) === null || _props$searchParams === void 0 ? void 0 : _props$searchParams.name,
|
|
2219
|
+
limit: 100000,
|
|
2220
|
+
offset: 0
|
|
2221
|
+
})).then(function (response) {
|
|
2222
|
+
const _temp4 = (response === null || response === void 0 ? void 0 : response.surveyors) || (response === null || response === void 0 ? void 0 : response.surveyor) || [];
|
|
2223
|
+
_exit2 = true;
|
|
2224
|
+
return _temp4;
|
|
2225
|
+
});
|
|
2226
|
+
}, function (e) {
|
|
2227
|
+
console.error(e);
|
|
2228
|
+
const _temp5 = [];
|
|
2229
|
+
_exit2 = true;
|
|
2230
|
+
return _temp5;
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
}();
|
|
2234
|
+
return _temp6 && _temp6.then ? _temp6.then(function (_result2) {
|
|
2235
|
+
return _exit2 ? _result2 : tableData;
|
|
2236
|
+
}) : _exit2 ? _temp6 : tableData;
|
|
2237
|
+
}
|
|
2238
|
+
const _temp7 = function () {
|
|
2239
|
+
if (props.selectedTab === "SUPERVISOR") {
|
|
2240
|
+
return _catch(function () {
|
|
2241
|
+
var _props$searchParams2;
|
|
2242
|
+
return Promise.resolve(Digit.FSMService.supervisorSearch(tenantId, {
|
|
2243
|
+
status: "ACTIVE,DISABLED",
|
|
2244
|
+
name: (_props$searchParams2 = props.searchParams) === null || _props$searchParams2 === void 0 ? void 0 : _props$searchParams2.name,
|
|
2245
|
+
limit: 100000,
|
|
2246
|
+
offset: 0
|
|
2247
|
+
})).then(function (response) {
|
|
2248
|
+
const _temp2 = (response === null || response === void 0 ? void 0 : response.supervisors) || (response === null || response === void 0 ? void 0 : response.supervisor) || [];
|
|
2249
|
+
_exit = true;
|
|
2250
|
+
return _temp2;
|
|
2251
|
+
});
|
|
2252
|
+
}, function (e) {
|
|
2253
|
+
console.error(e);
|
|
2254
|
+
const _temp3 = [];
|
|
2255
|
+
_exit = true;
|
|
2256
|
+
return _temp3;
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
}();
|
|
2260
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
|
|
2261
|
+
} catch (e) {
|
|
2262
|
+
return Promise.reject(e);
|
|
2263
|
+
}
|
|
2264
|
+
}, [props.selectedTab, props.searchParams, tenantId, tableData]);
|
|
2129
2265
|
let result;
|
|
2130
2266
|
if (props.isLoading || isAllFillingPointsLoading) {
|
|
2131
2267
|
result = /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -2195,7 +2331,8 @@ const VendorInbox = props => {
|
|
|
2195
2331
|
}
|
|
2196
2332
|
const ekycRoles = {
|
|
2197
2333
|
ekycVendor: "EKYC_VENDOR",
|
|
2198
|
-
supervisor: "EKYC_SUPERVISOR"
|
|
2334
|
+
supervisor: "EKYC_SUPERVISOR",
|
|
2335
|
+
employee: "EMPLOYEE"
|
|
2199
2336
|
};
|
|
2200
2337
|
const wtRoles = {
|
|
2201
2338
|
wtVendor: "WT_VENDOR"
|
|
@@ -2249,7 +2386,7 @@ const VendorInbox = props => {
|
|
|
2249
2386
|
}
|
|
2250
2387
|
}, result)), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
2251
2388
|
error: showToast.key === "error" ? true : false,
|
|
2252
|
-
label: showToast.label ? t(showToast.label) :
|
|
2389
|
+
label: showToast.label ? t(showToast.label) : showToast.key === "success" ? t("ES_FSM_REGISTRY_" + showToast.action + "_" + (showToast.isDisable ? "DISABLE" : "ENABLE") + "_SUCCESS") : t(showToast.action),
|
|
2253
2390
|
onClose: closeToast
|
|
2254
2391
|
}), showWorkOrderModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
2255
2392
|
headerBarMain: /*#__PURE__*/React__default.createElement("h1", {
|
|
@@ -2293,7 +2430,7 @@ const SearchVendor = () => {
|
|
|
2293
2430
|
const userInfo = Digit.UserService.getUser();
|
|
2294
2431
|
const roles = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.roles) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.map(r => r.code)) || [];
|
|
2295
2432
|
const location = reactRouterDom.useLocation();
|
|
2296
|
-
const initialPage = roles.includes("EKYC_VENDOR") || roles.includes("WT_VENDOR") ? "VENDOR" : roles.includes("EKYC_SUPERVISOR") ? "SURVEYOR" : roles.includes("EKYC_SURVEYOR") ? "SURVEYOR" : "";
|
|
2433
|
+
const initialPage = roles.includes("EKYC_VENDOR") || roles.includes("WT_VENDOR") ? "VENDOR" : roles.includes("EKYC_SUPERVISOR") ? "SURVEYOR" : roles.includes("EKYC_SURVEYOR") ? "SURVEYOR" : roles.includes("EMPLOYEE") ? "SUPERVISOR" : "";
|
|
2297
2434
|
const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
|
|
2298
2435
|
selectedTabs = _Digit$Hooks$useQuery.selectedTabs;
|
|
2299
2436
|
const _useState = React.useState(selectedTabs || initialPage),
|
|
@@ -2624,6 +2761,7 @@ const SearchVendor = () => {
|
|
|
2624
2761
|
data: {
|
|
2625
2762
|
table: tableData
|
|
2626
2763
|
},
|
|
2764
|
+
searchParams: searchParams,
|
|
2627
2765
|
isLoading: isLoading || isVendorLoading,
|
|
2628
2766
|
onSort: handleSort,
|
|
2629
2767
|
disableSort: false,
|
|
@@ -2881,7 +3019,7 @@ const SupervisorDetails = props => {
|
|
|
2881
3019
|
showSuccessToast: true,
|
|
2882
3020
|
message: {
|
|
2883
3021
|
key: "success",
|
|
2884
|
-
action: "
|
|
3022
|
+
action: t("ES_VENDOR_DELETE_SUPERVISOR_SUCCESS")
|
|
2885
3023
|
}
|
|
2886
3024
|
}
|
|
2887
3025
|
});
|
|
@@ -3081,7 +3219,7 @@ const SupervisorDetails = props => {
|
|
|
3081
3219
|
title: "ES_VENDOR_SUPERVISOR_DELETE_TEXT"
|
|
3082
3220
|
}))), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
3083
3221
|
error: showToast.key === "error",
|
|
3084
|
-
label:
|
|
3222
|
+
label: showToast.key === "success" ? t("ES_VENDOR_" + showToast.action + "_SUCCESS", showToast.action === "UPDATE_SUPERVISOR" ? "Supervisor updated successfully" : undefined) : t(showToast.action),
|
|
3085
3223
|
onClose: () => setShowToast(null),
|
|
3086
3224
|
duration: 5000
|
|
3087
3225
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, {
|
|
@@ -3228,7 +3366,7 @@ const AddSupervisor = _ref => {
|
|
|
3228
3366
|
canSubmit = _useState2[0],
|
|
3229
3367
|
setCanSubmit = _useState2[1];
|
|
3230
3368
|
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorCreate(tenantId),
|
|
3231
|
-
mutateAsync = _Digit$Hooks$fsm$useS.
|
|
3369
|
+
mutateAsync = _Digit$Hooks$fsm$useS.mutateAsync;
|
|
3232
3370
|
const history = reactRouterDom.useHistory();
|
|
3233
3371
|
const Config = SupervisorConfig(t);
|
|
3234
3372
|
const defaultValues = {
|
|
@@ -3285,6 +3423,7 @@ const AddSupervisor = _ref => {
|
|
|
3285
3423
|
tenantId: tenantId,
|
|
3286
3424
|
assignedZoneId: assignedZone,
|
|
3287
3425
|
description: (data === null || data === void 0 ? void 0 : data.description) || "",
|
|
3426
|
+
correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress,
|
|
3288
3427
|
owner: {
|
|
3289
3428
|
tenantId: tenantId,
|
|
3290
3429
|
name: data === null || data === void 0 ? void 0 : data.fullName,
|
|
@@ -3293,8 +3432,7 @@ const AddSupervisor = _ref => {
|
|
|
3293
3432
|
dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : null,
|
|
3294
3433
|
gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || "OTHERS",
|
|
3295
3434
|
mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber,
|
|
3296
|
-
emailId: data === null || data === void 0 ? void 0 : data.emailId
|
|
3297
|
-
correspondenceAddress: data === null || data === void 0 ? void 0 : data.correspondenceAddress
|
|
3435
|
+
emailId: data === null || data === void 0 ? void 0 : data.emailId
|
|
3298
3436
|
}
|
|
3299
3437
|
}
|
|
3300
3438
|
};
|
|
@@ -3311,7 +3449,7 @@ const AddSupervisor = _ref => {
|
|
|
3311
3449
|
showSuccessToast: true,
|
|
3312
3450
|
message: {
|
|
3313
3451
|
key: "success",
|
|
3314
|
-
action: "
|
|
3452
|
+
action: t("ES_VENDOR_ADD_SUPERVISOR_SUCCESS")
|
|
3315
3453
|
}
|
|
3316
3454
|
}
|
|
3317
3455
|
});
|
|
@@ -3522,7 +3660,7 @@ const SurveyorDetails = props => {
|
|
|
3522
3660
|
showSuccessToast: true,
|
|
3523
3661
|
message: {
|
|
3524
3662
|
key: "success",
|
|
3525
|
-
action: "ES_VENDOR_DELETE_SURVEYOR_SUCCESS"
|
|
3663
|
+
action: t("ES_VENDOR_DELETE_SURVEYOR_SUCCESS")
|
|
3526
3664
|
}
|
|
3527
3665
|
}
|
|
3528
3666
|
});
|
|
@@ -3627,7 +3765,7 @@ const SurveyorDetails = props => {
|
|
|
3627
3765
|
}
|
|
3628
3766
|
}, renderModalContent())), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
3629
3767
|
error: showToast.key === "error",
|
|
3630
|
-
label:
|
|
3768
|
+
label: showToast.key === "success" ? t("ES_VENDOR_" + showToast.action + "_SUCCESS", showToast.action === "UPDATE_SURVEYOR" ? "Surveyor updated successfully" : undefined) : t(showToast.action),
|
|
3631
3769
|
onClose: closeToast
|
|
3632
3770
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, {
|
|
3633
3771
|
style: {
|
|
@@ -3767,7 +3905,10 @@ const VendorDetails = () => {
|
|
|
3767
3905
|
case "EDIT":
|
|
3768
3906
|
return history.push("/digit-ui/" + userType + "/vendor/registry/modify-vendor/" + (dsoId || vendorId));
|
|
3769
3907
|
case "HOME":
|
|
3770
|
-
|
|
3908
|
+
if (userType === "citizen") {
|
|
3909
|
+
return history.push("/digit-ui/citizen/vendor");
|
|
3910
|
+
}
|
|
3911
|
+
return history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=VENDOR");
|
|
3771
3912
|
}
|
|
3772
3913
|
}, [selectedAction]);
|
|
3773
3914
|
React.useEffect(() => {
|
|
@@ -5055,7 +5196,7 @@ const EditSupervisor = () => {
|
|
|
5055
5196
|
i18nKey: "COMMON_GENDER_" + details.owner.gender
|
|
5056
5197
|
} : null,
|
|
5057
5198
|
dob: (details === null || details === void 0 ? void 0 : (_details$owner5 = details.owner) === null || _details$owner5 === void 0 ? void 0 : _details$owner5.dob) && Digit.DateUtils.ConvertTimestampToDate(details === null || details === void 0 ? void 0 : (_details$owner6 = details.owner) === null || _details$owner6 === void 0 ? void 0 : _details$owner6.dob, "yyyy-MM-dd"),
|
|
5058
|
-
correspondenceAddress: details === null || details === void 0 ? void 0 : (_details$owner7 = details.owner) === null || _details$owner7 === void 0 ? void 0 : _details$owner7.correspondenceAddress,
|
|
5199
|
+
correspondenceAddress: (details === null || details === void 0 ? void 0 : details.correspondenceAddress) || (details === null || details === void 0 ? void 0 : (_details$owner7 = details.owner) === null || _details$owner7 === void 0 ? void 0 : _details$owner7.correspondenceAddress),
|
|
5059
5200
|
description: details === null || details === void 0 ? void 0 : details.description,
|
|
5060
5201
|
zoneIds: details === null || details === void 0 ? void 0 : details.assignedZoneId
|
|
5061
5202
|
};
|
|
@@ -5085,7 +5226,7 @@ const EditSupervisor = () => {
|
|
|
5085
5226
|
setShowToast(null);
|
|
5086
5227
|
};
|
|
5087
5228
|
const onSubmit = data => {
|
|
5088
|
-
var _supervisorDetails$ow, _data$gender, _supervisorDetails$ow2, _supervisorDetails$ow3, _supervisorDetails$ow4, _supervisorDetails$ow5
|
|
5229
|
+
var _supervisorDetails$ow, _data$gender, _supervisorDetails$ow2, _supervisorDetails$ow3, _supervisorDetails$ow4, _supervisorDetails$ow5;
|
|
5089
5230
|
const formData = {
|
|
5090
5231
|
RequestInfo: {
|
|
5091
5232
|
apiId: "Rainmaker",
|
|
@@ -5107,6 +5248,7 @@ const EditSupervisor = () => {
|
|
|
5107
5248
|
supervisor: _extends({}, supervisorDetails, {
|
|
5108
5249
|
description: (data === null || data === void 0 ? void 0 : data.description) || (supervisorDetails === null || supervisorDetails === void 0 ? void 0 : supervisorDetails.description) || "",
|
|
5109
5250
|
assignedZoneId: (data === null || data === void 0 ? void 0 : data.zoneIds) || (supervisorDetails === null || supervisorDetails === void 0 ? void 0 : supervisorDetails.assignedZoneId) || null,
|
|
5251
|
+
correspondenceAddress: (data === null || data === void 0 ? void 0 : data.correspondenceAddress) || (supervisorDetails === null || supervisorDetails === void 0 ? void 0 : supervisorDetails.correspondenceAddress),
|
|
5110
5252
|
owner: _extends({}, supervisorDetails.owner, {
|
|
5111
5253
|
name: (data === null || data === void 0 ? void 0 : data.fullName) || ((_supervisorDetails$ow = supervisorDetails.owner) === null || _supervisorDetails$ow === void 0 ? void 0 : _supervisorDetails$ow.name),
|
|
5112
5254
|
fatherOrHusbandName: "Static Father",
|
|
@@ -5114,8 +5256,7 @@ const EditSupervisor = () => {
|
|
|
5114
5256
|
gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || ((_supervisorDetails$ow2 = supervisorDetails.owner) === null || _supervisorDetails$ow2 === void 0 ? void 0 : _supervisorDetails$ow2.gender) || "OTHERS",
|
|
5115
5257
|
dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : (_supervisorDetails$ow3 = supervisorDetails.owner) === null || _supervisorDetails$ow3 === void 0 ? void 0 : _supervisorDetails$ow3.dob,
|
|
5116
5258
|
emailId: (data === null || data === void 0 ? void 0 : data.emailId) || ((_supervisorDetails$ow4 = supervisorDetails.owner) === null || _supervisorDetails$ow4 === void 0 ? void 0 : _supervisorDetails$ow4.emailId),
|
|
5117
|
-
mobileNumber: (data === null || data === void 0 ? void 0 : data.mobileNumber) || ((_supervisorDetails$ow5 = supervisorDetails.owner) === null || _supervisorDetails$ow5 === void 0 ? void 0 : _supervisorDetails$ow5.mobileNumber)
|
|
5118
|
-
correspondenceAddress: (data === null || data === void 0 ? void 0 : data.correspondenceAddress) || ((_supervisorDetails$ow6 = supervisorDetails.owner) === null || _supervisorDetails$ow6 === void 0 ? void 0 : _supervisorDetails$ow6.correspondenceAddress)
|
|
5259
|
+
mobileNumber: (data === null || data === void 0 ? void 0 : data.mobileNumber) || ((_supervisorDetails$ow5 = supervisorDetails.owner) === null || _supervisorDetails$ow5 === void 0 ? void 0 : _supervisorDetails$ow5.mobileNumber)
|
|
5119
5260
|
})
|
|
5120
5261
|
})
|
|
5121
5262
|
};
|
|
@@ -5236,7 +5377,7 @@ const EditSurveyor = () => {
|
|
|
5236
5377
|
name: "ES_COMMON_RELATION_" + details.owner.relationship
|
|
5237
5378
|
} : null,
|
|
5238
5379
|
dob: (details === null || details === void 0 ? void 0 : (_details$owner7 = details.owner) === null || _details$owner7 === void 0 ? void 0 : _details$owner7.dob) && Digit.DateUtils.ConvertTimestampToDate(details === null || details === void 0 ? void 0 : (_details$owner8 = details.owner) === null || _details$owner8 === void 0 ? void 0 : _details$owner8.dob, "yyyy-MM-dd"),
|
|
5239
|
-
correspondenceAddress: details === null || details === void 0 ? void 0 : (_details$owner9 = details.owner) === null || _details$owner9 === void 0 ? void 0 : _details$owner9.correspondenceAddress,
|
|
5380
|
+
correspondenceAddress: (details === null || details === void 0 ? void 0 : details.correspondenceAddress) || (details === null || details === void 0 ? void 0 : (_details$owner9 = details.owner) === null || _details$owner9 === void 0 ? void 0 : _details$owner9.correspondenceAddress),
|
|
5240
5381
|
description: details === null || details === void 0 ? void 0 : details.description
|
|
5241
5382
|
};
|
|
5242
5383
|
setDefaultValues(values);
|
|
@@ -5265,7 +5406,7 @@ const EditSurveyor = () => {
|
|
|
5265
5406
|
setShowToast(null);
|
|
5266
5407
|
};
|
|
5267
5408
|
const onSubmit = data => {
|
|
5268
|
-
var _surveyorDetails$owne, _surveyorDetails$owne2, _data$relationship, _surveyorDetails$owne3, _data$gender, _surveyorDetails$owne4, _surveyorDetails$owne5, _surveyorDetails$owne6, _surveyorDetails$owne7
|
|
5409
|
+
var _surveyorDetails$owne, _surveyorDetails$owne2, _data$relationship, _surveyorDetails$owne3, _data$gender, _surveyorDetails$owne4, _surveyorDetails$owne5, _surveyorDetails$owne6, _surveyorDetails$owne7;
|
|
5269
5410
|
const formData = {
|
|
5270
5411
|
RequestInfo: {
|
|
5271
5412
|
apiId: "Rainmaker",
|
|
@@ -5289,6 +5430,7 @@ const EditSurveyor = () => {
|
|
|
5289
5430
|
name: (data === null || data === void 0 ? void 0 : data.fullName) || (surveyorDetails === null || surveyorDetails === void 0 ? void 0 : surveyorDetails.name),
|
|
5290
5431
|
mobileNo: (data === null || data === void 0 ? void 0 : data.mobileNumber) || (surveyorDetails === null || surveyorDetails === void 0 ? void 0 : surveyorDetails.mobileNo),
|
|
5291
5432
|
employeeId: (data === null || data === void 0 ? void 0 : data.employeeId) || (surveyorDetails === null || surveyorDetails === void 0 ? void 0 : surveyorDetails.employeeId),
|
|
5433
|
+
correspondenceAddress: (data === null || data === void 0 ? void 0 : data.correspondenceAddress) || (surveyorDetails === null || surveyorDetails === void 0 ? void 0 : surveyorDetails.correspondenceAddress),
|
|
5292
5434
|
owner: _extends({}, surveyorDetails.owner, {
|
|
5293
5435
|
name: (data === null || data === void 0 ? void 0 : data.fullName) || ((_surveyorDetails$owne = surveyorDetails.owner) === null || _surveyorDetails$owne === void 0 ? void 0 : _surveyorDetails$owne.name),
|
|
5294
5436
|
fatherOrHusbandName: (data === null || data === void 0 ? void 0 : data.fatherOrHusbandName) || ((_surveyorDetails$owne2 = surveyorDetails.owner) === null || _surveyorDetails$owne2 === void 0 ? void 0 : _surveyorDetails$owne2.fatherOrHusbandName),
|
|
@@ -5296,8 +5438,7 @@ const EditSurveyor = () => {
|
|
|
5296
5438
|
gender: (data === null || data === void 0 ? void 0 : (_data$gender = data.gender) === null || _data$gender === void 0 ? void 0 : _data$gender.code) || ((_surveyorDetails$owne4 = surveyorDetails.owner) === null || _surveyorDetails$owne4 === void 0 ? void 0 : _surveyorDetails$owne4.gender) || "OTHERS",
|
|
5297
5439
|
dob: data !== null && data !== void 0 && data.dob ? new Date(data.dob).getTime() : (_surveyorDetails$owne5 = surveyorDetails.owner) === null || _surveyorDetails$owne5 === void 0 ? void 0 : _surveyorDetails$owne5.dob,
|
|
5298
5440
|
emailId: (data === null || data === void 0 ? void 0 : data.emailId) || ((_surveyorDetails$owne6 = surveyorDetails.owner) === null || _surveyorDetails$owne6 === void 0 ? void 0 : _surveyorDetails$owne6.emailId),
|
|
5299
|
-
mobileNumber: (data === null || data === void 0 ? void 0 : data.mobileNumber) || ((_surveyorDetails$owne7 = surveyorDetails.owner) === null || _surveyorDetails$owne7 === void 0 ? void 0 : _surveyorDetails$owne7.mobileNumber)
|
|
5300
|
-
correspondenceAddress: (data === null || data === void 0 ? void 0 : data.correspondenceAddress) || ((_surveyorDetails$owne8 = surveyorDetails.owner) === null || _surveyorDetails$owne8 === void 0 ? void 0 : _surveyorDetails$owne8.correspondenceAddress)
|
|
5441
|
+
mobileNumber: (data === null || data === void 0 ? void 0 : data.mobileNumber) || ((_surveyorDetails$owne7 = surveyorDetails.owner) === null || _surveyorDetails$owne7 === void 0 ? void 0 : _surveyorDetails$owne7.mobileNumber)
|
|
5301
5442
|
})
|
|
5302
5443
|
})
|
|
5303
5444
|
};
|
|
@@ -7932,7 +8073,7 @@ const CloseBtn$1 = props => {
|
|
|
7932
8073
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, null));
|
|
7933
8074
|
};
|
|
7934
8075
|
const DriverDetails = () => {
|
|
7935
|
-
var _driverData$5, _driverData$5$employe;
|
|
8076
|
+
var _Digit$UserService$ge, _userInfo$type, _driverData$5, _driverData$5$employe;
|
|
7936
8077
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
7937
8078
|
const _useTranslation = reactI18next.useTranslation(),
|
|
7938
8079
|
t = _useTranslation.t;
|
|
@@ -7940,6 +8081,8 @@ const DriverDetails = () => {
|
|
|
7940
8081
|
const queryClient = reactQuery.useQueryClient();
|
|
7941
8082
|
const _useParams = reactRouterDom.useParams(),
|
|
7942
8083
|
dsoId = _useParams.id;
|
|
8084
|
+
const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
|
|
8085
|
+
const userType = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$type = userInfo.type) === null || _userInfo$type === void 0 ? void 0 : _userInfo$type.toLowerCase();
|
|
7943
8086
|
const _useState = React.useState(false),
|
|
7944
8087
|
displayMenu = _useState[0],
|
|
7945
8088
|
setDisplayMenu = _useState[1];
|
|
@@ -7997,9 +8140,12 @@ const DriverDetails = () => {
|
|
|
7997
8140
|
case "DELETE_VENDOR":
|
|
7998
8141
|
return setShowModal(true);
|
|
7999
8142
|
case "EDIT":
|
|
8000
|
-
return history.push("/digit-ui/
|
|
8143
|
+
return history.push("/digit-ui/" + userType + "/vendor/registry/modify-driver/" + dsoId);
|
|
8001
8144
|
case "HOME":
|
|
8002
|
-
|
|
8145
|
+
if (userType === "citizen") {
|
|
8146
|
+
return history.push("/digit-ui/citizen/vendor");
|
|
8147
|
+
}
|
|
8148
|
+
return history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=DRIVER");
|
|
8003
8149
|
}
|
|
8004
8150
|
}, [selectedAction]);
|
|
8005
8151
|
const closeToast = () => {
|
|
@@ -8788,7 +8934,7 @@ const CloseBtn$2 = props => {
|
|
|
8788
8934
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, null));
|
|
8789
8935
|
};
|
|
8790
8936
|
const VehicleDetails = props => {
|
|
8791
|
-
var _vehicleData$6, _vehicleData$6$employ;
|
|
8937
|
+
var _Digit$UserService$ge, _userInfo$type, _vehicleData$6, _vehicleData$6$employ;
|
|
8792
8938
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
8793
8939
|
const _useTranslation = reactI18next.useTranslation(),
|
|
8794
8940
|
t = _useTranslation.t;
|
|
@@ -8796,6 +8942,8 @@ const VehicleDetails = props => {
|
|
|
8796
8942
|
const queryClient = reactQuery.useQueryClient();
|
|
8797
8943
|
let _useParams = reactRouterDom.useParams(),
|
|
8798
8944
|
vehicleNumber = _useParams.id;
|
|
8945
|
+
const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
|
|
8946
|
+
const userType = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$type = userInfo.type) === null || _userInfo$type === void 0 ? void 0 : _userInfo$type.toLowerCase();
|
|
8799
8947
|
const _useState = React.useState(false),
|
|
8800
8948
|
displayMenu = _useState[0],
|
|
8801
8949
|
setDisplayMenu = _useState[1];
|
|
@@ -8862,9 +9010,12 @@ const VehicleDetails = props => {
|
|
|
8862
9010
|
case "DELETE_VENDOR":
|
|
8863
9011
|
return setShowModal(true);
|
|
8864
9012
|
case "EDIT":
|
|
8865
|
-
return history.push("/digit-ui/
|
|
9013
|
+
return history.push("/digit-ui/" + userType + "/vendor/registry/modify-vehicle/" + vehicleNumber);
|
|
8866
9014
|
case "HOME":
|
|
8867
|
-
|
|
9015
|
+
if (userType === "citizen") {
|
|
9016
|
+
return history.push("/digit-ui/citizen/vendor");
|
|
9017
|
+
}
|
|
9018
|
+
return history.push("/digit-ui/" + userType + "/vendor/search-vendor?selectedTabs=VEHICLE");
|
|
8868
9019
|
}
|
|
8869
9020
|
}, [selectedAction]);
|
|
8870
9021
|
const closeToast = () => {
|
|
@@ -9208,18 +9359,36 @@ const SelectEkycZones = _ref => {
|
|
|
9208
9359
|
}
|
|
9209
9360
|
}, [boundaryData]);
|
|
9210
9361
|
React.useEffect(() => {
|
|
9211
|
-
if (!zones.length || !
|
|
9212
|
-
if (
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9362
|
+
if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
|
|
9363
|
+
if (isMultiSelect) {
|
|
9364
|
+
if (!Array.isArray(formData.zoneIds)) return;
|
|
9365
|
+
if (formData.zoneIds.length && typeof formData.zoneIds[0] === "object") {
|
|
9366
|
+
setSelectedZones(formData.zoneIds);
|
|
9367
|
+
return;
|
|
9368
|
+
}
|
|
9369
|
+
const selected = zones.filter(zone => formData.zoneIds.includes(zone.name) || formData.zoneIds.includes(zone.code));
|
|
9370
|
+
setSelectedZones(selected);
|
|
9371
|
+
if (!initialized.current) {
|
|
9372
|
+
initialized.current = true;
|
|
9373
|
+
onSelect(config.key, selected);
|
|
9374
|
+
}
|
|
9375
|
+
} else {
|
|
9376
|
+
let selectedVal = formData.zoneIds;
|
|
9377
|
+
if (Array.isArray(selectedVal)) {
|
|
9378
|
+
var _selectedVal$, _selectedVal$2;
|
|
9379
|
+
selectedVal = ((_selectedVal$ = selectedVal[0]) === null || _selectedVal$ === void 0 ? void 0 : _selectedVal$.name) || ((_selectedVal$2 = selectedVal[0]) === null || _selectedVal$2 === void 0 ? void 0 : _selectedVal$2.code) || selectedVal[0] || "";
|
|
9380
|
+
}
|
|
9381
|
+
if (typeof selectedVal === "object") {
|
|
9382
|
+
selectedVal = selectedVal.name || selectedVal.code || "";
|
|
9383
|
+
}
|
|
9384
|
+
const selected = zones.find(zone => zone.name === selectedVal || zone.code === selectedVal);
|
|
9385
|
+
setSelectedZones(selected ? [selected] : []);
|
|
9386
|
+
if (!initialized.current && selected) {
|
|
9387
|
+
initialized.current = true;
|
|
9388
|
+
onSelect(config.key, selected.name || "");
|
|
9389
|
+
}
|
|
9221
9390
|
}
|
|
9222
|
-
}, [zones, formData === null || formData === void 0 ? void 0 : formData.zoneIds, config.key, onSelect]);
|
|
9391
|
+
}, [zones, formData === null || formData === void 0 ? void 0 : formData.zoneIds, config.key, onSelect, isMultiSelect]);
|
|
9223
9392
|
const handleSelect = value => {
|
|
9224
9393
|
if (isMultiSelect) {
|
|
9225
9394
|
const selected = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : [];
|
|
@@ -9228,7 +9397,7 @@ const SelectEkycZones = _ref => {
|
|
|
9228
9397
|
} else {
|
|
9229
9398
|
const selectedZone = Array.isArray(value) ? Array.isArray(value[0]) ? value[0][1] : value[0] : value;
|
|
9230
9399
|
setSelectedZones(selectedZone ? [selectedZone] : []);
|
|
9231
|
-
onSelect(config.key, (selectedZone === null || selectedZone === void 0 ? void 0 : selectedZone.
|
|
9400
|
+
onSelect(config.key, (selectedZone === null || selectedZone === void 0 ? void 0 : selectedZone.name) || "");
|
|
9232
9401
|
}
|
|
9233
9402
|
};
|
|
9234
9403
|
if (isLoading) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|