@djb25/digit-ui-module-vendor 1.0.62 → 1.0.64
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 +168 -21
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +168 -21
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -50,10 +50,20 @@ const SurveyorConfig = function (t, agencies, reportingManagers, disabled) {
|
|
|
50
50
|
populators: {
|
|
51
51
|
name: "fullName",
|
|
52
52
|
validation: {
|
|
53
|
-
required:
|
|
54
|
-
|
|
53
|
+
required: {
|
|
54
|
+
value: true,
|
|
55
|
+
message: t("ES_VENDOR_INVALID_NAME")
|
|
56
|
+
},
|
|
57
|
+
maxLength: {
|
|
58
|
+
value: 49,
|
|
59
|
+
message: t("ES_VENDOR_NAME_MAX_50_CHARACTERS")
|
|
60
|
+
},
|
|
61
|
+
pattern: {
|
|
62
|
+
value: /^[A-Za-z\s]+$/,
|
|
63
|
+
message: t("ES_VENDOR_INVALID_NAME")
|
|
64
|
+
}
|
|
55
65
|
},
|
|
56
|
-
|
|
66
|
+
maxlength: 50
|
|
57
67
|
}
|
|
58
68
|
}, {
|
|
59
69
|
label: "ES_VENDOR_SURVEYOR_MOBILE_NUMBER",
|
|
@@ -1116,8 +1126,10 @@ const VendorInbox = props => {
|
|
|
1116
1126
|
mutateVehicle = _Digit$Hooks$fsm$useU.mutate;
|
|
1117
1127
|
const _Digit$Hooks$fsm$useD3 = Digit.Hooks.fsm.useDriverUpdate(tenantId),
|
|
1118
1128
|
mutateDriver = _Digit$Hooks$fsm$useD3.mutate;
|
|
1119
|
-
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.
|
|
1120
|
-
|
|
1129
|
+
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorUpdate(tenantId),
|
|
1130
|
+
mutateSupervisor = _Digit$Hooks$fsm$useS.mutate;
|
|
1131
|
+
const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorUpdate(tenantId),
|
|
1132
|
+
mutateSurveyor = _Digit$Hooks$fsm$useS2.mutate;
|
|
1121
1133
|
useEffect(() => {
|
|
1122
1134
|
var _props$data;
|
|
1123
1135
|
setTableData((props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.table) || []);
|
|
@@ -1304,6 +1316,78 @@ const VendorInbox = props => {
|
|
|
1304
1316
|
}
|
|
1305
1317
|
});
|
|
1306
1318
|
};
|
|
1319
|
+
const onSupervisorUpdate = row => {
|
|
1320
|
+
var _formDetails$owner9, _formDetails$owner0, _formDetails$owner1, _formDetails$owner10;
|
|
1321
|
+
let formDetails = row.original;
|
|
1322
|
+
const newStatus = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE" ? "DISABLED" : "ACTIVE";
|
|
1323
|
+
const newActive = newStatus === "ACTIVE";
|
|
1324
|
+
const formData = {
|
|
1325
|
+
supervisor: _extends({}, formDetails, {
|
|
1326
|
+
status: newStatus,
|
|
1327
|
+
active: newActive,
|
|
1328
|
+
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1329
|
+
active: newActive,
|
|
1330
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner9 = formDetails.owner) === null || _formDetails$owner9 === void 0 ? void 0 : _formDetails$owner9.gender) || "OTHERS",
|
|
1331
|
+
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(),
|
|
1332
|
+
emailId: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner1 = formDetails.owner) === null || _formDetails$owner1 === void 0 ? void 0 : _formDetails$owner1.emailId) || "abc@egov.com",
|
|
1333
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner10 = formDetails.owner) === null || _formDetails$owner10 === void 0 ? void 0 : _formDetails$owner10.relationship) || "OTHER"
|
|
1334
|
+
})
|
|
1335
|
+
})
|
|
1336
|
+
};
|
|
1337
|
+
mutateSupervisor(formData, {
|
|
1338
|
+
onError: (error, variables) => {
|
|
1339
|
+
setShowToast({
|
|
1340
|
+
key: "error",
|
|
1341
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || error
|
|
1342
|
+
});
|
|
1343
|
+
},
|
|
1344
|
+
onSuccess: (data, variables) => {
|
|
1345
|
+
setShowToast({
|
|
1346
|
+
key: "success",
|
|
1347
|
+
action: "SUPERVISOR"
|
|
1348
|
+
});
|
|
1349
|
+
queryClient.invalidateQueries("FSM_SUPERVISOR_SEARCH");
|
|
1350
|
+
queryClient.invalidateQueries("SUPERVISOR_SEARCH");
|
|
1351
|
+
props.refetchData();
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
};
|
|
1355
|
+
const onSurveyorUpdate = row => {
|
|
1356
|
+
var _formDetails$owner11, _formDetails$owner12, _formDetails$owner13, _formDetails$owner14;
|
|
1357
|
+
let formDetails = row.original;
|
|
1358
|
+
const newStatus = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE" ? "DISABLED" : "ACTIVE";
|
|
1359
|
+
const newActive = newStatus === "ACTIVE";
|
|
1360
|
+
const formData = {
|
|
1361
|
+
surveyor: _extends({}, formDetails, {
|
|
1362
|
+
status: newStatus,
|
|
1363
|
+
active: newActive,
|
|
1364
|
+
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1365
|
+
active: newActive,
|
|
1366
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner11 = formDetails.owner) === null || _formDetails$owner11 === void 0 ? void 0 : _formDetails$owner11.gender) || "OTHERS",
|
|
1367
|
+
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner12 = formDetails.owner) === null || _formDetails$owner12 === void 0 ? void 0 : _formDetails$owner12.dob) || new Date("1/1/1970").getTime(),
|
|
1368
|
+
emailId: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner13 = formDetails.owner) === null || _formDetails$owner13 === void 0 ? void 0 : _formDetails$owner13.emailId) || "abc@egov.com",
|
|
1369
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner14 = formDetails.owner) === null || _formDetails$owner14 === void 0 ? void 0 : _formDetails$owner14.relationship) || "OTHER"
|
|
1370
|
+
})
|
|
1371
|
+
})
|
|
1372
|
+
};
|
|
1373
|
+
mutateSurveyor(formData, {
|
|
1374
|
+
onError: (error, variables) => {
|
|
1375
|
+
setShowToast({
|
|
1376
|
+
key: "error",
|
|
1377
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || error
|
|
1378
|
+
});
|
|
1379
|
+
},
|
|
1380
|
+
onSuccess: (data, variables) => {
|
|
1381
|
+
setShowToast({
|
|
1382
|
+
key: "success",
|
|
1383
|
+
action: "SURVEYOR"
|
|
1384
|
+
});
|
|
1385
|
+
queryClient.invalidateQueries("FSM_SURVEYOR_SEARCH");
|
|
1386
|
+
queryClient.invalidateQueries("SURVEYOR_SEARCH");
|
|
1387
|
+
props.refetchData();
|
|
1388
|
+
}
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1307
1391
|
const onVendorSelect = (row, selectedOption) => {
|
|
1308
1392
|
let driverData = row.original;
|
|
1309
1393
|
let existingVendor = driverData === null || driverData === void 0 ? void 0 : driverData.vendor;
|
|
@@ -1513,17 +1597,17 @@ const VendorInbox = props => {
|
|
|
1513
1597
|
});
|
|
1514
1598
|
};
|
|
1515
1599
|
const onSurveyorSupervisorSelect = (row, selectedSupervisor) => {
|
|
1516
|
-
var _selectedSupervisor$o, _formDetails$
|
|
1600
|
+
var _selectedSupervisor$o, _formDetails$owner15, _formDetails$owner16, _formDetails$owner17, _formDetails$owner18;
|
|
1517
1601
|
let formDetails = row.original;
|
|
1518
1602
|
const formData = {
|
|
1519
1603
|
surveyor: _extends({}, formDetails, {
|
|
1520
1604
|
supervisorId: (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : selectedSupervisor.id) || null,
|
|
1521
1605
|
supervisorName: (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,
|
|
1522
1606
|
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1523
|
-
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1524
|
-
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1525
|
-
emailId: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1526
|
-
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1607
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner15 = formDetails.owner) === null || _formDetails$owner15 === void 0 ? void 0 : _formDetails$owner15.gender) || "OTHERS",
|
|
1608
|
+
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner16 = formDetails.owner) === null || _formDetails$owner16 === void 0 ? void 0 : _formDetails$owner16.dob) || new Date("1/1/1970").getTime(),
|
|
1609
|
+
emailId: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner17 = formDetails.owner) === null || _formDetails$owner17 === void 0 ? void 0 : _formDetails$owner17.emailId) || "abc@egov.com",
|
|
1610
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner18 = formDetails.owner) === null || _formDetails$owner18 === void 0 ? void 0 : _formDetails$owner18.relationship) || "OTHER"
|
|
1527
1611
|
})
|
|
1528
1612
|
})
|
|
1529
1613
|
};
|
|
@@ -1598,12 +1682,12 @@ const VendorInbox = props => {
|
|
|
1598
1682
|
allFillingPointsData = _Digit$Hooks$wt$useFi.data,
|
|
1599
1683
|
isAllFillingPointsLoading = _Digit$Hooks$wt$useFi.isLoading;
|
|
1600
1684
|
const allFillingPoints = (allFillingPointsData === null || allFillingPointsData === void 0 ? void 0 : allFillingPointsData.fillingPoints) || [];
|
|
1601
|
-
const _Digit$Hooks$fsm$
|
|
1685
|
+
const _Digit$Hooks$fsm$useS3 = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
|
|
1602
1686
|
status: "ACTIVE"
|
|
1603
1687
|
}, {
|
|
1604
1688
|
enabled: props.selectedTab === "SURVEYOR"
|
|
1605
1689
|
}),
|
|
1606
|
-
supervisorSearchResponse = _Digit$Hooks$fsm$
|
|
1690
|
+
supervisorSearchResponse = _Digit$Hooks$fsm$useS3.data;
|
|
1607
1691
|
const supervisors = React.useMemo(() => {
|
|
1608
1692
|
const list = (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisors) || (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisor) || [];
|
|
1609
1693
|
return list.map(s => {
|
|
@@ -2034,6 +2118,29 @@ const VendorInbox = props => {
|
|
|
2034
2118
|
let row = _ref30.row;
|
|
2035
2119
|
return GetCell((_row$original19 = row.original) !== null && _row$original19 !== void 0 && (_row$original19$audit = _row$original19.auditDetails) !== null && _row$original19$audit !== void 0 && _row$original19$audit.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original20 = row.original) === null || _row$original20 === void 0 ? void 0 : (_row$original20$audit = _row$original20.auditDetails) === null || _row$original20$audit === void 0 ? void 0 : _row$original20$audit.createdTime) : "");
|
|
2036
2120
|
}
|
|
2121
|
+
}, {
|
|
2122
|
+
Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
|
|
2123
|
+
id: "status",
|
|
2124
|
+
accessor: row => row.status || "",
|
|
2125
|
+
Cell: _ref31 => {
|
|
2126
|
+
var _row$original21;
|
|
2127
|
+
let row = _ref31.row;
|
|
2128
|
+
return /*#__PURE__*/React.createElement(ToggleSwitch, {
|
|
2129
|
+
style: {
|
|
2130
|
+
display: "flex",
|
|
2131
|
+
justifyContent: "left"
|
|
2132
|
+
},
|
|
2133
|
+
value: ((_row$original21 = row.original) === null || _row$original21 === void 0 ? void 0 : _row$original21.status) === "DISABLED" ? false : true,
|
|
2134
|
+
onChange: () => {
|
|
2135
|
+
if (props.selectedTab === "SUPERVISOR") {
|
|
2136
|
+
onSupervisorUpdate(row);
|
|
2137
|
+
} else if (props.selectedTab === "SURVEYOR") {
|
|
2138
|
+
onSurveyorUpdate(row);
|
|
2139
|
+
}
|
|
2140
|
+
},
|
|
2141
|
+
name: "switch-" + row.id
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2037
2144
|
}];
|
|
2038
2145
|
default:
|
|
2039
2146
|
return [];
|
|
@@ -3256,15 +3363,22 @@ const SupervisorConfig = function (t, agencies, reportingManagers, disabled) {
|
|
|
3256
3363
|
populators: {
|
|
3257
3364
|
name: "fullName",
|
|
3258
3365
|
validation: {
|
|
3259
|
-
required:
|
|
3366
|
+
required: {
|
|
3367
|
+
value: true,
|
|
3368
|
+
message: t("ES_VENDOR_INVALID_NAME")
|
|
3369
|
+
},
|
|
3370
|
+
maxLength: {
|
|
3371
|
+
value: 49,
|
|
3372
|
+
message: t("ES_VENDOR_NAME_MAX_50_CHARACTERS")
|
|
3373
|
+
},
|
|
3260
3374
|
pattern: {
|
|
3261
3375
|
value: /^[A-Za-z\s]+$/,
|
|
3262
3376
|
message: t("ES_VENDOR_INVALID_NAME")
|
|
3263
3377
|
}
|
|
3264
3378
|
},
|
|
3265
|
-
error: t("ES_VENDOR_INVALID_NAME"),
|
|
3266
3379
|
defaultValue: "",
|
|
3267
|
-
className: "payment-form-text-input-correction"
|
|
3380
|
+
className: "payment-form-text-input-correction",
|
|
3381
|
+
maxlength: 50
|
|
3268
3382
|
}
|
|
3269
3383
|
}, {
|
|
3270
3384
|
label: t("ES_VENDOR_SUPERVISOR_MOBILE_NUMBER"),
|
|
@@ -3797,7 +3911,7 @@ const formatLabel = key => {
|
|
|
3797
3911
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
3798
3912
|
};
|
|
3799
3913
|
const VendorDetails = () => {
|
|
3800
|
-
var _dsoData$, _dsoData$$dsoDetails, _vendorAdditionalData, _vendorAdditionalData2, _vendorAdditionalData3, _parsedAdditionalDeta, _userInfo$info$type, _dsoData$5, _dsoData$5$employeeRe, _supervisorData$super, _surveyorData$surveyo;
|
|
3914
|
+
var _dsoData$, _dsoData$$dsoDetails, _vendorAdditionalData, _vendorAdditionalData2, _vendorAdditionalData3, _parsedAdditionalDeta, _userInfo$info$type, _userInfo$info, _userInfo$info$roles, _dsoData$5, _dsoData$5$employeeRe, _supervisorData$super, _surveyorData$surveyo;
|
|
3801
3915
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3802
3916
|
const _useTranslation = useTranslation(),
|
|
3803
3917
|
t = _useTranslation.t;
|
|
@@ -3903,6 +4017,8 @@ const VendorDetails = () => {
|
|
|
3903
4017
|
}
|
|
3904
4018
|
const userInfo = Digit.SessionStorage.get("User");
|
|
3905
4019
|
const userType = (_userInfo$info$type = userInfo.info.type) === null || _userInfo$info$type === void 0 ? void 0 : _userInfo$info$type.toLowerCase();
|
|
4020
|
+
const userRoles = (userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info = userInfo.info) === null || _userInfo$info === void 0 ? void 0 : (_userInfo$info$roles = _userInfo$info.roles) === null || _userInfo$info$roles === void 0 ? void 0 : _userInfo$info$roles.map(r => r.code)) || [];
|
|
4021
|
+
const isEkycVendor = userRoles.includes("EKYC_VENDOR");
|
|
3906
4022
|
useEffect(() => {
|
|
3907
4023
|
switch (selectedAction) {
|
|
3908
4024
|
case "DELETE":
|
|
@@ -4278,7 +4394,7 @@ const VendorDetails = () => {
|
|
|
4278
4394
|
manualPagination: false,
|
|
4279
4395
|
pageSizeLimit: 10,
|
|
4280
4396
|
t: t
|
|
4281
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
4397
|
+
}), isEkycVendor && /*#__PURE__*/React.createElement("div", {
|
|
4282
4398
|
className: "add-details-link hover-button",
|
|
4283
4399
|
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/new-supervisor?vendorId=" + (dsoId || vendorId))
|
|
4284
4400
|
}, t("ES_VENDOR_ADD_SUPERVISOR"))), /*#__PURE__*/React.createElement(CardSectionHeader, {
|
|
@@ -4294,7 +4410,10 @@ const VendorDetails = () => {
|
|
|
4294
4410
|
manualPagination: false,
|
|
4295
4411
|
pageSizeLimit: 10,
|
|
4296
4412
|
t: t
|
|
4297
|
-
})
|
|
4413
|
+
}), isEkycVendor && /*#__PURE__*/React.createElement("div", {
|
|
4414
|
+
className: "add-details-link hover-button",
|
|
4415
|
+
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/new-surveyor?vendorId=" + (dsoId || vendorId))
|
|
4416
|
+
}, t("ES_VENDOR_ADD_SURVEYOR"))))), showModal && /*#__PURE__*/React.createElement(Modal, {
|
|
4298
4417
|
headerBarMain: /*#__PURE__*/React.createElement("h1", {
|
|
4299
4418
|
className: "heading-m"
|
|
4300
4419
|
}, t(selectedAction === "DELETE" ? "ES_FSM_REGISTRY_DELETE_POPUP_HEADER" : selectedAction === "ADD_VEHICLE" ? "ES_FSM_REGISTRY_ADD_VEHICLE_POPUP_HEADER" : "ES_FSM_REGISTRY_ADD_DRIVER_POPUP_HEADER")),
|
|
@@ -9341,6 +9460,7 @@ const VehicleDetails = props => {
|
|
|
9341
9460
|
};
|
|
9342
9461
|
|
|
9343
9462
|
const SelectEkycZones = _ref => {
|
|
9463
|
+
var _Digit$SessionStorage, _loggedInUser$roles;
|
|
9344
9464
|
let config = _ref.config,
|
|
9345
9465
|
onSelect = _ref.onSelect,
|
|
9346
9466
|
t = _ref.t,
|
|
@@ -9355,6 +9475,29 @@ const SelectEkycZones = _ref => {
|
|
|
9355
9475
|
selectedZones = _useState2[0],
|
|
9356
9476
|
setSelectedZones = _useState2[1];
|
|
9357
9477
|
const initialized = useRef(false);
|
|
9478
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
9479
|
+
const roles = (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$roles = loggedInUser.roles) === null || _loggedInUser$roles === void 0 ? void 0 : _loggedInUser$roles.map(r => r.code)) || [];
|
|
9480
|
+
const isEkycVendor = roles.includes("EKYC_VENDOR");
|
|
9481
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
9482
|
+
status: "ACTIVE"
|
|
9483
|
+
}, {
|
|
9484
|
+
enabled: isEkycVendor
|
|
9485
|
+
}),
|
|
9486
|
+
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
9487
|
+
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
9488
|
+
const matchedVendor = React.useMemo(() => {
|
|
9489
|
+
var _vendorSearchResponse, _vendorSearchResponse2;
|
|
9490
|
+
if (!vendorSearchResponse) return null;
|
|
9491
|
+
const userUuid = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
|
|
9492
|
+
const userMobile = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber;
|
|
9493
|
+
return ((_vendorSearchResponse = vendorSearchResponse.find(v => {
|
|
9494
|
+
var _actualVendor$owner, _actualVendor$owner2, _actualVendor$owner3;
|
|
9495
|
+
const actualVendor = v.dsoDetails || v;
|
|
9496
|
+
const ownerUuid = ((_actualVendor$owner = actualVendor.owner) === null || _actualVendor$owner === void 0 ? void 0 : _actualVendor$owner.uuid) || ((_actualVendor$owner2 = actualVendor.owner) === null || _actualVendor$owner2 === void 0 ? void 0 : _actualVendor$owner2.id);
|
|
9497
|
+
const ownerMobile = ((_actualVendor$owner3 = actualVendor.owner) === null || _actualVendor$owner3 === void 0 ? void 0 : _actualVendor$owner3.mobileNumber) || actualVendor.mobileNumber;
|
|
9498
|
+
return userUuid && ownerUuid === userUuid || userMobile && ownerMobile === userMobile;
|
|
9499
|
+
})) === null || _vendorSearchResponse === void 0 ? void 0 : _vendorSearchResponse.dsoDetails) || ((_vendorSearchResponse2 = vendorSearchResponse[0]) === null || _vendorSearchResponse2 === void 0 ? void 0 : _vendorSearchResponse2.dsoDetails) || vendorSearchResponse[0];
|
|
9500
|
+
}, [vendorSearchResponse, loggedInUser]);
|
|
9358
9501
|
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
9359
9502
|
boundaryData = _Digit$Hooks$useCommo.data,
|
|
9360
9503
|
isLoading = _Digit$Hooks$useCommo.isLoading;
|
|
@@ -9367,10 +9510,14 @@ const SelectEkycZones = _ref => {
|
|
|
9367
9510
|
code: zone.code,
|
|
9368
9511
|
name: zone.name
|
|
9369
9512
|
})));
|
|
9370
|
-
|
|
9513
|
+
let zonesList = [...new Map(allZones.map(z => [z.code, z])).values()];
|
|
9514
|
+
if (isEkycVendor && matchedVendor !== null && matchedVendor !== void 0 && matchedVendor.zoneIds) {
|
|
9515
|
+
const assignedZoneCodes = matchedVendor.zoneIds.map(z => String(z).toUpperCase());
|
|
9516
|
+
zonesList = zonesList.filter(z => assignedZoneCodes.includes(String(z.code).toUpperCase()) || assignedZoneCodes.includes(String(z.name).toUpperCase()));
|
|
9517
|
+
}
|
|
9371
9518
|
setZones(zonesList);
|
|
9372
9519
|
}
|
|
9373
|
-
}, [boundaryData]);
|
|
9520
|
+
}, [boundaryData, isEkycVendor, matchedVendor]);
|
|
9374
9521
|
useEffect(() => {
|
|
9375
9522
|
if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
|
|
9376
9523
|
if (isMultiSelect) {
|
|
@@ -9413,7 +9560,7 @@ const SelectEkycZones = _ref => {
|
|
|
9413
9560
|
onSelect(config.key, (selectedZone === null || selectedZone === void 0 ? void 0 : selectedZone.name) || "");
|
|
9414
9561
|
}
|
|
9415
9562
|
};
|
|
9416
|
-
if (isLoading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
9563
|
+
if (isLoading || isEkycVendor && isVendorSearchLoading) return /*#__PURE__*/React.createElement(Loader, null);
|
|
9417
9564
|
return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t(config.label), config.isMandatory ? /*#__PURE__*/React.createElement("span", {
|
|
9418
9565
|
className: "check-page-link-button"
|
|
9419
9566
|
}, " * ") : ""), /*#__PURE__*/React.createElement("div", {
|