@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.js
CHANGED
|
@@ -53,10 +53,20 @@ const SurveyorConfig = function (t, agencies, reportingManagers, disabled) {
|
|
|
53
53
|
populators: {
|
|
54
54
|
name: "fullName",
|
|
55
55
|
validation: {
|
|
56
|
-
required:
|
|
57
|
-
|
|
56
|
+
required: {
|
|
57
|
+
value: true,
|
|
58
|
+
message: t("ES_VENDOR_INVALID_NAME")
|
|
59
|
+
},
|
|
60
|
+
maxLength: {
|
|
61
|
+
value: 49,
|
|
62
|
+
message: t("ES_VENDOR_NAME_MAX_50_CHARACTERS")
|
|
63
|
+
},
|
|
64
|
+
pattern: {
|
|
65
|
+
value: /^[A-Za-z\s]+$/,
|
|
66
|
+
message: t("ES_VENDOR_INVALID_NAME")
|
|
67
|
+
}
|
|
58
68
|
},
|
|
59
|
-
|
|
69
|
+
maxlength: 50
|
|
60
70
|
}
|
|
61
71
|
}, {
|
|
62
72
|
label: "ES_VENDOR_SURVEYOR_MOBILE_NUMBER",
|
|
@@ -1119,8 +1129,10 @@ const VendorInbox = props => {
|
|
|
1119
1129
|
mutateVehicle = _Digit$Hooks$fsm$useU.mutate;
|
|
1120
1130
|
const _Digit$Hooks$fsm$useD3 = Digit.Hooks.fsm.useDriverUpdate(tenantId),
|
|
1121
1131
|
mutateDriver = _Digit$Hooks$fsm$useD3.mutate;
|
|
1122
|
-
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.
|
|
1123
|
-
|
|
1132
|
+
const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSupervisorUpdate(tenantId),
|
|
1133
|
+
mutateSupervisor = _Digit$Hooks$fsm$useS.mutate;
|
|
1134
|
+
const _Digit$Hooks$fsm$useS2 = Digit.Hooks.fsm.useSurveyorUpdate(tenantId),
|
|
1135
|
+
mutateSurveyor = _Digit$Hooks$fsm$useS2.mutate;
|
|
1124
1136
|
React.useEffect(() => {
|
|
1125
1137
|
var _props$data;
|
|
1126
1138
|
setTableData((props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.table) || []);
|
|
@@ -1307,6 +1319,78 @@ const VendorInbox = props => {
|
|
|
1307
1319
|
}
|
|
1308
1320
|
});
|
|
1309
1321
|
};
|
|
1322
|
+
const onSupervisorUpdate = row => {
|
|
1323
|
+
var _formDetails$owner9, _formDetails$owner0, _formDetails$owner1, _formDetails$owner10;
|
|
1324
|
+
let formDetails = row.original;
|
|
1325
|
+
const newStatus = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE" ? "DISABLED" : "ACTIVE";
|
|
1326
|
+
const newActive = newStatus === "ACTIVE";
|
|
1327
|
+
const formData = {
|
|
1328
|
+
supervisor: _extends({}, formDetails, {
|
|
1329
|
+
status: newStatus,
|
|
1330
|
+
active: newActive,
|
|
1331
|
+
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1332
|
+
active: newActive,
|
|
1333
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner9 = formDetails.owner) === null || _formDetails$owner9 === void 0 ? void 0 : _formDetails$owner9.gender) || "OTHERS",
|
|
1334
|
+
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(),
|
|
1335
|
+
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",
|
|
1336
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner10 = formDetails.owner) === null || _formDetails$owner10 === void 0 ? void 0 : _formDetails$owner10.relationship) || "OTHER"
|
|
1337
|
+
})
|
|
1338
|
+
})
|
|
1339
|
+
};
|
|
1340
|
+
mutateSupervisor(formData, {
|
|
1341
|
+
onError: (error, variables) => {
|
|
1342
|
+
setShowToast({
|
|
1343
|
+
key: "error",
|
|
1344
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || error
|
|
1345
|
+
});
|
|
1346
|
+
},
|
|
1347
|
+
onSuccess: (data, variables) => {
|
|
1348
|
+
setShowToast({
|
|
1349
|
+
key: "success",
|
|
1350
|
+
action: "SUPERVISOR"
|
|
1351
|
+
});
|
|
1352
|
+
queryClient.invalidateQueries("FSM_SUPERVISOR_SEARCH");
|
|
1353
|
+
queryClient.invalidateQueries("SUPERVISOR_SEARCH");
|
|
1354
|
+
props.refetchData();
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
};
|
|
1358
|
+
const onSurveyorUpdate = row => {
|
|
1359
|
+
var _formDetails$owner11, _formDetails$owner12, _formDetails$owner13, _formDetails$owner14;
|
|
1360
|
+
let formDetails = row.original;
|
|
1361
|
+
const newStatus = (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE" ? "DISABLED" : "ACTIVE";
|
|
1362
|
+
const newActive = newStatus === "ACTIVE";
|
|
1363
|
+
const formData = {
|
|
1364
|
+
surveyor: _extends({}, formDetails, {
|
|
1365
|
+
status: newStatus,
|
|
1366
|
+
active: newActive,
|
|
1367
|
+
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1368
|
+
active: newActive,
|
|
1369
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner11 = formDetails.owner) === null || _formDetails$owner11 === void 0 ? void 0 : _formDetails$owner11.gender) || "OTHERS",
|
|
1370
|
+
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(),
|
|
1371
|
+
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",
|
|
1372
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner14 = formDetails.owner) === null || _formDetails$owner14 === void 0 ? void 0 : _formDetails$owner14.relationship) || "OTHER"
|
|
1373
|
+
})
|
|
1374
|
+
})
|
|
1375
|
+
};
|
|
1376
|
+
mutateSurveyor(formData, {
|
|
1377
|
+
onError: (error, variables) => {
|
|
1378
|
+
setShowToast({
|
|
1379
|
+
key: "error",
|
|
1380
|
+
action: (error === null || error === void 0 ? void 0 : error.message) || error
|
|
1381
|
+
});
|
|
1382
|
+
},
|
|
1383
|
+
onSuccess: (data, variables) => {
|
|
1384
|
+
setShowToast({
|
|
1385
|
+
key: "success",
|
|
1386
|
+
action: "SURVEYOR"
|
|
1387
|
+
});
|
|
1388
|
+
queryClient.invalidateQueries("FSM_SURVEYOR_SEARCH");
|
|
1389
|
+
queryClient.invalidateQueries("SURVEYOR_SEARCH");
|
|
1390
|
+
props.refetchData();
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
};
|
|
1310
1394
|
const onVendorSelect = (row, selectedOption) => {
|
|
1311
1395
|
let driverData = row.original;
|
|
1312
1396
|
let existingVendor = driverData === null || driverData === void 0 ? void 0 : driverData.vendor;
|
|
@@ -1516,17 +1600,17 @@ const VendorInbox = props => {
|
|
|
1516
1600
|
});
|
|
1517
1601
|
};
|
|
1518
1602
|
const onSurveyorSupervisorSelect = (row, selectedSupervisor) => {
|
|
1519
|
-
var _selectedSupervisor$o, _formDetails$
|
|
1603
|
+
var _selectedSupervisor$o, _formDetails$owner15, _formDetails$owner16, _formDetails$owner17, _formDetails$owner18;
|
|
1520
1604
|
let formDetails = row.original;
|
|
1521
1605
|
const formData = {
|
|
1522
1606
|
surveyor: _extends({}, formDetails, {
|
|
1523
1607
|
supervisorId: (selectedSupervisor === null || selectedSupervisor === void 0 ? void 0 : selectedSupervisor.id) || null,
|
|
1524
1608
|
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,
|
|
1525
1609
|
owner: _extends({}, formDetails === null || formDetails === void 0 ? void 0 : formDetails.owner, {
|
|
1526
|
-
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1527
|
-
dob: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1528
|
-
emailId: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1529
|
-
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$
|
|
1610
|
+
gender: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner15 = formDetails.owner) === null || _formDetails$owner15 === void 0 ? void 0 : _formDetails$owner15.gender) || "OTHERS",
|
|
1611
|
+
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(),
|
|
1612
|
+
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",
|
|
1613
|
+
relationship: (formDetails === null || formDetails === void 0 ? void 0 : (_formDetails$owner18 = formDetails.owner) === null || _formDetails$owner18 === void 0 ? void 0 : _formDetails$owner18.relationship) || "OTHER"
|
|
1530
1614
|
})
|
|
1531
1615
|
})
|
|
1532
1616
|
};
|
|
@@ -1601,12 +1685,12 @@ const VendorInbox = props => {
|
|
|
1601
1685
|
allFillingPointsData = _Digit$Hooks$wt$useFi.data,
|
|
1602
1686
|
isAllFillingPointsLoading = _Digit$Hooks$wt$useFi.isLoading;
|
|
1603
1687
|
const allFillingPoints = (allFillingPointsData === null || allFillingPointsData === void 0 ? void 0 : allFillingPointsData.fillingPoints) || [];
|
|
1604
|
-
const _Digit$Hooks$fsm$
|
|
1688
|
+
const _Digit$Hooks$fsm$useS3 = Digit.Hooks.fsm.useSupervisorSearch(tenantId, {
|
|
1605
1689
|
status: "ACTIVE"
|
|
1606
1690
|
}, {
|
|
1607
1691
|
enabled: props.selectedTab === "SURVEYOR"
|
|
1608
1692
|
}),
|
|
1609
|
-
supervisorSearchResponse = _Digit$Hooks$fsm$
|
|
1693
|
+
supervisorSearchResponse = _Digit$Hooks$fsm$useS3.data;
|
|
1610
1694
|
const supervisors = React__default.useMemo(() => {
|
|
1611
1695
|
const list = (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisors) || (supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : supervisorSearchResponse.supervisor) || [];
|
|
1612
1696
|
return list.map(s => {
|
|
@@ -2037,6 +2121,29 @@ const VendorInbox = props => {
|
|
|
2037
2121
|
let row = _ref30.row;
|
|
2038
2122
|
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) : "");
|
|
2039
2123
|
}
|
|
2124
|
+
}, {
|
|
2125
|
+
Header: t("ES_FSM_REGISTRY_INBOX_ENABLED"),
|
|
2126
|
+
id: "status",
|
|
2127
|
+
accessor: row => row.status || "",
|
|
2128
|
+
Cell: _ref31 => {
|
|
2129
|
+
var _row$original21;
|
|
2130
|
+
let row = _ref31.row;
|
|
2131
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.ToggleSwitch, {
|
|
2132
|
+
style: {
|
|
2133
|
+
display: "flex",
|
|
2134
|
+
justifyContent: "left"
|
|
2135
|
+
},
|
|
2136
|
+
value: ((_row$original21 = row.original) === null || _row$original21 === void 0 ? void 0 : _row$original21.status) === "DISABLED" ? false : true,
|
|
2137
|
+
onChange: () => {
|
|
2138
|
+
if (props.selectedTab === "SUPERVISOR") {
|
|
2139
|
+
onSupervisorUpdate(row);
|
|
2140
|
+
} else if (props.selectedTab === "SURVEYOR") {
|
|
2141
|
+
onSurveyorUpdate(row);
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2144
|
+
name: "switch-" + row.id
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2040
2147
|
}];
|
|
2041
2148
|
default:
|
|
2042
2149
|
return [];
|
|
@@ -3259,15 +3366,22 @@ const SupervisorConfig = function (t, agencies, reportingManagers, disabled) {
|
|
|
3259
3366
|
populators: {
|
|
3260
3367
|
name: "fullName",
|
|
3261
3368
|
validation: {
|
|
3262
|
-
required:
|
|
3369
|
+
required: {
|
|
3370
|
+
value: true,
|
|
3371
|
+
message: t("ES_VENDOR_INVALID_NAME")
|
|
3372
|
+
},
|
|
3373
|
+
maxLength: {
|
|
3374
|
+
value: 49,
|
|
3375
|
+
message: t("ES_VENDOR_NAME_MAX_50_CHARACTERS")
|
|
3376
|
+
},
|
|
3263
3377
|
pattern: {
|
|
3264
3378
|
value: /^[A-Za-z\s]+$/,
|
|
3265
3379
|
message: t("ES_VENDOR_INVALID_NAME")
|
|
3266
3380
|
}
|
|
3267
3381
|
},
|
|
3268
|
-
error: t("ES_VENDOR_INVALID_NAME"),
|
|
3269
3382
|
defaultValue: "",
|
|
3270
|
-
className: "payment-form-text-input-correction"
|
|
3383
|
+
className: "payment-form-text-input-correction",
|
|
3384
|
+
maxlength: 50
|
|
3271
3385
|
}
|
|
3272
3386
|
}, {
|
|
3273
3387
|
label: t("ES_VENDOR_SUPERVISOR_MOBILE_NUMBER"),
|
|
@@ -3800,7 +3914,7 @@ const formatLabel = key => {
|
|
|
3800
3914
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
3801
3915
|
};
|
|
3802
3916
|
const VendorDetails = () => {
|
|
3803
|
-
var _dsoData$, _dsoData$$dsoDetails, _vendorAdditionalData, _vendorAdditionalData2, _vendorAdditionalData3, _parsedAdditionalDeta, _userInfo$info$type, _dsoData$5, _dsoData$5$employeeRe, _supervisorData$super, _surveyorData$surveyo;
|
|
3917
|
+
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;
|
|
3804
3918
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
3805
3919
|
const _useTranslation = reactI18next.useTranslation(),
|
|
3806
3920
|
t = _useTranslation.t;
|
|
@@ -3906,6 +4020,8 @@ const VendorDetails = () => {
|
|
|
3906
4020
|
}
|
|
3907
4021
|
const userInfo = Digit.SessionStorage.get("User");
|
|
3908
4022
|
const userType = (_userInfo$info$type = userInfo.info.type) === null || _userInfo$info$type === void 0 ? void 0 : _userInfo$info$type.toLowerCase();
|
|
4023
|
+
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)) || [];
|
|
4024
|
+
const isEkycVendor = userRoles.includes("EKYC_VENDOR");
|
|
3909
4025
|
React.useEffect(() => {
|
|
3910
4026
|
switch (selectedAction) {
|
|
3911
4027
|
case "DELETE":
|
|
@@ -4281,7 +4397,7 @@ const VendorDetails = () => {
|
|
|
4281
4397
|
manualPagination: false,
|
|
4282
4398
|
pageSizeLimit: 10,
|
|
4283
4399
|
t: t
|
|
4284
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
4400
|
+
}), isEkycVendor && /*#__PURE__*/React__default.createElement("div", {
|
|
4285
4401
|
className: "add-details-link hover-button",
|
|
4286
4402
|
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/new-supervisor?vendorId=" + (dsoId || vendorId))
|
|
4287
4403
|
}, t("ES_VENDOR_ADD_SUPERVISOR"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
@@ -4297,7 +4413,10 @@ const VendorDetails = () => {
|
|
|
4297
4413
|
manualPagination: false,
|
|
4298
4414
|
pageSizeLimit: 10,
|
|
4299
4415
|
t: t
|
|
4300
|
-
})
|
|
4416
|
+
}), isEkycVendor && /*#__PURE__*/React__default.createElement("div", {
|
|
4417
|
+
className: "add-details-link hover-button",
|
|
4418
|
+
onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/new-surveyor?vendorId=" + (dsoId || vendorId))
|
|
4419
|
+
}, t("ES_VENDOR_ADD_SURVEYOR"))))), showModal && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
4301
4420
|
headerBarMain: /*#__PURE__*/React__default.createElement("h1", {
|
|
4302
4421
|
className: "heading-m"
|
|
4303
4422
|
}, 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")),
|
|
@@ -9344,6 +9463,7 @@ const VehicleDetails = props => {
|
|
|
9344
9463
|
};
|
|
9345
9464
|
|
|
9346
9465
|
const SelectEkycZones = _ref => {
|
|
9466
|
+
var _Digit$SessionStorage, _loggedInUser$roles;
|
|
9347
9467
|
let config = _ref.config,
|
|
9348
9468
|
onSelect = _ref.onSelect,
|
|
9349
9469
|
t = _ref.t,
|
|
@@ -9358,6 +9478,29 @@ const SelectEkycZones = _ref => {
|
|
|
9358
9478
|
selectedZones = _useState2[0],
|
|
9359
9479
|
setSelectedZones = _useState2[1];
|
|
9360
9480
|
const initialized = React.useRef(false);
|
|
9481
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
9482
|
+
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)) || [];
|
|
9483
|
+
const isEkycVendor = roles.includes("EKYC_VENDOR");
|
|
9484
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
9485
|
+
status: "ACTIVE"
|
|
9486
|
+
}, {
|
|
9487
|
+
enabled: isEkycVendor
|
|
9488
|
+
}),
|
|
9489
|
+
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
9490
|
+
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
9491
|
+
const matchedVendor = React__default.useMemo(() => {
|
|
9492
|
+
var _vendorSearchResponse, _vendorSearchResponse2;
|
|
9493
|
+
if (!vendorSearchResponse) return null;
|
|
9494
|
+
const userUuid = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid;
|
|
9495
|
+
const userMobile = loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber;
|
|
9496
|
+
return ((_vendorSearchResponse = vendorSearchResponse.find(v => {
|
|
9497
|
+
var _actualVendor$owner, _actualVendor$owner2, _actualVendor$owner3;
|
|
9498
|
+
const actualVendor = v.dsoDetails || v;
|
|
9499
|
+
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);
|
|
9500
|
+
const ownerMobile = ((_actualVendor$owner3 = actualVendor.owner) === null || _actualVendor$owner3 === void 0 ? void 0 : _actualVendor$owner3.mobileNumber) || actualVendor.mobileNumber;
|
|
9501
|
+
return userUuid && ownerUuid === userUuid || userMobile && ownerMobile === userMobile;
|
|
9502
|
+
})) === null || _vendorSearchResponse === void 0 ? void 0 : _vendorSearchResponse.dsoDetails) || ((_vendorSearchResponse2 = vendorSearchResponse[0]) === null || _vendorSearchResponse2 === void 0 ? void 0 : _vendorSearchResponse2.dsoDetails) || vendorSearchResponse[0];
|
|
9503
|
+
}, [vendorSearchResponse, loggedInUser]);
|
|
9361
9504
|
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
9362
9505
|
boundaryData = _Digit$Hooks$useCommo.data,
|
|
9363
9506
|
isLoading = _Digit$Hooks$useCommo.isLoading;
|
|
@@ -9370,10 +9513,14 @@ const SelectEkycZones = _ref => {
|
|
|
9370
9513
|
code: zone.code,
|
|
9371
9514
|
name: zone.name
|
|
9372
9515
|
})));
|
|
9373
|
-
|
|
9516
|
+
let zonesList = [...new Map(allZones.map(z => [z.code, z])).values()];
|
|
9517
|
+
if (isEkycVendor && matchedVendor !== null && matchedVendor !== void 0 && matchedVendor.zoneIds) {
|
|
9518
|
+
const assignedZoneCodes = matchedVendor.zoneIds.map(z => String(z).toUpperCase());
|
|
9519
|
+
zonesList = zonesList.filter(z => assignedZoneCodes.includes(String(z.code).toUpperCase()) || assignedZoneCodes.includes(String(z.name).toUpperCase()));
|
|
9520
|
+
}
|
|
9374
9521
|
setZones(zonesList);
|
|
9375
9522
|
}
|
|
9376
|
-
}, [boundaryData]);
|
|
9523
|
+
}, [boundaryData, isEkycVendor, matchedVendor]);
|
|
9377
9524
|
React.useEffect(() => {
|
|
9378
9525
|
if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
|
|
9379
9526
|
if (isMultiSelect) {
|
|
@@ -9416,7 +9563,7 @@ const SelectEkycZones = _ref => {
|
|
|
9416
9563
|
onSelect(config.key, (selectedZone === null || selectedZone === void 0 ? void 0 : selectedZone.name) || "");
|
|
9417
9564
|
}
|
|
9418
9565
|
};
|
|
9419
|
-
if (isLoading) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
9566
|
+
if (isLoading || isEkycVendor && isVendorSearchLoading) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
9420
9567
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t(config.label), config.isMandatory ? /*#__PURE__*/React__default.createElement("span", {
|
|
9421
9568
|
className: "check-page-link-button"
|
|
9422
9569
|
}, " * ") : ""), /*#__PURE__*/React__default.createElement("div", {
|