@djb25/digit-ui-module-ekyc 1.0.75 → 1.0.76
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 +678 -1390
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +680 -1393
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -104,39 +104,32 @@ const EKYCCard = () => {
|
|
|
104
104
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
|
110
|
-
|
|
111
|
-
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
|
112
|
-
|
|
113
|
-
// Asynchronously call a function and send errors to recovery continuation
|
|
107
|
+
const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
108
|
+
const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
114
109
|
function _catch(body, recover) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
110
|
+
try {
|
|
111
|
+
var result = body();
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return recover(e);
|
|
114
|
+
}
|
|
115
|
+
if (result && result.then) {
|
|
116
|
+
return result.then(void 0, recover);
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
124
119
|
}
|
|
125
|
-
|
|
126
|
-
// Asynchronously await a promise and pass the result to a finally continuation
|
|
127
120
|
function _finallyRethrows(body, finalizer) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
121
|
+
try {
|
|
122
|
+
var result = body();
|
|
123
|
+
} catch (e) {
|
|
124
|
+
return finalizer(true, e);
|
|
125
|
+
}
|
|
126
|
+
if (result && result.then) {
|
|
127
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
128
|
+
}
|
|
129
|
+
return finalizer(false, result);
|
|
137
130
|
}
|
|
138
131
|
|
|
139
|
-
const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory"];
|
|
132
|
+
const excludedKeys = ["status", "source", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile", "doorPhotoFilestoreId", "panFilestoreId", "documentProofFilestoreId", "buildingImageFileStoreId", "propertyDocumentFileStoreId", "meterPhotoFileStoreId", "modifiedBy", "zoneCode", "propertyType", "subPropertyCategory", "firstName", "middleName", "lastName", "assembly", "ward", "pincode", "addressRaw", "mobileNo", "revisitCount", "consumerType", "occupantType", "knoCategory", "gender", "parentSpouse", "whatsappNo", "email", "landlineNo", "noOfPerson", "proofOfIdentityType", "documentNumber", "informantName", "informantRelation", "informantIsConsumer", "contactPerson", "relation", "entityName", "designation", "department", "employeeId", "ownerMobile", "ownerVerificationDone", "consentGiven", "flatHouseNumber", "streetName", "locality", "subLocality", "landmark", "latitude", "longitude", "gpsValid", "meterNumber", "meterMake", "meterStatus", "meterCondition", "meterLocation", "meterLocationAddress", "workingStatus", "sewerConnection", "septicTank", "lastBillRaised", "lastBillReceivedDate", "accessToMeter", "systemMeterId", "lastBillNotRaisedReason", "waterConnectionYears", "sewerConnectionYears", "pidNumber", "noOfFloor", "noOfRooms", "noOfBeds", "numberOfDwellingUnits", "floorNo", "userType", "tenantName", "tenantMobile", "houseBuiltDuration", "meterLatitude", "meterLongitude"];
|
|
140
133
|
const createHeaderMapping = t => ({
|
|
141
134
|
kno: t("KNO"),
|
|
142
135
|
firstName: t("FIRST_NAME"),
|
|
@@ -181,15 +174,9 @@ const createHeaderMapping = t => ({
|
|
|
181
174
|
relationship: t("RELATIONSHIP"),
|
|
182
175
|
informantName: t("INFORMANT_NAME"),
|
|
183
176
|
informantRelation: t("INFORMANT_RELATION"),
|
|
184
|
-
informantIs: t("INFORMANT_IS"),
|
|
185
177
|
contactPerson: t("CONTACT_PERSON"),
|
|
186
178
|
relation: t("RELATION"),
|
|
187
|
-
entityName: t("ENTITY_NAME"),
|
|
188
|
-
designation: t("DESIGNATION"),
|
|
189
|
-
department: t("DEPARTMENT"),
|
|
190
|
-
employeeId: t("EMPLOYEE_ID"),
|
|
191
179
|
ownerMobile: t("OWNER_MOBILE"),
|
|
192
|
-
ownerVerificationDone: t("OWNER_VERIFICATION_DONE"),
|
|
193
180
|
consentGiven: t("CONSENT_GIVEN"),
|
|
194
181
|
proofOfIdentityType: t("PROOF_OF_IDENTITY_TYPE"),
|
|
195
182
|
documentNumber: t("DOCUMENT_NUMBER"),
|
|
@@ -1128,302 +1115,88 @@ function _extends() {
|
|
|
1128
1115
|
}, _extends.apply(null, arguments);
|
|
1129
1116
|
}
|
|
1130
1117
|
|
|
1131
|
-
const
|
|
1118
|
+
const EkycFilterModal = _ref => {
|
|
1132
1119
|
let {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
t
|
|
1120
|
+
t,
|
|
1121
|
+
onApply,
|
|
1122
|
+
onClose,
|
|
1123
|
+
customDate,
|
|
1124
|
+
setCustomDate,
|
|
1125
|
+
ekycStatus,
|
|
1126
|
+
setEkycStatus
|
|
1141
1127
|
} = _ref;
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
1211
|
-
}
|
|
1212
|
-
return Promise.resolve();
|
|
1213
|
-
} catch (e) {
|
|
1214
|
-
return Promise.reject(e);
|
|
1215
|
-
}
|
|
1216
|
-
};
|
|
1217
|
-
const downloadSupervisorPDF = function (_ref2) {
|
|
1218
|
-
let {
|
|
1219
|
-
rows,
|
|
1220
|
-
supervisorName,
|
|
1221
|
-
mobileNumber,
|
|
1222
|
-
vendorName,
|
|
1223
|
-
dashboardInfo,
|
|
1224
|
-
t
|
|
1225
|
-
} = _ref2;
|
|
1226
|
-
try {
|
|
1227
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
1228
|
-
const name = "Delhi Jal Board";
|
|
1229
|
-
const email = "contact@delhijalboard.nic.in";
|
|
1230
|
-
const phoneNumber = "+91-11-23538416";
|
|
1231
|
-
const currentDate = new Date();
|
|
1232
|
-
const formattedDate = currentDate.toLocaleDateString("en-IN", {
|
|
1233
|
-
day: "2-digit",
|
|
1234
|
-
month: "2-digit",
|
|
1235
|
-
year: "numeric"
|
|
1236
|
-
});
|
|
1237
|
-
const formattedTime = currentDate.toLocaleTimeString("en-IN", {
|
|
1238
|
-
hour: "2-digit",
|
|
1239
|
-
minute: "2-digit",
|
|
1240
|
-
second: "2-digit",
|
|
1241
|
-
hour12: false
|
|
1242
|
-
});
|
|
1243
|
-
const downloadDateTime = `${formattedDate} ${formattedTime}`;
|
|
1244
|
-
const isValDefined = val => val !== undefined && val !== null && val !== "";
|
|
1245
|
-
const details = [{
|
|
1246
|
-
title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
|
|
1247
|
-
asSectionHeader: true,
|
|
1248
|
-
values: [{
|
|
1249
|
-
title: t("SUPERVISOR_NAME") || "Supervisor Name",
|
|
1250
|
-
value: supervisorName
|
|
1251
|
-
}, {
|
|
1252
|
-
title: t("MOBILE_NUMBER") || "Mobile Number",
|
|
1253
|
-
value: mobileNumber
|
|
1254
|
-
}, {
|
|
1255
|
-
title: t("VENDOR_NAME") || "Vendor Name",
|
|
1256
|
-
value: vendorName
|
|
1257
|
-
}].filter(item => isValDefined(item.value))
|
|
1258
|
-
}, {
|
|
1259
|
-
title: t("SUMMARY_STATISTICS") || "Summary Statistics",
|
|
1260
|
-
asSectionHeader: true,
|
|
1261
|
-
values: [{
|
|
1262
|
-
title: t("TOTAL_ASSIGNED") || "Total Assigned",
|
|
1263
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
|
|
1264
|
-
}, {
|
|
1265
|
-
title: t("COMPLETED") || "Completed",
|
|
1266
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
|
|
1267
|
-
}, {
|
|
1268
|
-
title: t("PENDING") || "Pending",
|
|
1269
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
|
|
1270
|
-
}, {
|
|
1271
|
-
title: t("SUBMITTED") || "Submitted",
|
|
1272
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
|
|
1273
|
-
}].filter(item => isValDefined(item.value))
|
|
1274
|
-
}];
|
|
1275
|
-
const mappedRows = rows.map(row => {
|
|
1276
|
-
var _row$owner, _row$owner2;
|
|
1277
|
-
return {
|
|
1278
|
-
kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
|
|
1279
|
-
firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
|
|
1280
|
-
lastName: "",
|
|
1281
|
-
mobileNo: row.status || "N/A",
|
|
1282
|
-
zoneName: String(row.total || 0),
|
|
1283
|
-
ekycStatus: `${row.completed || 0} / ${row.pending || 0}`,
|
|
1284
|
-
progress: row.progress || "0%",
|
|
1285
|
-
submittedAt: null
|
|
1286
|
-
};
|
|
1287
|
-
});
|
|
1288
|
-
const customT = key => {
|
|
1289
|
-
if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
|
|
1290
|
-
if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
|
|
1291
|
-
if (key === "MOBILE") return t("STATUS") || "Status";
|
|
1292
|
-
if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
|
|
1293
|
-
if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
|
|
1294
|
-
if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
|
|
1295
|
-
if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
|
|
1296
|
-
return t(key);
|
|
1297
|
-
};
|
|
1298
|
-
try {
|
|
1299
|
-
if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
|
|
1300
|
-
window.Digit.Utils.pdf.generateSurveyorReport({
|
|
1301
|
-
tenantId,
|
|
1302
|
-
logo: null,
|
|
1303
|
-
name,
|
|
1304
|
-
email,
|
|
1305
|
-
phoneNumber,
|
|
1306
|
-
heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
|
|
1307
|
-
details,
|
|
1308
|
-
applicationNumber: mobileNumber,
|
|
1309
|
-
rows: mappedRows,
|
|
1310
|
-
t: customT,
|
|
1311
|
-
hideApplicationNumber: true,
|
|
1312
|
-
downloadTime: downloadDateTime
|
|
1313
|
-
});
|
|
1314
|
-
} else {
|
|
1315
|
-
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
1316
|
-
}
|
|
1317
|
-
} catch {}
|
|
1318
|
-
return Promise.resolve();
|
|
1319
|
-
} catch (e) {
|
|
1320
|
-
return Promise.reject(e);
|
|
1321
|
-
}
|
|
1322
|
-
};
|
|
1323
|
-
const downloadVendorPDF = function (_ref3) {
|
|
1324
|
-
let {
|
|
1325
|
-
rows,
|
|
1326
|
-
vendorName,
|
|
1327
|
-
mobileNumber,
|
|
1328
|
-
email,
|
|
1329
|
-
dashboardInfo,
|
|
1330
|
-
t
|
|
1331
|
-
} = _ref3;
|
|
1332
|
-
try {
|
|
1333
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
1334
|
-
const name = "Delhi Jal Board";
|
|
1335
|
-
const emailContact = "contact@delhijalboard.nic.in";
|
|
1336
|
-
const phoneNumber = "+91-11-23538416";
|
|
1337
|
-
const currentDate = new Date();
|
|
1338
|
-
const formattedDate = currentDate.toLocaleDateString("en-IN", {
|
|
1339
|
-
day: "2-digit",
|
|
1340
|
-
month: "2-digit",
|
|
1341
|
-
year: "numeric"
|
|
1342
|
-
});
|
|
1343
|
-
const formattedTime = currentDate.toLocaleTimeString("en-IN", {
|
|
1344
|
-
hour: "2-digit",
|
|
1345
|
-
minute: "2-digit",
|
|
1346
|
-
second: "2-digit",
|
|
1347
|
-
hour12: false
|
|
1348
|
-
});
|
|
1349
|
-
const downloadDateTime = `${formattedDate} ${formattedTime}`;
|
|
1350
|
-
const isValDefined = val => val !== undefined && val !== null && val !== "";
|
|
1351
|
-
const details = [{
|
|
1352
|
-
title: t("VENDOR_DETAILS") || "Vendor Details",
|
|
1353
|
-
asSectionHeader: true,
|
|
1354
|
-
values: [{
|
|
1355
|
-
title: t("VENDOR_NAME") || "Vendor Name",
|
|
1356
|
-
value: vendorName
|
|
1357
|
-
}, {
|
|
1358
|
-
title: t("MOBILE_NUMBER") || "Mobile Number",
|
|
1359
|
-
value: mobileNumber
|
|
1360
|
-
}, {
|
|
1361
|
-
title: t("EMAIL") || "Email",
|
|
1362
|
-
value: email
|
|
1363
|
-
}].filter(item => isValDefined(item.value))
|
|
1364
|
-
}, {
|
|
1365
|
-
title: t("SUMMARY_STATISTICS") || "Summary Statistics",
|
|
1366
|
-
asSectionHeader: true,
|
|
1367
|
-
values: [{
|
|
1368
|
-
title: t("TOTAL_ASSIGNED") || "Total Assigned",
|
|
1369
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
|
|
1370
|
-
}, {
|
|
1371
|
-
title: t("TOTAL_EKYC_APPLICATIONS") || "Completed",
|
|
1372
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
|
|
1373
|
-
}, {
|
|
1374
|
-
title: t("PENDING") || "Pending",
|
|
1375
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
|
|
1376
|
-
}, {
|
|
1377
|
-
title: t("SUBMITTED") || "Submitted",
|
|
1378
|
-
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
|
|
1379
|
-
}].filter(item => isValDefined(item.value))
|
|
1380
|
-
}];
|
|
1381
|
-
const mappedRows = rows.map(row => ({
|
|
1382
|
-
kno: row.name || "N/A",
|
|
1383
|
-
firstName: row.mobileNo || "N/A",
|
|
1384
|
-
lastName: "",
|
|
1385
|
-
mobileNo: row.status || "N/A",
|
|
1386
|
-
zoneName: String(row.total || 0),
|
|
1387
|
-
ekycStatus: `${row.completed || 0} / ${row.pending || 0}`,
|
|
1388
|
-
progress: row.progress || "0%"
|
|
1389
|
-
}));
|
|
1390
|
-
const customT = key => {
|
|
1391
|
-
if (key === "KNO") return t("SUPERVISOR_NAME") || "Supervisor Name";
|
|
1392
|
-
if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
|
|
1393
|
-
if (key === "MOBILE") return t("STATUS") || "Status";
|
|
1394
|
-
if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
|
|
1395
|
-
if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
|
|
1396
|
-
if (key === "CONSUMER_LIST") return t("CONNECTED_SUPERVISORS") || "Connected Supervisors";
|
|
1397
|
-
return t(key);
|
|
1398
|
-
};
|
|
1399
|
-
try {
|
|
1400
|
-
if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
|
|
1401
|
-
window.Digit.Utils.pdf.generateSurveyorReport({
|
|
1402
|
-
tenantId,
|
|
1403
|
-
logo: null,
|
|
1404
|
-
name,
|
|
1405
|
-
email: emailContact,
|
|
1406
|
-
phoneNumber,
|
|
1407
|
-
heading: t("EKYC_VENDOR_REPORT") || "eKYC Vendor Report",
|
|
1408
|
-
details,
|
|
1409
|
-
applicationNumber: mobileNumber,
|
|
1410
|
-
rows: mappedRows,
|
|
1411
|
-
t: customT,
|
|
1412
|
-
hideApplicationNumber: true,
|
|
1413
|
-
downloadTime: downloadDateTime
|
|
1414
|
-
});
|
|
1415
|
-
} else {
|
|
1416
|
-
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
1417
|
-
}
|
|
1418
|
-
} catch {}
|
|
1419
|
-
return Promise.resolve();
|
|
1420
|
-
} catch (e) {
|
|
1421
|
-
return Promise.reject(e);
|
|
1422
|
-
}
|
|
1128
|
+
const [isDatePickerOpen, setIsDatePickerOpen] = React.useState(false);
|
|
1129
|
+
const ekycStatusOptions = [{
|
|
1130
|
+
label: "All",
|
|
1131
|
+
value: "ALL"
|
|
1132
|
+
}, {
|
|
1133
|
+
label: "Submitted",
|
|
1134
|
+
value: "SUBMITTED"
|
|
1135
|
+
}, {
|
|
1136
|
+
label: "In Progress",
|
|
1137
|
+
value: "IN_PROGRESS"
|
|
1138
|
+
}, {
|
|
1139
|
+
label: "Revisit",
|
|
1140
|
+
value: "REVISIT"
|
|
1141
|
+
}];
|
|
1142
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
1143
|
+
className: `ekyc-report-filter ${isDatePickerOpen ? "ekyc-report-filter--date-open" : ""}`
|
|
1144
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
1145
|
+
headerBarMain: "Download eKYC Report",
|
|
1146
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement("button", {
|
|
1147
|
+
type: "button",
|
|
1148
|
+
onClick: onClose,
|
|
1149
|
+
"aria-label": "Close",
|
|
1150
|
+
className: "ekyc-filter-modal-close"
|
|
1151
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CloseSvg, {
|
|
1152
|
+
height: "24",
|
|
1153
|
+
width: "24"
|
|
1154
|
+
})),
|
|
1155
|
+
actionSaveLabel: t("DOWNLOAD_REPORT"),
|
|
1156
|
+
actionSaveOnSubmit: onApply,
|
|
1157
|
+
actionCancelLabel: "Cancel",
|
|
1158
|
+
actionCancelOnSubmit: onClose,
|
|
1159
|
+
width: "fitContent"
|
|
1160
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1161
|
+
className: "ekyc-filter-modal"
|
|
1162
|
+
}, /*#__PURE__*/React__default.createElement("section", {
|
|
1163
|
+
className: "ekyc-filter-modal-section"
|
|
1164
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1165
|
+
className: "ekyc-filter-modal-section-header"
|
|
1166
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1167
|
+
className: "ekyc-filter-modal-label"
|
|
1168
|
+
}, "eKYC Status"), /*#__PURE__*/React__default.createElement("span", {
|
|
1169
|
+
className: "ekyc-filter-modal-hint"
|
|
1170
|
+
}, "Select one")), /*#__PURE__*/React__default.createElement("div", {
|
|
1171
|
+
className: "ekyc-filter-modal-options"
|
|
1172
|
+
}, ekycStatusOptions.map(option => {
|
|
1173
|
+
const selected = ekycStatus === option.value;
|
|
1174
|
+
return /*#__PURE__*/React__default.createElement("button", {
|
|
1175
|
+
key: option.value,
|
|
1176
|
+
type: "button",
|
|
1177
|
+
onClick: () => setEkycStatus(option.value),
|
|
1178
|
+
className: selected ? "ekyc-filter-modal-option ekyc-filter-modal-option-selected" : "ekyc-filter-modal-option",
|
|
1179
|
+
"aria-pressed": selected
|
|
1180
|
+
}, option.label);
|
|
1181
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
1182
|
+
className: "ekyc-filter-modal-divider"
|
|
1183
|
+
}), /*#__PURE__*/React__default.createElement("section", {
|
|
1184
|
+
className: "ekyc-filter-modal-section"
|
|
1185
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1186
|
+
className: "ekyc-filter-modal-label"
|
|
1187
|
+
}, "Date Range"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.DateRange, {
|
|
1188
|
+
values: customDate,
|
|
1189
|
+
t: t,
|
|
1190
|
+
hideLabel: true,
|
|
1191
|
+
onFilterChange: data => {
|
|
1192
|
+
setCustomDate(data.range);
|
|
1193
|
+
},
|
|
1194
|
+
onOpenChange: setIsDatePickerOpen
|
|
1195
|
+
})))));
|
|
1423
1196
|
};
|
|
1424
1197
|
|
|
1425
1198
|
const VendorDetailsCard = () => {
|
|
1426
|
-
var _vendor$owner, _vendor$owner2,
|
|
1199
|
+
var _Digit$SessionStorage, _vendor$owner, _vendor$owner2, _vendor$owner3, _vendor$owner4, _progressData$supervi;
|
|
1427
1200
|
const {
|
|
1428
1201
|
t
|
|
1429
1202
|
} = reactI18next.useTranslation();
|
|
@@ -1432,6 +1205,10 @@ const VendorDetailsCard = () => {
|
|
|
1432
1205
|
const {
|
|
1433
1206
|
vendorId
|
|
1434
1207
|
} = reactRouterDom.useParams();
|
|
1208
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
1209
|
+
const targetVendorId = vendorId || (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid);
|
|
1210
|
+
const [showFilterModal, setShowFilterModal] = React.useState(false);
|
|
1211
|
+
const [ekycStatus, setEkycStatus] = React.useState("ALL");
|
|
1435
1212
|
const {
|
|
1436
1213
|
data: {
|
|
1437
1214
|
vendor: [vendor] = []
|
|
@@ -1441,26 +1218,27 @@ const VendorDetailsCard = () => {
|
|
|
1441
1218
|
tenantId,
|
|
1442
1219
|
filters: {
|
|
1443
1220
|
status: "ACTIVE",
|
|
1444
|
-
ids:
|
|
1221
|
+
ids: targetVendorId
|
|
1445
1222
|
},
|
|
1446
1223
|
config: {
|
|
1447
1224
|
enabled: !!tenantId,
|
|
1448
1225
|
staleTime: 300000
|
|
1449
1226
|
}
|
|
1450
1227
|
});
|
|
1451
|
-
const targetVendorId = vendorId || (vendor === null || vendor === void 0 ? void 0 : vendor.id) || (vendor === null || vendor === void 0 ? void 0 : vendor.vendorId);
|
|
1452
1228
|
const {
|
|
1453
1229
|
isLoading: isProgressLoading,
|
|
1454
1230
|
data: progressData
|
|
1455
|
-
} = Digit.Hooks.ekyc.useEkycAssignmentProgress(
|
|
1231
|
+
} = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
1456
1232
|
vendorId: targetVendorId
|
|
1457
|
-
}
|
|
1233
|
+
}, {
|
|
1458
1234
|
enabled: !!tenantId,
|
|
1459
1235
|
keepPreviousData: true
|
|
1460
1236
|
});
|
|
1461
1237
|
const vendorName = (vendor === null || vendor === void 0 ? void 0 : vendor.name) || "N/A";
|
|
1462
1238
|
const mobileNumber = (vendor === null || vendor === void 0 ? void 0 : vendor.mobileNumber) || (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner = vendor.owner) === null || _vendor$owner === void 0 ? void 0 : _vendor$owner.mobileNumber) || "N/A";
|
|
1463
1239
|
const email = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner2 = vendor.owner) === null || _vendor$owner2 === void 0 ? void 0 : _vendor$owner2.emailId) || "N/A";
|
|
1240
|
+
const gender = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner3 = vendor.owner) === null || _vendor$owner3 === void 0 ? void 0 : _vendor$owner3.gender) || "N/A";
|
|
1241
|
+
const ownerName = (vendor === null || vendor === void 0 ? void 0 : (_vendor$owner4 = vendor.owner) === null || _vendor$owner4 === void 0 ? void 0 : _vendor$owner4.name) || "N/A";
|
|
1464
1242
|
const zoneIds = React.useMemo(() => {
|
|
1465
1243
|
var _vendor$zoneIds;
|
|
1466
1244
|
return vendor !== null && vendor !== void 0 && (_vendor$zoneIds = vendor.zoneIds) !== null && _vendor$zoneIds !== void 0 && _vendor$zoneIds.length ? vendor.zoneIds.filter(Boolean).map(zone => String(zone).trim().toUpperCase()) : [];
|
|
@@ -1507,6 +1285,7 @@ const VendorDetailsCard = () => {
|
|
|
1507
1285
|
const [ekycDownloadLoading, setEkycDownloadLoading] = React.useState(false);
|
|
1508
1286
|
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
1509
1287
|
try {
|
|
1288
|
+
console.log(ekycStatus, fromDate, toDate);
|
|
1510
1289
|
setEkycDownloadLoading(true);
|
|
1511
1290
|
return Promise.resolve(_finallyRethrows(function () {
|
|
1512
1291
|
return _catch(function () {
|
|
@@ -1515,6 +1294,7 @@ const VendorDetailsCard = () => {
|
|
|
1515
1294
|
offset: 0,
|
|
1516
1295
|
limit: 10000,
|
|
1517
1296
|
vendorId: targetVendorId,
|
|
1297
|
+
ekycStatus: ekycStatus,
|
|
1518
1298
|
reportDownload: true,
|
|
1519
1299
|
...(fromDate && {
|
|
1520
1300
|
fromDate
|
|
@@ -1528,6 +1308,14 @@ const VendorDetailsCard = () => {
|
|
|
1528
1308
|
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
1529
1309
|
return;
|
|
1530
1310
|
}
|
|
1311
|
+
consumerList.forEach(item => {
|
|
1312
|
+
if (item.assignedTime) {
|
|
1313
|
+
item.assignedTime = new Date(item.assignedTime).toLocaleDateString("en-GB");
|
|
1314
|
+
}
|
|
1315
|
+
if (item.submittedAt) {
|
|
1316
|
+
item.submittedAt = new Date(item.submittedAt).toLocaleDateString("en-GB");
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1531
1319
|
const excelData = getEkycExcelData(consumerList, t);
|
|
1532
1320
|
const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
1533
1321
|
Digit.Download.Excel(excelData, cleanFileName);
|
|
@@ -1545,47 +1333,28 @@ const VendorDetailsCard = () => {
|
|
|
1545
1333
|
return Promise.reject(e);
|
|
1546
1334
|
}
|
|
1547
1335
|
};
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
return
|
|
1554
|
-
from: start,
|
|
1555
|
-
to: now
|
|
1556
|
-
};
|
|
1557
|
-
}
|
|
1558
|
-
if (filter === "week") {
|
|
1559
|
-
start.setDate(now.getDate() - now.getDay());
|
|
1560
|
-
start.setHours(0, 0, 0, 0);
|
|
1561
|
-
return {
|
|
1562
|
-
from: start,
|
|
1563
|
-
to: now
|
|
1564
|
-
};
|
|
1565
|
-
}
|
|
1566
|
-
if (filter === "month") {
|
|
1567
|
-
start.setDate(1);
|
|
1568
|
-
start.setHours(0, 0, 0, 0);
|
|
1569
|
-
return {
|
|
1570
|
-
from: start,
|
|
1571
|
-
to: now
|
|
1572
|
-
};
|
|
1336
|
+
const handleApplyFilters = function () {
|
|
1337
|
+
try {
|
|
1338
|
+
setShowFilterModal(false);
|
|
1339
|
+
return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
|
|
1340
|
+
} catch (e) {
|
|
1341
|
+
return Promise.reject(e);
|
|
1573
1342
|
}
|
|
1574
|
-
return null;
|
|
1575
1343
|
};
|
|
1576
|
-
const supervisorColumns =
|
|
1344
|
+
const supervisorColumns = [{
|
|
1577
1345
|
Header: t("SUPERVISOR_NAME") || "Supervisor Name",
|
|
1578
1346
|
accessor: row => {
|
|
1579
1347
|
var _row$original;
|
|
1580
1348
|
return (row === null || row === void 0 ? void 0 : (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.supervisorName) || "N/A";
|
|
1581
1349
|
},
|
|
1582
1350
|
Cell: _ref => {
|
|
1583
|
-
var _Digit$
|
|
1351
|
+
var _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _row$original2, _row$original3, _row$original4;
|
|
1584
1352
|
let {
|
|
1585
1353
|
row
|
|
1586
1354
|
} = _ref;
|
|
1587
|
-
|
|
1588
|
-
const
|
|
1355
|
+
console.log(row);
|
|
1356
|
+
const userType = ((_Digit$SessionStorage2 = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.info) === null || _Digit$SessionStorage3 === void 0 ? void 0 : (_Digit$SessionStorage4 = _Digit$SessionStorage3.type) === null || _Digit$SessionStorage4 === void 0 ? void 0 : _Digit$SessionStorage4.toLowerCase()) || "citizen";
|
|
1357
|
+
const targetPath = `/digit-ui/${userType}/ekyc/supervisor-dashboard/${row === null || row === void 0 ? void 0 : (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.supervisorId}/${row === null || row === void 0 ? void 0 : (_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.vendorId}`;
|
|
1589
1358
|
return /*#__PURE__*/React__default.createElement("a", {
|
|
1590
1359
|
href: targetPath,
|
|
1591
1360
|
style: {
|
|
@@ -1597,7 +1366,7 @@ const VendorDetailsCard = () => {
|
|
|
1597
1366
|
e.preventDefault();
|
|
1598
1367
|
history.push(targetPath);
|
|
1599
1368
|
}
|
|
1600
|
-
}, (row === null || row === void 0 ? void 0 : (_row$
|
|
1369
|
+
}, (row === null || row === void 0 ? void 0 : (_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.supervisorName) || "N/A");
|
|
1601
1370
|
}
|
|
1602
1371
|
}, {
|
|
1603
1372
|
Header: t("MOBILE_NUMBER") || "Mobile Number",
|
|
@@ -1615,6 +1384,16 @@ const VendorDetailsCard = () => {
|
|
|
1615
1384
|
className: `status-badge verified`
|
|
1616
1385
|
}, t(value) || value);
|
|
1617
1386
|
}
|
|
1387
|
+
}, {
|
|
1388
|
+
Header: t("ASSIGNED_ZONE") || "Assigned Zone",
|
|
1389
|
+
accessor: row => (row === null || row === void 0 ? void 0 : row.assignedZoneId) || "",
|
|
1390
|
+
id: "zone",
|
|
1391
|
+
Cell: _ref3 => {
|
|
1392
|
+
let {
|
|
1393
|
+
value
|
|
1394
|
+
} = _ref3;
|
|
1395
|
+
return t(value) || value;
|
|
1396
|
+
}
|
|
1618
1397
|
}, {
|
|
1619
1398
|
Header: t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications",
|
|
1620
1399
|
accessor: row => (row === null || row === void 0 ? void 0 : row.totalKnos) || 0,
|
|
@@ -1631,91 +1410,24 @@ const VendorDetailsCard = () => {
|
|
|
1631
1410
|
Header: t("OVERALL_PROGRESS") || "Overall Progress",
|
|
1632
1411
|
accessor: row => `${(row === null || row === void 0 ? void 0 : row.progressPercent) || 0}%`,
|
|
1633
1412
|
id: "overallProgress"
|
|
1634
|
-
}]
|
|
1635
|
-
const [
|
|
1636
|
-
const [customDate, setCustomDate] = React.useState({
|
|
1637
|
-
from: "",
|
|
1638
|
-
to: ""
|
|
1639
|
-
});
|
|
1640
|
-
const [showCustomPicker, setShowCustomPicker] = React.useState(false);
|
|
1641
|
-
const [reportLoading, setReportLoading] = React.useState(false);
|
|
1413
|
+
}];
|
|
1414
|
+
const [customDate, setCustomDate] = React.useState("");
|
|
1642
1415
|
const reportMenuRef = React.useRef(null);
|
|
1643
1416
|
React.useEffect(() => {
|
|
1644
1417
|
const handler = e => {
|
|
1645
|
-
if (reportMenuRef.current && !reportMenuRef.current.contains(e.target))
|
|
1646
|
-
setShowReportMenu(false);
|
|
1647
|
-
setShowCustomPicker(false);
|
|
1648
|
-
}
|
|
1418
|
+
if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) ;
|
|
1649
1419
|
};
|
|
1650
1420
|
document.addEventListener("mousedown", handler);
|
|
1651
1421
|
return () => document.removeEventListener("mousedown", handler);
|
|
1652
1422
|
}, []);
|
|
1653
|
-
const
|
|
1654
|
-
setReportLoading(true);
|
|
1655
|
-
try {
|
|
1656
|
-
const rowsWithStats = progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport.map(s => ({
|
|
1657
|
-
name: s.supervisorName,
|
|
1658
|
-
mobileNo: s.mobileNo,
|
|
1659
|
-
total: s.totalKnos,
|
|
1660
|
-
completed: s.submittedKnos,
|
|
1661
|
-
pending: s.pendingKnos,
|
|
1662
|
-
progress: `${s.progressPercent || 0}%`
|
|
1663
|
-
}));
|
|
1664
|
-
downloadVendorPDF({
|
|
1665
|
-
rows: rowsWithStats,
|
|
1666
|
-
vendorName,
|
|
1667
|
-
mobileNumber,
|
|
1668
|
-
email,
|
|
1669
|
-
dashboardInfo: {
|
|
1670
|
-
total: progressData === null || progressData === void 0 ? void 0 : progressData.totalKnosInZones,
|
|
1671
|
-
completed: (progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones) + (progressData === null || progressData === void 0 ? void 0 : progressData.selfEkycCountInZones),
|
|
1672
|
-
pending: progressData === null || progressData === void 0 ? void 0 : progressData.pendingKnosInZones,
|
|
1673
|
-
submittedCount: progressData === null || progressData === void 0 ? void 0 : progressData.submittedKnosInZones
|
|
1674
|
-
},
|
|
1675
|
-
t
|
|
1676
|
-
});
|
|
1677
|
-
} catch (err) {
|
|
1678
|
-
console.error("Failed to generate report:", err);
|
|
1679
|
-
} finally {
|
|
1680
|
-
setReportLoading(false);
|
|
1681
|
-
}
|
|
1682
|
-
};
|
|
1683
|
-
const handlePresetDownload = function (filter) {
|
|
1684
|
-
try {
|
|
1685
|
-
const range = getDateRange(filter);
|
|
1686
|
-
if (!range) return Promise.resolve();
|
|
1687
|
-
setShowReportMenu(false);
|
|
1688
|
-
setShowCustomPicker(false);
|
|
1689
|
-
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
1690
|
-
} catch (e) {
|
|
1691
|
-
return Promise.reject(e);
|
|
1692
|
-
}
|
|
1693
|
-
};
|
|
1694
|
-
const handleCustomDownload = function () {
|
|
1695
|
-
try {
|
|
1696
|
-
if (!customDate.from || !customDate.to) {
|
|
1697
|
-
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
1698
|
-
return Promise.resolve();
|
|
1699
|
-
}
|
|
1700
|
-
const from = new Date(customDate.from);
|
|
1701
|
-
from.setHours(0, 0, 0, 0);
|
|
1702
|
-
const to = new Date(customDate.to);
|
|
1703
|
-
to.setHours(23, 59, 59, 999);
|
|
1704
|
-
setShowReportMenu(false);
|
|
1705
|
-
setShowCustomPicker(false);
|
|
1706
|
-
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
1707
|
-
} catch (e) {
|
|
1708
|
-
return Promise.reject(e);
|
|
1709
|
-
}
|
|
1710
|
-
};
|
|
1711
|
-
const StatCard = _ref3 => {
|
|
1423
|
+
const StatCard = _ref4 => {
|
|
1712
1424
|
let {
|
|
1713
1425
|
title,
|
|
1714
1426
|
value,
|
|
1715
1427
|
type,
|
|
1716
1428
|
isLoading,
|
|
1717
1429
|
icon
|
|
1718
|
-
} =
|
|
1430
|
+
} = _ref4;
|
|
1719
1431
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1720
1432
|
className: `stat-card ${type}`
|
|
1721
1433
|
}, isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -1741,45 +1453,48 @@ const VendorDetailsCard = () => {
|
|
|
1741
1453
|
}
|
|
1742
1454
|
}, t("NO_VENDOR_FOUND") || "No Vendor Found"));
|
|
1743
1455
|
}
|
|
1744
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
1456
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
1745
1457
|
className: "surveyor-dashboard"
|
|
1746
1458
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1747
1459
|
className: "ekyc-dashboard-section"
|
|
1460
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1461
|
+
className: "ekyc-details-wrapper"
|
|
1462
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1463
|
+
className: "details-top-row"
|
|
1464
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1465
|
+
className: "detail-item first-row"
|
|
1748
1466
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1749
1467
|
className: "ekyc-dashboard-header"
|
|
1750
1468
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1751
|
-
className: "avatar"
|
|
1752
|
-
}, vendorName === null || vendorName === void 0 ? void 0 : (_vendorName$charAt = vendorName.charAt(0)) === null || _vendorName$charAt === void 0 ? void 0 : _vendorName$charAt.toUpperCase()), /*#__PURE__*/React__default.createElement("div", {
|
|
1753
1469
|
className: "header-content"
|
|
1754
1470
|
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
1755
1471
|
className: "name"
|
|
1756
1472
|
}, vendorName), /*#__PURE__*/React__default.createElement("div", {
|
|
1757
1473
|
className: "designation"
|
|
1758
|
-
}, t("VENDOR_AGENCY") || "Agency / Vendor"))), /*#__PURE__*/React__default.createElement("div", {
|
|
1759
|
-
className: "report-download"
|
|
1474
|
+
}, "(", t("VENDOR_AGENCY") || "Agency / Vendor", ")"))), /*#__PURE__*/React__default.createElement("div", {
|
|
1475
|
+
className: "report-download relative"
|
|
1760
1476
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
1761
|
-
|
|
1762
|
-
disabled:
|
|
1763
|
-
onClick:
|
|
1764
|
-
},
|
|
1765
|
-
className: "stats-wrapper"
|
|
1766
|
-
}, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
|
|
1767
|
-
key: idx,
|
|
1768
|
-
title: t(card.label),
|
|
1769
|
-
value: card.count,
|
|
1770
|
-
type: card.type,
|
|
1771
|
-
isLoading: isPageLoading,
|
|
1772
|
-
icon: card.icon
|
|
1773
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
1774
|
-
className: "ekyc-dashboard-section"
|
|
1775
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1776
|
-
className: "ekyc-details-wrapper"
|
|
1777
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1477
|
+
disabled: ekycDownloadLoading,
|
|
1478
|
+
className: `download-btn relative ${ekycDownloadLoading ? "disabled" : ""}`,
|
|
1479
|
+
onClick: () => setShowFilterModal(true)
|
|
1480
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading" : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React__default.createElement("div", {
|
|
1778
1481
|
className: "details-top-row"
|
|
1779
1482
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1780
1483
|
className: "detail-item"
|
|
1781
1484
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1782
1485
|
className: "label"
|
|
1486
|
+
}, t("NAME")), /*#__PURE__*/React__default.createElement("span", {
|
|
1487
|
+
className: "value"
|
|
1488
|
+
}, ownerName)), /*#__PURE__*/React__default.createElement("div", {
|
|
1489
|
+
className: "detail-item"
|
|
1490
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1491
|
+
className: "label"
|
|
1492
|
+
}, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
|
|
1493
|
+
className: "value"
|
|
1494
|
+
}, gender)), /*#__PURE__*/React__default.createElement("div", {
|
|
1495
|
+
className: "detail-item"
|
|
1496
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1497
|
+
className: "label"
|
|
1783
1498
|
}, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
|
|
1784
1499
|
className: "value"
|
|
1785
1500
|
}, mobileNumber)), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -1788,97 +1503,34 @@ const VendorDetailsCard = () => {
|
|
|
1788
1503
|
className: "label"
|
|
1789
1504
|
}, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
|
|
1790
1505
|
className: "value"
|
|
1791
|
-
}, email)), /*#__PURE__*/React__default.createElement("div", {
|
|
1792
|
-
className: "
|
|
1793
|
-
}, /*#__PURE__*/React__default.createElement("
|
|
1794
|
-
className: "
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
}, [{
|
|
1806
|
-
label: t("TODAY") || "Today",
|
|
1807
|
-
key: "today"
|
|
1808
|
-
}, {
|
|
1809
|
-
label: t("THIS_WEEK") || "This Week",
|
|
1810
|
-
key: "week"
|
|
1811
|
-
}, {
|
|
1812
|
-
label: t("THIS_MONTH") || "This Month",
|
|
1813
|
-
key: "month"
|
|
1814
|
-
}].map(_ref4 => {
|
|
1815
|
-
let {
|
|
1816
|
-
label,
|
|
1817
|
-
key
|
|
1818
|
-
} = _ref4;
|
|
1819
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
1820
|
-
key: key,
|
|
1821
|
-
className: "menu-item",
|
|
1822
|
-
onClick: () => handlePresetDownload(key)
|
|
1823
|
-
}, label);
|
|
1824
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1825
|
-
className: "custom-date-trigger",
|
|
1826
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
1827
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
|
|
1828
|
-
className: "custom-picker"
|
|
1829
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1830
|
-
className: "date-inputs"
|
|
1831
|
-
}, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
|
|
1832
|
-
type: "date",
|
|
1833
|
-
value: customDate.from,
|
|
1834
|
-
onChange: e => setCustomDate({
|
|
1835
|
-
...customDate,
|
|
1836
|
-
from: e.target.value
|
|
1837
|
-
})
|
|
1838
|
-
})), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
|
|
1839
|
-
type: "date",
|
|
1840
|
-
value: customDate.to,
|
|
1841
|
-
onChange: e => setCustomDate({
|
|
1842
|
-
...customDate,
|
|
1843
|
-
to: e.target.value
|
|
1844
|
-
})
|
|
1845
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
1846
|
-
style: {
|
|
1847
|
-
display: "flex",
|
|
1848
|
-
gap: "10px",
|
|
1849
|
-
marginTop: "10px"
|
|
1850
|
-
}
|
|
1851
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
1852
|
-
className: "picker-cancel-btn",
|
|
1853
|
-
onClick: () => {
|
|
1854
|
-
setShowCustomPicker(false);
|
|
1855
|
-
setCustomDate({
|
|
1856
|
-
from: "",
|
|
1857
|
-
to: ""
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
|
|
1861
|
-
className: "picker-apply-btn",
|
|
1862
|
-
onClick: handleCustomDownload
|
|
1863
|
-
}, t("APPLY") || "Apply"))))))), /*#__PURE__*/React__default.createElement("div", {
|
|
1864
|
-
className: "full-width-item"
|
|
1865
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1866
|
-
className: "label"
|
|
1867
|
-
}, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React__default.createElement("span", {
|
|
1868
|
-
className: "value"
|
|
1869
|
-
}, zoneIds.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
1870
|
-
className: "selected-zones",
|
|
1871
|
-
style: {
|
|
1872
|
-
marginTop: "4px",
|
|
1873
|
-
width: "100%",
|
|
1874
|
-
display: "flex",
|
|
1875
|
-
flexWrap: "wrap",
|
|
1876
|
-
gap: "8px"
|
|
1506
|
+
}, email))), /*#__PURE__*/React__default.createElement("div", {
|
|
1507
|
+
className: "full-width-item"
|
|
1508
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
1509
|
+
className: "label"
|
|
1510
|
+
}, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React__default.createElement("span", {
|
|
1511
|
+
className: "value"
|
|
1512
|
+
}, zoneIds.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
1513
|
+
className: "selected-zones",
|
|
1514
|
+
style: {
|
|
1515
|
+
marginTop: "4px",
|
|
1516
|
+
width: "100%",
|
|
1517
|
+
display: "flex",
|
|
1518
|
+
flexWrap: "wrap",
|
|
1519
|
+
gap: "8px"
|
|
1877
1520
|
}
|
|
1878
1521
|
}, zoneIds.map(zone => /*#__PURE__*/React__default.createElement("span", {
|
|
1879
1522
|
key: zone,
|
|
1880
1523
|
className: "selected-zone-chip"
|
|
1881
|
-
}, t(zone) || zone))) : "N/A")))), /*#__PURE__*/React__default.createElement("div",
|
|
1524
|
+
}, t(zone) || zone))) : "N/A")))), /*#__PURE__*/React__default.createElement("div", {
|
|
1525
|
+
className: "stats-wrapper"
|
|
1526
|
+
}, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
|
|
1527
|
+
key: idx,
|
|
1528
|
+
title: t(card.label),
|
|
1529
|
+
value: card.count,
|
|
1530
|
+
type: card.type,
|
|
1531
|
+
isLoading: isPageLoading,
|
|
1532
|
+
icon: card.icon
|
|
1533
|
+
}))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
|
|
1882
1534
|
t: t,
|
|
1883
1535
|
tableTitle: t("CONNECTED_SUPERVISORS") || "Connected Supervisors",
|
|
1884
1536
|
tableClass: "ekycTable",
|
|
@@ -1910,7 +1562,15 @@ const VendorDetailsCard = () => {
|
|
|
1910
1562
|
setPageSize(Number(e.target.value));
|
|
1911
1563
|
setCurrentPage(0);
|
|
1912
1564
|
}
|
|
1913
|
-
})))
|
|
1565
|
+
}))), showFilterModal && /*#__PURE__*/React__default.createElement(EkycFilterModal, {
|
|
1566
|
+
t: t,
|
|
1567
|
+
onClose: () => setShowFilterModal(false),
|
|
1568
|
+
onApply: handleApplyFilters,
|
|
1569
|
+
customDate: customDate,
|
|
1570
|
+
setCustomDate: setCustomDate,
|
|
1571
|
+
ekycStatus: ekycStatus,
|
|
1572
|
+
setEkycStatus: setEkycStatus
|
|
1573
|
+
}));
|
|
1914
1574
|
};
|
|
1915
1575
|
|
|
1916
1576
|
const useInboxTableConfig = _ref => {
|
|
@@ -2089,261 +1749,248 @@ const useInboxTableConfig = _ref => {
|
|
|
2089
1749
|
};
|
|
2090
1750
|
};
|
|
2091
1751
|
|
|
2092
|
-
var isNullOrUndefined =
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
var
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
const lastIndex = length - 1;
|
|
2115
|
-
while (++index < length) {
|
|
2116
|
-
const key = tempPath[index];
|
|
2117
|
-
let newValue = value;
|
|
2118
|
-
if (index !== lastIndex) {
|
|
2119
|
-
const objValue = object[key];
|
|
2120
|
-
newValue =
|
|
2121
|
-
isObject(objValue) || Array.isArray(objValue)
|
|
2122
|
-
? objValue
|
|
2123
|
-
: !isNaN(+tempPath[index + 1])
|
|
2124
|
-
? []
|
|
2125
|
-
: {};
|
|
2126
|
-
}
|
|
2127
|
-
object[key] = newValue;
|
|
2128
|
-
object = object[key];
|
|
2129
|
-
}
|
|
2130
|
-
return object;
|
|
1752
|
+
var isNullOrUndefined = value => value == null;
|
|
1753
|
+
const isObjectType = value => typeof value === 'object';
|
|
1754
|
+
var isObject = value => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !(value instanceof Date);
|
|
1755
|
+
var isKey = value => /^\w*$/.test(value);
|
|
1756
|
+
var compact = value => value.filter(Boolean);
|
|
1757
|
+
var stringToPath = input => compact(input.replace(/["|']/g, '').replace(/\[/g, '.').replace(/\]/g, '').split('.'));
|
|
1758
|
+
function set(object, path, value) {
|
|
1759
|
+
let index = -1;
|
|
1760
|
+
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
1761
|
+
const length = tempPath.length;
|
|
1762
|
+
const lastIndex = length - 1;
|
|
1763
|
+
while (++index < length) {
|
|
1764
|
+
const key = tempPath[index];
|
|
1765
|
+
let newValue = value;
|
|
1766
|
+
if (index !== lastIndex) {
|
|
1767
|
+
const objValue = object[key];
|
|
1768
|
+
newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
|
|
1769
|
+
}
|
|
1770
|
+
object[key] = newValue;
|
|
1771
|
+
object = object[key];
|
|
1772
|
+
}
|
|
1773
|
+
return object;
|
|
2131
1774
|
}
|
|
2132
|
-
|
|
2133
|
-
var
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
? defaultValue
|
|
2140
|
-
: obj[path]
|
|
2141
|
-
: result;
|
|
1775
|
+
var isUndefined = val => val === undefined;
|
|
1776
|
+
var get = function (obj, path, defaultValue) {
|
|
1777
|
+
if (obj === void 0) {
|
|
1778
|
+
obj = {};
|
|
1779
|
+
}
|
|
1780
|
+
const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
|
|
1781
|
+
return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
|
|
2142
1782
|
};
|
|
2143
|
-
|
|
2144
|
-
var
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
1783
|
+
var isPrimitive = value => isNullOrUndefined(value) || !isObjectType(value);
|
|
1784
|
+
var isFunction = value => typeof value === 'function';
|
|
1785
|
+
var skipValidation = _ref8 => {
|
|
1786
|
+
let {
|
|
1787
|
+
isOnBlur,
|
|
1788
|
+
isOnChange,
|
|
1789
|
+
isOnTouch,
|
|
1790
|
+
isTouched,
|
|
1791
|
+
isReValidateOnBlur,
|
|
1792
|
+
isReValidateOnChange,
|
|
1793
|
+
isBlurEvent,
|
|
1794
|
+
isSubmitted,
|
|
1795
|
+
isOnAll
|
|
1796
|
+
} = _ref8;
|
|
1797
|
+
if (isOnAll) {
|
|
1798
|
+
return false;
|
|
1799
|
+
} else if (!isSubmitted && isOnTouch) {
|
|
1800
|
+
return !(isTouched || isBlurEvent);
|
|
1801
|
+
} else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
|
|
1802
|
+
return !isBlurEvent;
|
|
1803
|
+
} else if (isSubmitted ? isReValidateOnChange : isOnChange) {
|
|
1804
|
+
return isBlurEvent;
|
|
1805
|
+
}
|
|
1806
|
+
return true;
|
|
2162
1807
|
};
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2174
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2175
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2176
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2177
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2178
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2179
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2180
|
-
***************************************************************************** */
|
|
2181
|
-
|
|
2182
|
-
function __rest(s, e) {
|
|
2183
|
-
var t = {};
|
|
2184
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2185
|
-
t[p] = s[p];
|
|
2186
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2187
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2188
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2189
|
-
t[p[i]] = s[p[i]];
|
|
2190
|
-
}
|
|
2191
|
-
return t;
|
|
1808
|
+
const isMatchFieldArrayName = (name, searchName) => RegExp(`^${searchName}([|.)\\d+`.replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
|
|
1809
|
+
var isNameInFieldArray = (names, name) => [...names].some(current => isMatchFieldArrayName(name, current));
|
|
1810
|
+
function __rest(s, e) {
|
|
1811
|
+
var t = {};
|
|
1812
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1813
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1814
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1815
|
+
}
|
|
1816
|
+
return t;
|
|
2192
1817
|
}
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
1818
|
+
const FormContext = React.createContext(null);
|
|
1819
|
+
FormContext.displayName = 'RHFContext';
|
|
1820
|
+
const useFormContext = () => React.useContext(FormContext);
|
|
1821
|
+
var getInputValue = event => isPrimitive(event) || !isObject(event.target) || isObject(event.target) && !event.type ? event : isUndefined(event.target.value) ? event.target.checked : event.target.value;
|
|
1822
|
+
function useController(_ref17) {
|
|
1823
|
+
let {
|
|
1824
|
+
name,
|
|
1825
|
+
rules,
|
|
1826
|
+
defaultValue,
|
|
1827
|
+
control,
|
|
1828
|
+
onFocus
|
|
1829
|
+
} = _ref17;
|
|
1830
|
+
const methods = useFormContext();
|
|
1831
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1832
|
+
if (!control && !methods) {
|
|
1833
|
+
throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
const {
|
|
1837
|
+
defaultValuesRef,
|
|
1838
|
+
setValue,
|
|
1839
|
+
register,
|
|
1840
|
+
unregister,
|
|
1841
|
+
trigger,
|
|
1842
|
+
mode,
|
|
1843
|
+
reValidateMode: {
|
|
1844
|
+
isReValidateOnBlur,
|
|
1845
|
+
isReValidateOnChange
|
|
1846
|
+
},
|
|
1847
|
+
formState,
|
|
1848
|
+
formStateRef: {
|
|
1849
|
+
current: {
|
|
1850
|
+
isSubmitted,
|
|
1851
|
+
touched,
|
|
1852
|
+
errors
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
updateFormState,
|
|
1856
|
+
readFormStateRef,
|
|
1857
|
+
fieldsRef,
|
|
1858
|
+
fieldArrayNamesRef,
|
|
1859
|
+
shallowFieldsStateRef
|
|
1860
|
+
} = control || methods.control;
|
|
1861
|
+
const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
|
|
1862
|
+
const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray ? get(shallowFieldsStateRef.current, name) : isUndefined(defaultValue) ? get(defaultValuesRef.current, name) : defaultValue;
|
|
1863
|
+
const [value, setInputStateValue] = React.useState(getInitialValue());
|
|
1864
|
+
const valueRef = React.useRef(value);
|
|
1865
|
+
const ref = React.useRef({
|
|
1866
|
+
focus: () => null
|
|
1867
|
+
});
|
|
1868
|
+
const onFocusRef = React.useRef(onFocus || (() => {
|
|
1869
|
+
if (isFunction(ref.current.focus)) {
|
|
1870
|
+
ref.current.focus();
|
|
1871
|
+
}
|
|
1872
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1873
|
+
if (!isFunction(ref.current.focus)) {
|
|
1874
|
+
console.warn(`📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method`);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
}));
|
|
1878
|
+
const shouldValidate = React.useCallback(isBlurEvent => !skipValidation(Object.assign({
|
|
1879
|
+
isBlurEvent,
|
|
1880
|
+
isReValidateOnBlur,
|
|
1881
|
+
isReValidateOnChange,
|
|
1882
|
+
isSubmitted,
|
|
1883
|
+
isTouched: !!get(touched, name)
|
|
1884
|
+
}, mode)), [isReValidateOnBlur, isReValidateOnChange, isSubmitted, touched, name, mode]);
|
|
1885
|
+
const commonTask = React.useCallback(_ref18 => {
|
|
1886
|
+
let [event] = _ref18;
|
|
1887
|
+
const data = getInputValue(event);
|
|
1888
|
+
setInputStateValue(data);
|
|
1889
|
+
valueRef.current = data;
|
|
1890
|
+
return data;
|
|
1891
|
+
}, []);
|
|
1892
|
+
const registerField = React.useCallback(shouldUpdateValue => {
|
|
1893
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1894
|
+
if (!name) {
|
|
1895
|
+
return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
if (fieldsRef.current[name]) {
|
|
1899
|
+
fieldsRef.current[name] = Object.assign({
|
|
1900
|
+
ref: fieldsRef.current[name].ref
|
|
1901
|
+
}, rules);
|
|
1902
|
+
} else {
|
|
1903
|
+
register(Object.defineProperties({
|
|
1904
|
+
name,
|
|
1905
|
+
focus: onFocusRef.current
|
|
1906
|
+
}, {
|
|
1907
|
+
value: {
|
|
1908
|
+
set(data) {
|
|
1909
|
+
setInputStateValue(data);
|
|
1910
|
+
valueRef.current = data;
|
|
1911
|
+
},
|
|
1912
|
+
get() {
|
|
1913
|
+
return valueRef.current;
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}), rules);
|
|
1917
|
+
shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
|
|
1918
|
+
}
|
|
1919
|
+
shouldUpdateValue && isNotFieldArray && setInputStateValue(getInitialValue());
|
|
1920
|
+
}, [rules, name, register]);
|
|
1921
|
+
React.useEffect(() => () => unregister(name), [name]);
|
|
1922
|
+
React.useEffect(() => {
|
|
1923
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1924
|
+
if (isUndefined(value)) {
|
|
1925
|
+
console.warn(`📋 ${name} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`);
|
|
1926
|
+
}
|
|
1927
|
+
if (!isNotFieldArray && isUndefined(defaultValue)) {
|
|
1928
|
+
console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
registerField();
|
|
1932
|
+
}, [registerField]);
|
|
1933
|
+
React.useEffect(() => {
|
|
1934
|
+
!fieldsRef.current[name] && registerField(true);
|
|
1935
|
+
});
|
|
1936
|
+
const onBlur = React.useCallback(() => {
|
|
1937
|
+
if (readFormStateRef.current.touched && !get(touched, name)) {
|
|
1938
|
+
set(touched, name, true);
|
|
1939
|
+
updateFormState({
|
|
1940
|
+
touched
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
shouldValidate(true) && trigger(name);
|
|
1944
|
+
}, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
|
|
1945
|
+
const onChange = React.useCallback(function () {
|
|
1946
|
+
for (var _len = arguments.length, event = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1947
|
+
event[_key] = arguments[_key];
|
|
1948
|
+
}
|
|
1949
|
+
return setValue(name, commonTask(event), {
|
|
1950
|
+
shouldValidate: shouldValidate(),
|
|
1951
|
+
shouldDirty: true
|
|
1952
|
+
});
|
|
1953
|
+
}, [setValue, name, shouldValidate]);
|
|
1954
|
+
return {
|
|
1955
|
+
field: {
|
|
1956
|
+
onChange,
|
|
1957
|
+
onBlur,
|
|
1958
|
+
name,
|
|
1959
|
+
value,
|
|
1960
|
+
ref
|
|
1961
|
+
},
|
|
1962
|
+
meta: Object.defineProperties({
|
|
1963
|
+
invalid: !!get(errors, name)
|
|
1964
|
+
}, {
|
|
1965
|
+
isDirty: {
|
|
1966
|
+
get() {
|
|
1967
|
+
return !!get(formState.dirtyFields, name);
|
|
1968
|
+
}
|
|
1969
|
+
},
|
|
1970
|
+
isTouched: {
|
|
1971
|
+
get() {
|
|
1972
|
+
return !!get(formState.touched, name);
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
})
|
|
1976
|
+
};
|
|
2334
1977
|
}
|
|
2335
|
-
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
1978
|
+
const Controller = props => {
|
|
1979
|
+
const {
|
|
1980
|
+
rules,
|
|
1981
|
+
as,
|
|
1982
|
+
render,
|
|
1983
|
+
defaultValue,
|
|
1984
|
+
control,
|
|
1985
|
+
onFocus
|
|
1986
|
+
} = props,
|
|
1987
|
+
rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
|
|
1988
|
+
const {
|
|
1989
|
+
field,
|
|
1990
|
+
meta
|
|
1991
|
+
} = useController(props);
|
|
1992
|
+
const componentProps = Object.assign(Object.assign({}, rest), field);
|
|
1993
|
+
return as ? React.isValidElement(as) ? React.cloneElement(as, componentProps) : React.createElement(as, componentProps) : render ? render(field, meta) : null;
|
|
2347
1994
|
};
|
|
2348
1995
|
|
|
2349
1996
|
const SearchFormFieldsComponents = _ref => {
|
|
@@ -4718,9 +4365,7 @@ const VendorCardSkeleton = () => {
|
|
|
4718
4365
|
className: "skeleton skeleton-subtitle"
|
|
4719
4366
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
4720
4367
|
className: "skeleton skeleton-kno-badge"
|
|
4721
|
-
})), /*#__PURE__*/React__default.createElement("div", {
|
|
4722
|
-
className: "progress-section"
|
|
4723
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4368
|
+
})), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
4724
4369
|
className: "skeleton skeleton-progress-bar"
|
|
4725
4370
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
4726
4371
|
className: "progress-label"
|
|
@@ -4781,87 +4426,83 @@ const AdminDashboard = () => {
|
|
|
4781
4426
|
className: "section-title"
|
|
4782
4427
|
}, t("EKYC_VENDORS_PERFORMANCE") || "eKYC Vendors Performance"), isProgressLoading ? /*#__PURE__*/React__default.createElement(VendorPerformanceSkeleton, null) : /*#__PURE__*/React__default.createElement("div", {
|
|
4783
4428
|
className: "vendors-grid"
|
|
4784
|
-
}, Array.isArray(progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.length) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.map(vendor => {
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
}
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
className: "kno-stat pending"
|
|
4843
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4844
|
-
className: "kno-label"
|
|
4845
|
-
}, t("PENDING") || "Pending"), /*#__PURE__*/React__default.createElement("strong", null, vendor.pendingKnosInZones)), /*#__PURE__*/React__default.createElement("div", {
|
|
4846
|
-
className: "kno-stat rejected"
|
|
4847
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4848
|
-
className: "kno-label"
|
|
4849
|
-
}, t("EKYC_SUBMITTED_BY_CITIZENS").toLowerCase() || "Submitted by citizen"), /*#__PURE__*/React__default.createElement("strong", null, vendor.selfEkycCountInZones))));
|
|
4850
|
-
})))));
|
|
4429
|
+
}, Array.isArray(progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.length) && (progressData === null || progressData === void 0 ? void 0 : progressData.vendorReports.map(vendor => /*#__PURE__*/React__default.createElement("div", {
|
|
4430
|
+
key: vendor.vendorId,
|
|
4431
|
+
className: "vendor-perf-card",
|
|
4432
|
+
onClick: () => history.push(`/digit-ui/employee/ekyc/vendors/${vendor.vendorId}`)
|
|
4433
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4434
|
+
className: "vendor-card-header"
|
|
4435
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4436
|
+
className: "vendor-title"
|
|
4437
|
+
}, /*#__PURE__*/React__default.createElement("h4", null, vendor.vendorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
4438
|
+
className: "kno-count-badge"
|
|
4439
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4440
|
+
className: "kno-count-label"
|
|
4441
|
+
}, t("TOTAL_KNOS") || "Total KNOs", " -"), /*#__PURE__*/React__default.createElement("span", {
|
|
4442
|
+
className: "kno-count-value"
|
|
4443
|
+
}, vendor.totalKnosInZones))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
4444
|
+
className: "progress-bar-container"
|
|
4445
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4446
|
+
className: "progress-bar-fill",
|
|
4447
|
+
style: {
|
|
4448
|
+
width: `${vendor.progressPercent}%`
|
|
4449
|
+
}
|
|
4450
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
4451
|
+
className: "progress-label"
|
|
4452
|
+
}, /*#__PURE__*/React__default.createElement("span", null, t("PROGRESS") || "Progress"), /*#__PURE__*/React__default.createElement("span", null, vendor.progressPercent, "%"))), /*#__PURE__*/React__default.createElement("div", {
|
|
4453
|
+
className: "stats-grid"
|
|
4454
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4455
|
+
className: "stat-item"
|
|
4456
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4457
|
+
className: "stat-value"
|
|
4458
|
+
}, vendor.totalSupervisors), /*#__PURE__*/React__default.createElement("span", {
|
|
4459
|
+
className: "stat-label"
|
|
4460
|
+
}, t("SUPERVISORS") || "Supervisors")), /*#__PURE__*/React__default.createElement("div", {
|
|
4461
|
+
className: "stat-item"
|
|
4462
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4463
|
+
className: "stat-value"
|
|
4464
|
+
}, vendor.totalSurveyors), /*#__PURE__*/React__default.createElement("span", {
|
|
4465
|
+
className: "stat-label"
|
|
4466
|
+
}, t("SURVEYORS") || "Surveyors")), /*#__PURE__*/React__default.createElement("div", {
|
|
4467
|
+
className: "stat-item"
|
|
4468
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4469
|
+
className: "stat-value"
|
|
4470
|
+
}, vendor.totalAssignments), /*#__PURE__*/React__default.createElement("span", {
|
|
4471
|
+
className: "stat-label"
|
|
4472
|
+
}, t("TOTAL_EKYC_APPLICATIONS") || "Total KNOs"))), /*#__PURE__*/React__default.createElement("div", {
|
|
4473
|
+
className: "knos-summary"
|
|
4474
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4475
|
+
className: "kno-stat"
|
|
4476
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4477
|
+
className: "kno-label"
|
|
4478
|
+
}, t("SUBMITTED") || "Submitted"), /*#__PURE__*/React__default.createElement("strong", null, vendor.submittedKnosInZones)), /*#__PURE__*/React__default.createElement("div", {
|
|
4479
|
+
className: "kno-stat pending"
|
|
4480
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4481
|
+
className: "kno-label"
|
|
4482
|
+
}, t("PENDING") || "Pending"), /*#__PURE__*/React__default.createElement("strong", null, vendor.pendingKnosInZones)), /*#__PURE__*/React__default.createElement("div", {
|
|
4483
|
+
className: "kno-stat rejected"
|
|
4484
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4485
|
+
className: "kno-label"
|
|
4486
|
+
}, t("EKYC_SUBMITTED_BY_CITIZENS").toLowerCase() || "Submitted by citizen"), /*#__PURE__*/React__default.createElement("strong", null, vendor.selfEkycCountInZones)))))))));
|
|
4851
4487
|
};
|
|
4852
4488
|
|
|
4853
4489
|
const SupervisorDetailsCard = () => {
|
|
4854
|
-
var _Digit$SessionStorage, _Digit$UserService$ge, _Digit$UserService$ge2, _progressData$supervi
|
|
4490
|
+
var _Digit$SessionStorage, _Digit$UserService$ge, _Digit$UserService$ge2, _progressData$supervi;
|
|
4855
4491
|
const {
|
|
4856
4492
|
t
|
|
4857
4493
|
} = reactI18next.useTranslation();
|
|
4858
4494
|
const history = reactRouterDom.useHistory();
|
|
4859
4495
|
const tenantId = Digit.ULBService.getCurrentTenantId() || "dl.djb";
|
|
4860
4496
|
const {
|
|
4861
|
-
id: supervisorId
|
|
4497
|
+
id: supervisorId,
|
|
4498
|
+
vendorId
|
|
4862
4499
|
} = reactRouterDom.useParams();
|
|
4863
4500
|
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
4864
4501
|
const [ekycDownloadLoading, setEkycDownloadLoading] = React.useState(false);
|
|
4502
|
+
const [showFilterModal, setShowFilterModal] = React.useState(false);
|
|
4503
|
+
const [currentPage, setCurrentPage] = React.useState(0);
|
|
4504
|
+
const [pageSize, setPageSize] = React.useState(20);
|
|
4505
|
+
const [ekycStatus, setEkycStatus] = React.useState("ALL");
|
|
4865
4506
|
const {
|
|
4866
4507
|
data: supervisorSearchResponse,
|
|
4867
4508
|
isLoading: isSupervisorSearchLoading
|
|
@@ -4884,11 +4525,15 @@ const SupervisorDetailsCard = () => {
|
|
|
4884
4525
|
isLoading: isProgressLoading,
|
|
4885
4526
|
data: progressData
|
|
4886
4527
|
} = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
4887
|
-
vendorId: targetVendorId
|
|
4528
|
+
vendorId: vendorId || targetVendorId
|
|
4888
4529
|
}, {
|
|
4889
4530
|
enabled: !!tenantId,
|
|
4890
4531
|
keepPreviousData: true
|
|
4891
4532
|
});
|
|
4533
|
+
const userRoles = (_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$ge2.roles;
|
|
4534
|
+
const isSupervisor = userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => role.code === "EKYC_SUPERVISOR");
|
|
4535
|
+
const currentSupervisor = isSupervisor ? (progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport[0]) || [] : progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.find(ele => ele.supervisorId === supervisorId);
|
|
4536
|
+
const surveyorsData = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.surveyors) || [];
|
|
4892
4537
|
const {
|
|
4893
4538
|
data: surveyorSearchResponse,
|
|
4894
4539
|
isLoading: isSurveyorSearchLoading
|
|
@@ -5036,12 +4681,12 @@ const SupervisorDetailsCard = () => {
|
|
|
5036
4681
|
}
|
|
5037
4682
|
return null;
|
|
5038
4683
|
}, [progressData, supervisorSearchResponse, surveyorSearchResponse, supervisorId, loggedInUser]);
|
|
5039
|
-
const fullName = (
|
|
5040
|
-
const mobileNumber = (
|
|
4684
|
+
const fullName = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.supervisorName) || "N/A";
|
|
4685
|
+
const mobileNumber = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.mobileNo) || "N/A";
|
|
5041
4686
|
const email = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.email) || ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid) ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.emailId : null) || "N/A";
|
|
5042
4687
|
const gender = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.gender) || ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid) ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.gender : null) || "N/A";
|
|
5043
4688
|
const status = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.status) || "N/A";
|
|
5044
|
-
const assignedZone = (
|
|
4689
|
+
const assignedZone = t(currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.assignedZoneId) || "N/A";
|
|
5045
4690
|
const vendorName = React.useMemo(() => {
|
|
5046
4691
|
var _matchedVendor$dsoDet;
|
|
5047
4692
|
if (!vendorSearchResponse || !supervisor) return "N/A";
|
|
@@ -5056,12 +4701,6 @@ const SupervisorDetailsCard = () => {
|
|
|
5056
4701
|
const surveyors = React.useMemo(() => {
|
|
5057
4702
|
return (supervisor === null || supervisor === void 0 ? void 0 : supervisor.surveyors) || [];
|
|
5058
4703
|
}, [supervisor]);
|
|
5059
|
-
const [currentPage, setCurrentPage] = React.useState(0);
|
|
5060
|
-
const [pageSize, setPageSize] = React.useState(20);
|
|
5061
|
-
const userRoles = (_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$ge2.roles;
|
|
5062
|
-
const isSupervisor = userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => role.code === "EKYC_SUPERVISOR");
|
|
5063
|
-
const currentSupervisor = isSupervisor ? (progressData === null || progressData === void 0 ? void 0 : progressData.supervisorReport[0]) || [] : progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.find(ele => ele.supervisorId === supervisorId);
|
|
5064
|
-
const surveyorsData = (currentSupervisor === null || currentSupervisor === void 0 ? void 0 : currentSupervisor.surveyors) || [];
|
|
5065
4704
|
const cards = React.useMemo(() => [{
|
|
5066
4705
|
label: "TOTAL_EKYC_APPLICATIONS",
|
|
5067
4706
|
count: (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0,
|
|
@@ -5143,100 +4782,54 @@ const SupervisorDetailsCard = () => {
|
|
|
5143
4782
|
accessor: row => `${(row === null || row === void 0 ? void 0 : row.progressPercent) || 0}%`,
|
|
5144
4783
|
id: "overallProgress"
|
|
5145
4784
|
}], [t, history]);
|
|
5146
|
-
const [showReportMenu, setShowReportMenu] = React.useState(false);
|
|
5147
4785
|
const [customDate, setCustomDate] = React.useState({
|
|
5148
4786
|
from: "",
|
|
5149
4787
|
to: ""
|
|
5150
4788
|
});
|
|
5151
|
-
const
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
completed: s.submittedKnos,
|
|
5173
|
-
pending: s.pendingKnos,
|
|
5174
|
-
progress: `${s.progressPercent}%`
|
|
5175
|
-
}));
|
|
5176
|
-
const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
|
|
5177
|
-
const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
|
|
5178
|
-
downloadSupervisorPDF({
|
|
5179
|
-
rows: rowsWithStats,
|
|
5180
|
-
supervisorName: fullName,
|
|
5181
|
-
vendorName,
|
|
5182
|
-
mobileNumber,
|
|
5183
|
-
email,
|
|
5184
|
-
dashboardInfo: {
|
|
5185
|
-
total: totalKnos,
|
|
5186
|
-
completed: completedKnos,
|
|
5187
|
-
pending: totalKnos - completedKnos,
|
|
5188
|
-
submittedCount: completedKnos
|
|
5189
|
-
},
|
|
5190
|
-
t
|
|
5191
|
-
});
|
|
5192
|
-
} catch (err) {
|
|
5193
|
-
console.error("Failed to generate supervisor report:", err);
|
|
5194
|
-
} finally {
|
|
5195
|
-
setReportLoading(false);
|
|
5196
|
-
}
|
|
5197
|
-
};
|
|
5198
|
-
const handlePresetDownload = function (filter) {
|
|
5199
|
-
try {
|
|
5200
|
-
const range = getDateRange(filter);
|
|
5201
|
-
if (!range) return Promise.resolve();
|
|
5202
|
-
setShowReportMenu(false);
|
|
5203
|
-
setShowCustomPicker(false);
|
|
5204
|
-
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
5205
|
-
} catch (e) {
|
|
5206
|
-
return Promise.reject(e);
|
|
5207
|
-
}
|
|
4789
|
+
const StatCard = _ref5 => {
|
|
4790
|
+
let {
|
|
4791
|
+
title,
|
|
4792
|
+
value,
|
|
4793
|
+
type,
|
|
4794
|
+
isLoading,
|
|
4795
|
+
icon
|
|
4796
|
+
} = _ref5;
|
|
4797
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
4798
|
+
className: `stat-card ${type}`
|
|
4799
|
+
}, isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
4800
|
+
className: "stat-title skeleton skeleton-text"
|
|
4801
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
4802
|
+
className: "stat-value skeleton skeleton-number"
|
|
4803
|
+
})) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
4804
|
+
className: "stat-title"
|
|
4805
|
+
}, title), /*#__PURE__*/React__default.createElement("div", {
|
|
4806
|
+
className: "stat-value"
|
|
4807
|
+
}, value), icon && /*#__PURE__*/React__default.createElement("div", {
|
|
4808
|
+
className: "stat-icon"
|
|
4809
|
+
}, icon)));
|
|
5208
4810
|
};
|
|
5209
|
-
const
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
4811
|
+
const isPageLoading = isProgressLoading || isSupervisorSearchLoading || isSurveyorSearchLoading || isVendorSearchLoading;
|
|
4812
|
+
if (isPageLoading && !supervisor) {
|
|
4813
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
4814
|
+
}
|
|
4815
|
+
if (!supervisor) {
|
|
4816
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
|
|
4817
|
+
style: {
|
|
4818
|
+
padding: "24px"
|
|
5214
4819
|
}
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
const to = new Date(customDate.to);
|
|
5218
|
-
to.setHours(23, 59, 59, 999);
|
|
5219
|
-
setShowReportMenu(false);
|
|
5220
|
-
setShowCustomPicker(false);
|
|
5221
|
-
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
5222
|
-
} catch (e) {
|
|
5223
|
-
return Promise.reject(e);
|
|
5224
|
-
}
|
|
5225
|
-
};
|
|
4820
|
+
}, t("NO_SUPERVISOR_FOUND")));
|
|
4821
|
+
}
|
|
5226
4822
|
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
5227
4823
|
try {
|
|
5228
|
-
if (!surveyors || surveyors.length === 0) {
|
|
5229
|
-
alert(t("NO_SURVEYORS_ASSIGNED") || "No surveyors assigned to this supervisor.");
|
|
5230
|
-
return Promise.resolve();
|
|
5231
|
-
}
|
|
5232
4824
|
setEkycDownloadLoading(true);
|
|
5233
4825
|
return Promise.resolve(_finallyRethrows(function () {
|
|
5234
4826
|
return _catch(function () {
|
|
5235
4827
|
return Promise.resolve(Digit.EkycService.application_list({
|
|
5236
|
-
tenantId: tenantId
|
|
4828
|
+
tenantId: tenantId,
|
|
5237
4829
|
offset: 0,
|
|
5238
4830
|
limit: 10000,
|
|
5239
|
-
|
|
4831
|
+
vendorId: targetVendorId,
|
|
4832
|
+
ekycStatus: ekycStatus,
|
|
5240
4833
|
reportDownload: true,
|
|
5241
4834
|
...(fromDate && {
|
|
5242
4835
|
fromDate
|
|
@@ -5246,16 +4839,25 @@ const SupervisorDetailsCard = () => {
|
|
|
5246
4839
|
})
|
|
5247
4840
|
})).then(function (response) {
|
|
5248
4841
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
5249
|
-
if (consumerList.length === 0) {
|
|
5250
|
-
alert(t("
|
|
4842
|
+
if (!consumerList || consumerList.length === 0) {
|
|
4843
|
+
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
5251
4844
|
return;
|
|
5252
4845
|
}
|
|
4846
|
+
consumerList.forEach(item => {
|
|
4847
|
+
if (item.assignedTime) {
|
|
4848
|
+
item.assignedTime = new Date(item.assignedTime).toLocaleDateString("en-GB");
|
|
4849
|
+
}
|
|
4850
|
+
if (item.submittedAt) {
|
|
4851
|
+
item.submittedAt = new Date(item.submittedAt).toLocaleDateString("en-GB");
|
|
4852
|
+
}
|
|
4853
|
+
});
|
|
5253
4854
|
const excelData = getEkycExcelData(consumerList, t);
|
|
5254
|
-
const cleanFileName = `
|
|
4855
|
+
const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
5255
4856
|
Digit.Download.Excel(excelData, cleanFileName);
|
|
5256
4857
|
});
|
|
5257
4858
|
}, function (error) {
|
|
5258
|
-
console.error("
|
|
4859
|
+
console.error("Failed to download eKYC data:", error);
|
|
4860
|
+
alert(t("EKYC_DOWNLOAD_FAILED") || "Failed to download eKYC data. Please try again.");
|
|
5259
4861
|
});
|
|
5260
4862
|
}, function (_wasThrown, _result) {
|
|
5261
4863
|
setEkycDownloadLoading(false);
|
|
@@ -5266,106 +4868,50 @@ const SupervisorDetailsCard = () => {
|
|
|
5266
4868
|
return Promise.reject(e);
|
|
5267
4869
|
}
|
|
5268
4870
|
};
|
|
5269
|
-
const
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
return
|
|
5275
|
-
from: start,
|
|
5276
|
-
to: now
|
|
5277
|
-
};
|
|
5278
|
-
}
|
|
5279
|
-
if (filter === "week") {
|
|
5280
|
-
start.setDate(now.getDate() - now.getDay());
|
|
5281
|
-
start.setHours(0, 0, 0, 0);
|
|
5282
|
-
return {
|
|
5283
|
-
from: start,
|
|
5284
|
-
to: now
|
|
5285
|
-
};
|
|
5286
|
-
}
|
|
5287
|
-
if (filter === "month") {
|
|
5288
|
-
start.setDate(1);
|
|
5289
|
-
start.setHours(0, 0, 0, 0);
|
|
5290
|
-
return {
|
|
5291
|
-
from: start,
|
|
5292
|
-
to: now
|
|
5293
|
-
};
|
|
4871
|
+
const handleApplyFilters = function () {
|
|
4872
|
+
try {
|
|
4873
|
+
setShowFilterModal(false);
|
|
4874
|
+
return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
|
|
4875
|
+
} catch (e) {
|
|
4876
|
+
return Promise.reject(e);
|
|
5294
4877
|
}
|
|
5295
|
-
return null;
|
|
5296
|
-
};
|
|
5297
|
-
const StatCard = _ref5 => {
|
|
5298
|
-
let {
|
|
5299
|
-
title,
|
|
5300
|
-
value,
|
|
5301
|
-
type,
|
|
5302
|
-
isLoading,
|
|
5303
|
-
icon
|
|
5304
|
-
} = _ref5;
|
|
5305
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
5306
|
-
className: `stat-card ${type}`
|
|
5307
|
-
}, isLoading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
5308
|
-
className: "stat-title skeleton skeleton-text"
|
|
5309
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
5310
|
-
className: "stat-value skeleton skeleton-number"
|
|
5311
|
-
})) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
5312
|
-
className: "stat-title"
|
|
5313
|
-
}, title), /*#__PURE__*/React__default.createElement("div", {
|
|
5314
|
-
className: "stat-value"
|
|
5315
|
-
}, value), icon && /*#__PURE__*/React__default.createElement("div", {
|
|
5316
|
-
className: "stat-icon"
|
|
5317
|
-
}, icon)));
|
|
5318
4878
|
};
|
|
5319
|
-
|
|
5320
|
-
if (isPageLoading && !supervisor) {
|
|
5321
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
5322
|
-
}
|
|
5323
|
-
if (!supervisor) {
|
|
5324
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement("div", {
|
|
5325
|
-
style: {
|
|
5326
|
-
padding: "24px"
|
|
5327
|
-
}
|
|
5328
|
-
}, t("NO_SUPERVISOR_FOUND")));
|
|
5329
|
-
}
|
|
5330
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
4879
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
5331
4880
|
className: "surveyor-dashboard"
|
|
5332
4881
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5333
4882
|
className: "ekyc-dashboard-section"
|
|
4883
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4884
|
+
className: "ekyc-details-wrapper"
|
|
4885
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4886
|
+
className: "details-top-row"
|
|
4887
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4888
|
+
className: "detail-item first-row"
|
|
5334
4889
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5335
4890
|
className: "ekyc-dashboard-header"
|
|
5336
4891
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5337
|
-
className: "avatar"
|
|
5338
|
-
}, fullName === null || fullName === void 0 ? void 0 : (_fullName$charAt = fullName.charAt(0)) === null || _fullName$charAt === void 0 ? void 0 : _fullName$charAt.toUpperCase()), /*#__PURE__*/React__default.createElement("div", {
|
|
5339
4892
|
className: "header-content"
|
|
5340
4893
|
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
5341
4894
|
className: "name"
|
|
5342
4895
|
}, fullName), /*#__PURE__*/React__default.createElement("div", {
|
|
5343
4896
|
className: "designation"
|
|
5344
|
-
}, t("FIELD_SUPERVISOR") || "Field Supervisor"))), /*#__PURE__*/React__default.createElement("div", {
|
|
5345
|
-
className: "report-download"
|
|
4897
|
+
}, "(", t("FIELD_SUPERVISOR") || "Field Supervisor", ")"))), /*#__PURE__*/React__default.createElement("div", {
|
|
4898
|
+
className: "report-download relative"
|
|
5346
4899
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
5347
|
-
|
|
5348
|
-
disabled:
|
|
5349
|
-
onClick:
|
|
5350
|
-
},
|
|
5351
|
-
className: "
|
|
5352
|
-
}, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
|
|
5353
|
-
key: idx,
|
|
5354
|
-
title: t(card.label),
|
|
5355
|
-
value: card.count,
|
|
5356
|
-
type: card.type,
|
|
5357
|
-
isLoading: isProgressLoading,
|
|
5358
|
-
icon: card.icon
|
|
5359
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
5360
|
-
className: "ekyc-dashboard-section"
|
|
5361
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5362
|
-
className: "ekyc-details-wrapper"
|
|
5363
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5364
|
-
className: "details-top-row"
|
|
4900
|
+
disabled: ekycDownloadLoading,
|
|
4901
|
+
className: `download-btn relative ${ekycDownloadLoading ? "disabled" : ""}`,
|
|
4902
|
+
onClick: () => setShowFilterModal(true)
|
|
4903
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading" : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React__default.createElement("div", {
|
|
4904
|
+
className: "details-grid-row"
|
|
5365
4905
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5366
4906
|
className: "detail-item"
|
|
5367
4907
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
5368
4908
|
className: "label"
|
|
4909
|
+
}, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
|
|
4910
|
+
className: "value"
|
|
4911
|
+
}, vendorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
4912
|
+
className: "detail-item"
|
|
4913
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
4914
|
+
className: "label"
|
|
5369
4915
|
}, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
|
|
5370
4916
|
className: "value"
|
|
5371
4917
|
}, mobileNumber)), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -5374,130 +4920,36 @@ const SupervisorDetailsCard = () => {
|
|
|
5374
4920
|
className: "label"
|
|
5375
4921
|
}, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
|
|
5376
4922
|
className: "value"
|
|
5377
|
-
}, email)), /*#__PURE__*/React__default.createElement("div", {
|
|
5378
|
-
className: "download-card"
|
|
5379
|
-
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format.")), /*#__PURE__*/React__default.createElement("div", {
|
|
5380
|
-
className: "report-download",
|
|
5381
|
-
ref: reportMenuRef
|
|
5382
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
5383
|
-
className: "download-excel-btn",
|
|
5384
|
-
disabled: ekycDownloadLoading,
|
|
5385
|
-
onClick: () => {
|
|
5386
|
-
setShowReportMenu(p => !p);
|
|
5387
|
-
setShowCustomPicker(false);
|
|
5388
|
-
}
|
|
5389
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
5390
|
-
width: "16",
|
|
5391
|
-
height: "16",
|
|
5392
|
-
viewBox: "0 0 24 24",
|
|
5393
|
-
fill: "none",
|
|
5394
|
-
stroke: "currentColor",
|
|
5395
|
-
strokeWidth: "2.5",
|
|
5396
|
-
strokeLinecap: "round",
|
|
5397
|
-
strokeLinejoin: "round"
|
|
5398
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
5399
|
-
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
5400
|
-
}), /*#__PURE__*/React__default.createElement("polyline", {
|
|
5401
|
-
points: "7 10 12 15 17 10"
|
|
5402
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
5403
|
-
x1: "12",
|
|
5404
|
-
y1: "15",
|
|
5405
|
-
x2: "12",
|
|
5406
|
-
y2: "3"
|
|
5407
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
|
|
5408
|
-
className: "report-menu"
|
|
5409
|
-
}, [{
|
|
5410
|
-
label: t("TODAY") || "Today",
|
|
5411
|
-
key: "today"
|
|
5412
|
-
}, {
|
|
5413
|
-
label: t("THIS_WEEK") || "This Week",
|
|
5414
|
-
key: "week"
|
|
5415
|
-
}, {
|
|
5416
|
-
label: t("THIS_MONTH") || "This Month",
|
|
5417
|
-
key: "month"
|
|
5418
|
-
}].map(_ref6 => {
|
|
5419
|
-
let {
|
|
5420
|
-
label,
|
|
5421
|
-
key
|
|
5422
|
-
} = _ref6;
|
|
5423
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
5424
|
-
key: key,
|
|
5425
|
-
className: "menu-item",
|
|
5426
|
-
onClick: () => handlePresetDownload(key)
|
|
5427
|
-
}, label);
|
|
5428
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
5429
|
-
className: "custom-date-trigger",
|
|
5430
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
5431
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
|
|
5432
|
-
className: "custom-picker"
|
|
5433
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5434
|
-
className: "date-inputs"
|
|
5435
|
-
}, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
|
|
5436
|
-
type: "date",
|
|
5437
|
-
value: customDate.from,
|
|
5438
|
-
onChange: e => setCustomDate({
|
|
5439
|
-
...customDate,
|
|
5440
|
-
from: e.target.value
|
|
5441
|
-
})
|
|
5442
|
-
})), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
|
|
5443
|
-
type: "date",
|
|
5444
|
-
value: customDate.to,
|
|
5445
|
-
onChange: e => setCustomDate({
|
|
5446
|
-
...customDate,
|
|
5447
|
-
to: e.target.value
|
|
5448
|
-
})
|
|
5449
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
5450
|
-
style: {
|
|
5451
|
-
display: "flex",
|
|
5452
|
-
gap: "10px",
|
|
5453
|
-
marginTop: "10px"
|
|
5454
|
-
}
|
|
5455
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
5456
|
-
className: "picker-cancel-btn",
|
|
5457
|
-
onClick: () => {
|
|
5458
|
-
setShowCustomPicker(false);
|
|
5459
|
-
setCustomDate({
|
|
5460
|
-
from: "",
|
|
5461
|
-
to: ""
|
|
5462
|
-
});
|
|
5463
|
-
}
|
|
5464
|
-
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
|
|
5465
|
-
className: "picker-apply-btn",
|
|
5466
|
-
onClick: handleCustomDownload
|
|
5467
|
-
}, t("APPLY") || "Apply"))))))), /*#__PURE__*/React__default.createElement("div", {
|
|
4923
|
+
}, email))), /*#__PURE__*/React__default.createElement("div", {
|
|
5468
4924
|
className: "details-grid-row"
|
|
5469
4925
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5470
4926
|
className: "detail-item"
|
|
5471
4927
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
5472
4928
|
className: "label"
|
|
5473
|
-
}, t("
|
|
5474
|
-
className: "value"
|
|
5475
|
-
}, t(gender) || gender)), /*#__PURE__*/React__default.createElement("div", {
|
|
5476
|
-
className: "detail-item"
|
|
5477
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
5478
|
-
className: "label"
|
|
5479
|
-
}, t("STATUS")), /*#__PURE__*/React__default.createElement("span", {
|
|
4929
|
+
}, t("ASSIGNED_ZONE") || "Assigned Zone"), /*#__PURE__*/React__default.createElement("span", {
|
|
5480
4930
|
className: "value"
|
|
5481
|
-
},
|
|
4931
|
+
}, assignedZone && assignedZone !== "N/A" ? t(assignedZone.trim().toUpperCase()) || assignedZone : assignedZone)), /*#__PURE__*/React__default.createElement("div", {
|
|
5482
4932
|
className: "detail-item"
|
|
5483
4933
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
5484
4934
|
className: "label"
|
|
5485
|
-
}, t("
|
|
4935
|
+
}, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
|
|
5486
4936
|
className: "value"
|
|
5487
|
-
},
|
|
5488
|
-
className: "selected-zones",
|
|
5489
|
-
style: {
|
|
5490
|
-
marginTop: "4px"
|
|
5491
|
-
}
|
|
5492
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
5493
|
-
className: "selected-zone-chip"
|
|
5494
|
-
}, t(assignedZone.trim().toUpperCase()) || assignedZone)) : assignedZone)), /*#__PURE__*/React__default.createElement("div", {
|
|
4937
|
+
}, t(gender) || gender)), /*#__PURE__*/React__default.createElement("div", {
|
|
5495
4938
|
className: "detail-item"
|
|
5496
4939
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
5497
4940
|
className: "label"
|
|
5498
|
-
}, t("
|
|
4941
|
+
}, t("STATUS")), /*#__PURE__*/React__default.createElement("span", {
|
|
5499
4942
|
className: "value"
|
|
5500
|
-
},
|
|
4943
|
+
}, status))))), /*#__PURE__*/React__default.createElement("div", {
|
|
4944
|
+
className: "stats-wrapper"
|
|
4945
|
+
}, cards.map((card, idx) => /*#__PURE__*/React__default.createElement(StatCard, {
|
|
4946
|
+
key: idx,
|
|
4947
|
+
title: t(card.label),
|
|
4948
|
+
value: card.count,
|
|
4949
|
+
type: card.type,
|
|
4950
|
+
isLoading: isProgressLoading,
|
|
4951
|
+
icon: card.icon
|
|
4952
|
+
}))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
|
|
5501
4953
|
t: t,
|
|
5502
4954
|
tableTitle: t("CONNECTED_SURVEYORS") || "Connected Surveyors",
|
|
5503
4955
|
tableClass: "ekycTable",
|
|
@@ -5529,7 +4981,15 @@ const SupervisorDetailsCard = () => {
|
|
|
5529
4981
|
setPageSize(Number(e.target.value));
|
|
5530
4982
|
setCurrentPage(0);
|
|
5531
4983
|
}
|
|
5532
|
-
})))
|
|
4984
|
+
}))), showFilterModal && /*#__PURE__*/React__default.createElement(EkycFilterModal, {
|
|
4985
|
+
t: t,
|
|
4986
|
+
onClose: () => setShowFilterModal(false),
|
|
4987
|
+
onApply: handleApplyFilters,
|
|
4988
|
+
customDate: customDate,
|
|
4989
|
+
setCustomDate: setCustomDate,
|
|
4990
|
+
ekycStatus: ekycStatus,
|
|
4991
|
+
setEkycStatus: setEkycStatus
|
|
4992
|
+
}));
|
|
5533
4993
|
};
|
|
5534
4994
|
|
|
5535
4995
|
const AssignEkycModal = _ref => {
|
|
@@ -5976,11 +5436,13 @@ const AssignEkycModal = _ref => {
|
|
|
5976
5436
|
};
|
|
5977
5437
|
|
|
5978
5438
|
const SurveyorDetailsCard = () => {
|
|
5979
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$
|
|
5439
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2, _surveyorSearchById$s, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner4, _surveyor$owner5, _surveyor$owner6, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _dashboardData$dashbo5, _dashboardData$dashbo6;
|
|
5980
5440
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
5981
5441
|
const [showModal, setShowModal] = React.useState(null);
|
|
5982
5442
|
const [showOptions, setShowOptions] = React.useState(false);
|
|
5983
5443
|
const [ekycDownloadLoading, setEkycDownloadLoading] = React.useState(false);
|
|
5444
|
+
const [showFilterModal, setShowFilterModal] = React.useState(false);
|
|
5445
|
+
const [ekycStatus, setEkycStatus] = React.useState("ALL");
|
|
5984
5446
|
const {
|
|
5985
5447
|
id: surveyorId
|
|
5986
5448
|
} = reactRouterDom.useParams();
|
|
@@ -6060,15 +5522,13 @@ const SurveyorDetailsCard = () => {
|
|
|
6060
5522
|
return (mappedSupervisor === null || mappedSupervisor === void 0 ? void 0 : mappedSupervisor.name) || (mappedSupervisor === null || mappedSupervisor === void 0 ? void 0 : (_mappedSupervisor$own = mappedSupervisor.owner) === null || _mappedSupervisor$own === void 0 ? void 0 : _mappedSupervisor$own.name) || surveyor.supervisorId || "N/A";
|
|
6061
5523
|
}, [supervisorSearchResponse, surveyor === null || surveyor === void 0 ? void 0 : surveyor.supervisorId, surveyor === null || surveyor === void 0 ? void 0 : surveyor.supervisorName]);
|
|
6062
5524
|
const fullName = (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner = surveyor.owner) === null || _surveyor$owner === void 0 ? void 0 : _surveyor$owner.name) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.name) || "N/A";
|
|
6063
|
-
const employeeId = (surveyor === null || surveyor === void 0 ? void 0 : surveyor.employeeId) || (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner2 = surveyor.owner) === null || _surveyor$owner2 === void 0 ? void 0 : _surveyor$owner2.uuid) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.id);
|
|
6064
|
-
const mobileNumber = (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner3 = surveyor.owner) === null || _surveyor$owner3 === void 0 ? void 0 : _surveyor$owner3.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A";
|
|
6065
5525
|
const [currentPage, setCurrentPage] = React.useState(0);
|
|
6066
5526
|
const [pageSize, setPageSize] = React.useState(20);
|
|
6067
5527
|
const queryParams = {
|
|
6068
5528
|
tenantId: "dl.djb",
|
|
6069
5529
|
offset: currentPage * pageSize,
|
|
6070
5530
|
limit: pageSize,
|
|
6071
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
5531
|
+
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner2 = surveyor.owner) === null || _surveyor$owner2 === void 0 ? void 0 : _surveyor$owner2.uuid
|
|
6072
5532
|
};
|
|
6073
5533
|
const {
|
|
6074
5534
|
isFetching: isDashboardLoading,
|
|
@@ -6125,24 +5585,10 @@ const SurveyorDetailsCard = () => {
|
|
|
6125
5585
|
return value ? Digit.DateUtils.ConvertEpochToDate(value) : "-";
|
|
6126
5586
|
}
|
|
6127
5587
|
}], [t]);
|
|
6128
|
-
const [showReportMenu, setShowReportMenu] = React.useState(false);
|
|
6129
5588
|
const [customDate, setCustomDate] = React.useState({
|
|
6130
5589
|
from: "",
|
|
6131
5590
|
to: ""
|
|
6132
5591
|
});
|
|
6133
|
-
const [showCustomPicker, setShowCustomPicker] = React.useState(false);
|
|
6134
|
-
const [reportLoading, setReportLoading] = React.useState(false);
|
|
6135
|
-
const reportMenuRef = React.useRef(null);
|
|
6136
|
-
React.useEffect(() => {
|
|
6137
|
-
const handler = e => {
|
|
6138
|
-
if (reportMenuRef.current && !reportMenuRef.current.contains(e.target)) {
|
|
6139
|
-
setShowReportMenu(false);
|
|
6140
|
-
setShowCustomPicker(false);
|
|
6141
|
-
}
|
|
6142
|
-
};
|
|
6143
|
-
document.addEventListener("mousedown", handler);
|
|
6144
|
-
return () => document.removeEventListener("mousedown", handler);
|
|
6145
|
-
}, []);
|
|
6146
5592
|
const isPageLoading = isLoading || isVendorLoading || isSupervisorSearchLoading;
|
|
6147
5593
|
if (isPageLoading && !surveyor) {
|
|
6148
5594
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
@@ -6154,100 +5600,6 @@ const SurveyorDetailsCard = () => {
|
|
|
6154
5600
|
}
|
|
6155
5601
|
}, t("NO_SURVEYOR_FOUND")));
|
|
6156
5602
|
}
|
|
6157
|
-
const getDateRange = filter => {
|
|
6158
|
-
const now = new Date();
|
|
6159
|
-
const start = new Date(now);
|
|
6160
|
-
if (filter === "today") {
|
|
6161
|
-
start.setHours(0, 0, 0, 0);
|
|
6162
|
-
return {
|
|
6163
|
-
from: start,
|
|
6164
|
-
to: now
|
|
6165
|
-
};
|
|
6166
|
-
}
|
|
6167
|
-
if (filter === "week") {
|
|
6168
|
-
start.setDate(now.getDate() - now.getDay());
|
|
6169
|
-
start.setHours(0, 0, 0, 0);
|
|
6170
|
-
return {
|
|
6171
|
-
from: start,
|
|
6172
|
-
to: now
|
|
6173
|
-
};
|
|
6174
|
-
}
|
|
6175
|
-
if (filter === "month") {
|
|
6176
|
-
start.setDate(1);
|
|
6177
|
-
start.setHours(0, 0, 0, 0);
|
|
6178
|
-
return {
|
|
6179
|
-
from: start,
|
|
6180
|
-
to: now
|
|
6181
|
-
};
|
|
6182
|
-
}
|
|
6183
|
-
return null;
|
|
6184
|
-
};
|
|
6185
|
-
const handleDownload = function () {
|
|
6186
|
-
try {
|
|
6187
|
-
setReportLoading(true);
|
|
6188
|
-
const _temp = _finallyRethrows(function () {
|
|
6189
|
-
return _catch(function () {
|
|
6190
|
-
var _surveyor$owner5;
|
|
6191
|
-
return Promise.resolve(Digit.EkycService.dashboard({}, {
|
|
6192
|
-
tenantId: "dl.djb",
|
|
6193
|
-
offset: 0,
|
|
6194
|
-
limit: 1000,
|
|
6195
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.uuid
|
|
6196
|
-
})).then(function (response) {
|
|
6197
|
-
var _response$dashboardIn;
|
|
6198
|
-
const rows = (response === null || response === void 0 ? void 0 : (_response$dashboardIn = response.dashboardInfo) === null || _response$dashboardIn === void 0 ? void 0 : _response$dashboardIn.consumerList) || [];
|
|
6199
|
-
downloadSurveyorPDF({
|
|
6200
|
-
rows: rows,
|
|
6201
|
-
surveyorName: fullName,
|
|
6202
|
-
vendorName,
|
|
6203
|
-
supervisorName,
|
|
6204
|
-
employeeId,
|
|
6205
|
-
mobileNumber,
|
|
6206
|
-
dashboardInfo: (response === null || response === void 0 ? void 0 : response.dashboardInfo) || {},
|
|
6207
|
-
t
|
|
6208
|
-
});
|
|
6209
|
-
});
|
|
6210
|
-
}, function (err) {
|
|
6211
|
-
console.error("Failed to fetch dashboard data for report download:", err);
|
|
6212
|
-
});
|
|
6213
|
-
}, function (_wasThrown, _result) {
|
|
6214
|
-
setReportLoading(false);
|
|
6215
|
-
if (_wasThrown) throw _result;
|
|
6216
|
-
return _result;
|
|
6217
|
-
});
|
|
6218
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
6219
|
-
} catch (e) {
|
|
6220
|
-
return Promise.reject(e);
|
|
6221
|
-
}
|
|
6222
|
-
};
|
|
6223
|
-
const handlePresetDownload = function (filter) {
|
|
6224
|
-
try {
|
|
6225
|
-
const range = getDateRange(filter);
|
|
6226
|
-
if (!range) return Promise.resolve();
|
|
6227
|
-
setShowReportMenu(false);
|
|
6228
|
-
setShowCustomPicker(false);
|
|
6229
|
-
return Promise.resolve(handleDownloadEkycData(range.from.getTime(), range.to.getTime())).then(function () {});
|
|
6230
|
-
} catch (e) {
|
|
6231
|
-
return Promise.reject(e);
|
|
6232
|
-
}
|
|
6233
|
-
};
|
|
6234
|
-
const handleCustomDownload = function () {
|
|
6235
|
-
try {
|
|
6236
|
-
if (!customDate.from || !customDate.to) {
|
|
6237
|
-
alert(t("SELECT_DATE_RANGE") || "Please select both From and To dates.");
|
|
6238
|
-
return Promise.resolve();
|
|
6239
|
-
}
|
|
6240
|
-
const from = new Date(customDate.from);
|
|
6241
|
-
from.setHours(0, 0, 0, 0);
|
|
6242
|
-
const to = new Date(customDate.to);
|
|
6243
|
-
to.setHours(23, 59, 59, 999);
|
|
6244
|
-
setShowReportMenu(false);
|
|
6245
|
-
setShowCustomPicker(false);
|
|
6246
|
-
return Promise.resolve(handleDownloadEkycData(from.getTime(), to.getTime())).then(function () {});
|
|
6247
|
-
} catch (e) {
|
|
6248
|
-
return Promise.reject(e);
|
|
6249
|
-
}
|
|
6250
|
-
};
|
|
6251
5603
|
const StatCard = _ref4 => {
|
|
6252
5604
|
let {
|
|
6253
5605
|
title,
|
|
@@ -6279,17 +5631,26 @@ const SurveyorDetailsCard = () => {
|
|
|
6279
5631
|
setShowOptions(false);
|
|
6280
5632
|
setShowModal(option.action);
|
|
6281
5633
|
};
|
|
5634
|
+
const closeModal = function () {
|
|
5635
|
+
try {
|
|
5636
|
+
setShowModal(null);
|
|
5637
|
+
return Promise.resolve();
|
|
5638
|
+
} catch (e) {
|
|
5639
|
+
return Promise.reject(e);
|
|
5640
|
+
}
|
|
5641
|
+
};
|
|
6282
5642
|
const handleDownloadEkycData = function (fromDate, toDate) {
|
|
6283
5643
|
try {
|
|
6284
5644
|
setEkycDownloadLoading(true);
|
|
6285
5645
|
return Promise.resolve(_finallyRethrows(function () {
|
|
6286
5646
|
return _catch(function () {
|
|
6287
|
-
var _surveyor$
|
|
5647
|
+
var _surveyor$owner3;
|
|
6288
5648
|
return Promise.resolve(Digit.EkycService.application_list({
|
|
6289
|
-
tenantId: tenantId
|
|
5649
|
+
tenantId: tenantId,
|
|
6290
5650
|
offset: 0,
|
|
6291
5651
|
limit: 10000,
|
|
6292
|
-
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
5652
|
+
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner3 = surveyor.owner) === null || _surveyor$owner3 === void 0 ? void 0 : _surveyor$owner3.uuid,
|
|
5653
|
+
ekycStatus: ekycStatus,
|
|
6293
5654
|
reportDownload: true,
|
|
6294
5655
|
...(fromDate && {
|
|
6295
5656
|
fromDate
|
|
@@ -6299,35 +5660,44 @@ const SurveyorDetailsCard = () => {
|
|
|
6299
5660
|
})
|
|
6300
5661
|
})).then(function (response) {
|
|
6301
5662
|
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
6302
|
-
if (consumerList.length === 0) {
|
|
6303
|
-
alert(t("
|
|
5663
|
+
if (!consumerList || consumerList.length === 0) {
|
|
5664
|
+
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
6304
5665
|
return;
|
|
6305
5666
|
}
|
|
5667
|
+
consumerList.forEach(item => {
|
|
5668
|
+
if (item.assignedTime) {
|
|
5669
|
+
item.assignedTime = new Date(item.assignedTime).toLocaleDateString("en-GB");
|
|
5670
|
+
}
|
|
5671
|
+
if (item.submittedAt) {
|
|
5672
|
+
item.submittedAt = new Date(item.submittedAt).toLocaleDateString("en-GB");
|
|
5673
|
+
}
|
|
5674
|
+
});
|
|
6306
5675
|
const excelData = getEkycExcelData(consumerList, t);
|
|
6307
|
-
const cleanFileName = `eKYC_Data_${
|
|
5676
|
+
const cleanFileName = `eKYC_Data_${vendorName.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
6308
5677
|
Digit.Download.Excel(excelData, cleanFileName);
|
|
6309
5678
|
});
|
|
6310
5679
|
}, function (error) {
|
|
6311
|
-
console.error("
|
|
5680
|
+
console.error("Failed to download eKYC data:", error);
|
|
5681
|
+
alert(t("EKYC_DOWNLOAD_FAILED") || "Failed to download eKYC data. Please try again.");
|
|
6312
5682
|
});
|
|
6313
|
-
}, function (
|
|
5683
|
+
}, function (_wasThrown, _result) {
|
|
6314
5684
|
setEkycDownloadLoading(false);
|
|
6315
|
-
if (
|
|
6316
|
-
return
|
|
5685
|
+
if (_wasThrown) throw _result;
|
|
5686
|
+
return _result;
|
|
6317
5687
|
}));
|
|
6318
5688
|
} catch (e) {
|
|
6319
5689
|
return Promise.reject(e);
|
|
6320
5690
|
}
|
|
6321
5691
|
};
|
|
6322
|
-
const
|
|
5692
|
+
const handleApplyFilters = function () {
|
|
6323
5693
|
try {
|
|
6324
|
-
|
|
6325
|
-
return Promise.resolve();
|
|
5694
|
+
setShowFilterModal(false);
|
|
5695
|
+
return Promise.resolve(handleDownloadEkycData(customDate.startDate.getTime(), customDate.endDate.getTime())).then(function () {});
|
|
6326
5696
|
} catch (e) {
|
|
6327
5697
|
return Promise.reject(e);
|
|
6328
5698
|
}
|
|
6329
5699
|
};
|
|
6330
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
5700
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
6331
5701
|
className: "surveyor-dashboard"
|
|
6332
5702
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6333
5703
|
className: "ekyc-dashboard-section"
|
|
@@ -6346,142 +5716,52 @@ const SurveyorDetailsCard = () => {
|
|
|
6346
5716
|
}, fullName), /*#__PURE__*/React__default.createElement("div", {
|
|
6347
5717
|
className: "designation"
|
|
6348
5718
|
}, "(", (surveyor === null || surveyor === void 0 ? void 0 : surveyor.description) || t("FIELD_SURVEYOR"), ")"))), /*#__PURE__*/React__default.createElement("div", {
|
|
6349
|
-
className: "report-download"
|
|
5719
|
+
className: "report-download relative"
|
|
6350
5720
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
6351
|
-
|
|
6352
|
-
disabled:
|
|
6353
|
-
onClick:
|
|
6354
|
-
},
|
|
6355
|
-
className: "details-
|
|
5721
|
+
disabled: ekycDownloadLoading,
|
|
5722
|
+
className: `download-btn relative ${ekycDownloadLoading ? "disabled" : ""}`,
|
|
5723
|
+
onClick: () => setShowFilterModal(true)
|
|
5724
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.MdDownloadIcon, null), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading" : t("DOWNLOAD_REPORT") || "Download Report")))), /*#__PURE__*/React__default.createElement("div", {
|
|
5725
|
+
className: "details-grid-row"
|
|
6356
5726
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6357
5727
|
className: "detail-item"
|
|
6358
5728
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6359
5729
|
className: "label"
|
|
6360
|
-
}, t("
|
|
5730
|
+
}, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
|
|
6361
5731
|
className: "value"
|
|
6362
|
-
},
|
|
5732
|
+
}, vendorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
6363
5733
|
className: "detail-item"
|
|
6364
5734
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6365
5735
|
className: "label"
|
|
6366
|
-
}, t("
|
|
5736
|
+
}, t("SUPERVISOR_NAME") || "Supervisor Name"), /*#__PURE__*/React__default.createElement("span", {
|
|
6367
5737
|
className: "value"
|
|
6368
|
-
},
|
|
6369
|
-
className: "download-card"
|
|
6370
|
-
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h4", null, t("DOWNLOAD_EKYC_DATA") || "Download eKYC Data"), /*#__PURE__*/React__default.createElement("p", null, t("DOWNLOAD_EKYC_DATA_DESC") || "Export the complete eKYC verification records for your assigned jurisdiction into Excel format.")), /*#__PURE__*/React__default.createElement("div", {
|
|
6371
|
-
className: "report-download",
|
|
6372
|
-
ref: reportMenuRef
|
|
6373
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
6374
|
-
className: "download-excel-btn",
|
|
6375
|
-
disabled: ekycDownloadLoading,
|
|
6376
|
-
onClick: () => {
|
|
6377
|
-
setShowReportMenu(p => !p);
|
|
6378
|
-
setShowCustomPicker(false);
|
|
6379
|
-
}
|
|
6380
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
6381
|
-
width: "16",
|
|
6382
|
-
height: "16",
|
|
6383
|
-
viewBox: "0 0 24 24",
|
|
6384
|
-
fill: "none",
|
|
6385
|
-
stroke: "currentColor",
|
|
6386
|
-
strokeWidth: "2.5",
|
|
6387
|
-
strokeLinecap: "round",
|
|
6388
|
-
strokeLinejoin: "round"
|
|
6389
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
6390
|
-
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
6391
|
-
}), /*#__PURE__*/React__default.createElement("polyline", {
|
|
6392
|
-
points: "7 10 12 15 17 10"
|
|
6393
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
6394
|
-
x1: "12",
|
|
6395
|
-
y1: "15",
|
|
6396
|
-
x2: "12",
|
|
6397
|
-
y2: "3"
|
|
6398
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"), showReportMenu && /*#__PURE__*/React__default.createElement("div", {
|
|
6399
|
-
className: "report-menu"
|
|
6400
|
-
}, [{
|
|
6401
|
-
label: t("TODAY") || "Today",
|
|
6402
|
-
key: "today"
|
|
6403
|
-
}, {
|
|
6404
|
-
label: t("THIS_WEEK") || "This Week",
|
|
6405
|
-
key: "week"
|
|
6406
|
-
}, {
|
|
6407
|
-
label: t("THIS_MONTH") || "This Month",
|
|
6408
|
-
key: "month"
|
|
6409
|
-
}].map(_ref5 => {
|
|
6410
|
-
let {
|
|
6411
|
-
label,
|
|
6412
|
-
key
|
|
6413
|
-
} = _ref5;
|
|
6414
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
6415
|
-
key: key,
|
|
6416
|
-
className: "menu-item",
|
|
6417
|
-
onClick: () => handlePresetDownload(key)
|
|
6418
|
-
}, label);
|
|
6419
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
6420
|
-
className: "custom-date-trigger",
|
|
6421
|
-
onClick: () => setShowCustomPicker(p => !p)
|
|
6422
|
-
}, t("CUSTOM_DATE") || "Custom Date"), showCustomPicker && /*#__PURE__*/React__default.createElement("div", {
|
|
6423
|
-
className: "custom-picker"
|
|
6424
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6425
|
-
className: "date-inputs"
|
|
6426
|
-
}, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "From"), /*#__PURE__*/React__default.createElement("input", {
|
|
6427
|
-
type: "date",
|
|
6428
|
-
value: customDate.from,
|
|
6429
|
-
onChange: e => setCustomDate({
|
|
6430
|
-
...customDate,
|
|
6431
|
-
from: e.target.value
|
|
6432
|
-
})
|
|
6433
|
-
})), /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement("span", null, "To"), /*#__PURE__*/React__default.createElement("input", {
|
|
6434
|
-
type: "date",
|
|
6435
|
-
value: customDate.to,
|
|
6436
|
-
onChange: e => setCustomDate({
|
|
6437
|
-
...customDate,
|
|
6438
|
-
to: e.target.value
|
|
6439
|
-
})
|
|
6440
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
6441
|
-
style: {
|
|
6442
|
-
display: "flex",
|
|
6443
|
-
gap: "10px",
|
|
6444
|
-
marginTop: "10px"
|
|
6445
|
-
}
|
|
6446
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
6447
|
-
className: "picker-cancel-btn",
|
|
6448
|
-
onClick: () => {
|
|
6449
|
-
setShowCustomPicker(false);
|
|
6450
|
-
setCustomDate({
|
|
6451
|
-
from: "",
|
|
6452
|
-
to: ""
|
|
6453
|
-
});
|
|
6454
|
-
}
|
|
6455
|
-
}, t("CANCEL") || "Cancel"), /*#__PURE__*/React__default.createElement("button", {
|
|
6456
|
-
className: "picker-apply-btn",
|
|
6457
|
-
onClick: handleCustomDownload
|
|
6458
|
-
}, t("APPLY") || "Apply"))))))), /*#__PURE__*/React__default.createElement("div", {
|
|
6459
|
-
className: "details-grid-row"
|
|
6460
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
5738
|
+
}, supervisorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
6461
5739
|
className: "detail-item"
|
|
6462
5740
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6463
5741
|
className: "label"
|
|
6464
|
-
}, t("
|
|
5742
|
+
}, t("MOBILE")), /*#__PURE__*/React__default.createElement("span", {
|
|
6465
5743
|
className: "value"
|
|
6466
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$
|
|
5744
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner4 = surveyor.owner) === null || _surveyor$owner4 === void 0 ? void 0 : _surveyor$owner4.mobileNumber) || (surveyor === null || surveyor === void 0 ? void 0 : surveyor.mobileNo) || "N/A"))), /*#__PURE__*/React__default.createElement("div", {
|
|
5745
|
+
className: "details-grid-row"
|
|
5746
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6467
5747
|
className: "detail-item"
|
|
6468
5748
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6469
5749
|
className: "label"
|
|
6470
|
-
}, t("
|
|
5750
|
+
}, t("EMAIL")), /*#__PURE__*/React__default.createElement("span", {
|
|
6471
5751
|
className: "value"
|
|
6472
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.
|
|
5752
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner5 = surveyor.owner) === null || _surveyor$owner5 === void 0 ? void 0 : _surveyor$owner5.emailId) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
|
|
6473
5753
|
className: "detail-item"
|
|
6474
5754
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6475
5755
|
className: "label"
|
|
6476
|
-
}, t("
|
|
5756
|
+
}, t("GENDER")), /*#__PURE__*/React__default.createElement("span", {
|
|
6477
5757
|
className: "value"
|
|
6478
|
-
},
|
|
5758
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner6 = surveyor.owner) === null || _surveyor$owner6 === void 0 ? void 0 : _surveyor$owner6.gender) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
|
|
6479
5759
|
className: "detail-item"
|
|
6480
5760
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
6481
5761
|
className: "label"
|
|
6482
|
-
}, t("
|
|
5762
|
+
}, t("STATUS")), /*#__PURE__*/React__default.createElement("span", {
|
|
6483
5763
|
className: "value"
|
|
6484
|
-
},
|
|
5764
|
+
}, (surveyor === null || surveyor === void 0 ? void 0 : surveyor.status) || "N/A"))))), /*#__PURE__*/React__default.createElement("div", {
|
|
6485
5765
|
className: "stats-wrapper"
|
|
6486
5766
|
}, /*#__PURE__*/React__default.createElement(StatCard, {
|
|
6487
5767
|
title: t("TOTAL_ASSIGNED"),
|
|
@@ -6561,6 +5841,14 @@ const SurveyorDetailsCard = () => {
|
|
|
6561
5841
|
isReassign: showModal === "EKYC_REASSIGN",
|
|
6562
5842
|
closeModal: closeModal,
|
|
6563
5843
|
refetchDashboard: refetchDashboard
|
|
5844
|
+
})), showFilterModal && /*#__PURE__*/React__default.createElement(EkycFilterModal, {
|
|
5845
|
+
t: t,
|
|
5846
|
+
onClose: () => setShowFilterModal(false),
|
|
5847
|
+
onApply: handleApplyFilters,
|
|
5848
|
+
customDate: customDate,
|
|
5849
|
+
setCustomDate: setCustomDate,
|
|
5850
|
+
ekycStatus: ekycStatus,
|
|
5851
|
+
setEkycStatus: setEkycStatus
|
|
6564
5852
|
}));
|
|
6565
5853
|
};
|
|
6566
5854
|
|
|
@@ -7318,12 +6606,12 @@ const EmployeeApp = _ref => {
|
|
|
7318
6606
|
layoutClass: "normal"
|
|
7319
6607
|
}, /*#__PURE__*/React__default.createElement(VendorDetailsCard, null))
|
|
7320
6608
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
7321
|
-
path:
|
|
6609
|
+
path: `${path}/supervisor-dashboard/:id/:vendorId?`,
|
|
7322
6610
|
component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
7323
6611
|
layoutClass: "normal"
|
|
7324
6612
|
}, /*#__PURE__*/React__default.createElement(SupervisorDetailsCard, null))
|
|
7325
6613
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
7326
|
-
path:
|
|
6614
|
+
path: `${path}/surveyor-dashboard/:id?`,
|
|
7327
6615
|
component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
7328
6616
|
layoutClass: "normal"
|
|
7329
6617
|
}, /*#__PURE__*/React__default.createElement(SurveyorDetailsCard, null))
|
|
@@ -9030,7 +8318,7 @@ const CitizenApp = () => {
|
|
|
9030
8318
|
layoutClass: "normal"
|
|
9031
8319
|
}, /*#__PURE__*/React__default.createElement(Review, null))
|
|
9032
8320
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
9033
|
-
path:
|
|
8321
|
+
path: `${path}/vendor-dashboard/:vendorId?`,
|
|
9034
8322
|
component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
9035
8323
|
layoutClass: "normal"
|
|
9036
8324
|
}, /*#__PURE__*/React__default.createElement(VendorDetailsCard, null))
|