@djb25/digit-ui-module-ekyc 1.0.43 → 1.0.44
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 +573 -368
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +575 -370
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,11 +11,12 @@ var fa = require('react-icons/fa');
|
|
|
11
11
|
var recharts = require('recharts');
|
|
12
12
|
|
|
13
13
|
const EKYCCard = () => {
|
|
14
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2
|
|
14
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
15
15
|
const _useTranslation = reactI18next.useTranslation(),
|
|
16
16
|
t = _useTranslation.t;
|
|
17
17
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
18
|
-
const
|
|
18
|
+
const citizenInfo = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.roles;
|
|
19
|
+
const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code || ele) : [];
|
|
19
20
|
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList({}, {
|
|
20
21
|
tenantId,
|
|
21
22
|
offset: 0,
|
|
@@ -26,47 +27,228 @@ const EKYCCard = () => {
|
|
|
26
27
|
listData = _Digit$Hooks$ekyc$use.data,
|
|
27
28
|
isLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
28
29
|
const totalCount = isLoading ? "-" : (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
const isCitizen = window.location.pathname.includes("/citizen");
|
|
31
|
+
const prefix = isCitizen ? "/digit-ui/citizen/ekyc" : "/digit-ui/employee/ekyc";
|
|
32
|
+
let links = [];
|
|
33
|
+
if (isCitizen) {
|
|
34
|
+
if (roles.includes("EKYC_SURVEYOR")) {
|
|
35
|
+
links.push({
|
|
36
|
+
label: t("SURVEYOR_DASHBOARD"),
|
|
37
|
+
link: prefix + "/surveyor-dashboard"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
41
|
+
links.push({
|
|
42
|
+
count: totalCount,
|
|
43
|
+
label: t("EKYC_INBOX"),
|
|
44
|
+
link: prefix + "/inbox"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
48
|
+
links.push({
|
|
49
|
+
label: t("EKYC_SUPERVISOR_DASHBOARD"),
|
|
50
|
+
link: prefix + "/supervisor-dashboard"
|
|
51
|
+
}, {
|
|
52
|
+
label: t("EKYC_ASSIGN"),
|
|
53
|
+
link: prefix + "/assign"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (roles.includes("EKYC_VENDOR")) {
|
|
57
|
+
links.push({
|
|
58
|
+
label: t("EKYC_VENDOR_DASHBOARD"),
|
|
59
|
+
link: prefix + "/vendor-dashboard"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
63
|
+
links.push({
|
|
64
|
+
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
65
|
+
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (links.length === 0 || roles.length === 1 && roles.includes("CITIZEN")) {
|
|
69
|
+
links.push({
|
|
70
|
+
label: t("EKYC_STATUS"),
|
|
71
|
+
link: prefix + "/:id"
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
links = [{
|
|
38
76
|
label: t("CEO_M.F_DOR_FINANCE_VIEW"),
|
|
39
|
-
link: "/
|
|
77
|
+
link: prefix + "/ceo-dashboard"
|
|
40
78
|
}, {
|
|
41
79
|
label: t("EKYC_ADMIN_DASHBOARD") || "Admin Dashboard",
|
|
42
|
-
link: "/
|
|
80
|
+
link: prefix + "/admin-dashboard"
|
|
43
81
|
}, {
|
|
44
82
|
count: totalCount,
|
|
45
83
|
label: t("EKYC_INBOX"),
|
|
46
|
-
link: "/
|
|
84
|
+
link: prefix + "/inbox"
|
|
47
85
|
}, ...(!roles.includes("EMPLOYEE") ? [{
|
|
48
86
|
label: t("EKYC_ASSIGN"),
|
|
49
|
-
link: "/
|
|
50
|
-
}] : [])]
|
|
87
|
+
link: prefix + "/assign"
|
|
88
|
+
}] : [])];
|
|
89
|
+
}
|
|
90
|
+
const propsForModuleCard = {
|
|
91
|
+
Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PersonIcon, null),
|
|
92
|
+
moduleName: t("ACTION_TEST_EKYC"),
|
|
93
|
+
kpis: isCitizen ? [] : [{
|
|
94
|
+
count: totalCount,
|
|
95
|
+
label: t("TOTAL_EKYC"),
|
|
96
|
+
link: prefix + "/admin-dashboard"
|
|
97
|
+
}],
|
|
98
|
+
links: links
|
|
51
99
|
};
|
|
52
100
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
|
|
53
101
|
};
|
|
54
102
|
|
|
103
|
+
const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
104
|
+
const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
105
|
+
function _catch(body, recover) {
|
|
106
|
+
try {
|
|
107
|
+
var result = body();
|
|
108
|
+
} catch (e) {
|
|
109
|
+
return recover(e);
|
|
110
|
+
}
|
|
111
|
+
if (result && result.then) {
|
|
112
|
+
return result.then(void 0, recover);
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
function _finallyRethrows(body, finalizer) {
|
|
117
|
+
try {
|
|
118
|
+
var result = body();
|
|
119
|
+
} catch (e) {
|
|
120
|
+
return finalizer(true, e);
|
|
121
|
+
}
|
|
122
|
+
if (result && result.then) {
|
|
123
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
124
|
+
}
|
|
125
|
+
return finalizer(false, result);
|
|
126
|
+
}
|
|
127
|
+
|
|
55
128
|
const getChartConstructor = () => {
|
|
56
129
|
const C = Chartjs.Chart || Chartjs__default || Chartjs;
|
|
57
130
|
return C;
|
|
58
131
|
};
|
|
59
132
|
const StatusCards = _ref => {
|
|
133
|
+
var _Digit$SessionStorage;
|
|
60
134
|
let countData = _ref.countData;
|
|
61
135
|
const _useTranslation = reactI18next.useTranslation(),
|
|
62
136
|
t = _useTranslation.t;
|
|
137
|
+
const _useState = React.useState(false),
|
|
138
|
+
ekycDownloadLoading = _useState[0],
|
|
139
|
+
setEkycDownloadLoading = _useState[1];
|
|
140
|
+
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
141
|
+
if (!tenantId || tenantId === "dl") {
|
|
142
|
+
tenantId = "dl.djb";
|
|
143
|
+
}
|
|
144
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
145
|
+
const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
|
|
146
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
|
|
147
|
+
tenantId,
|
|
148
|
+
offset: 0,
|
|
149
|
+
limit: 10,
|
|
150
|
+
ekycStatus: "submitted"
|
|
151
|
+
}, {
|
|
152
|
+
enabled: !!tenantId
|
|
153
|
+
}),
|
|
154
|
+
dashboardData = _Digit$Hooks$ekyc$use.data;
|
|
155
|
+
const apiCountData = React__default.useMemo(() => {
|
|
156
|
+
const info = (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo) || {};
|
|
157
|
+
return {
|
|
158
|
+
total: info.total || 0,
|
|
159
|
+
completed: info.completed || 0,
|
|
160
|
+
pending: info.pending || 0,
|
|
161
|
+
rejected: info.rejected || 0,
|
|
162
|
+
active: info.active || 0
|
|
163
|
+
};
|
|
164
|
+
}, [dashboardData]);
|
|
165
|
+
const handleDownloadEkycData = function () {
|
|
166
|
+
try {
|
|
167
|
+
setEkycDownloadLoading(true);
|
|
168
|
+
return Promise.resolve(_finallyRethrows(function () {
|
|
169
|
+
return _catch(function () {
|
|
170
|
+
return Promise.resolve(Digit.EkycService.application_list({
|
|
171
|
+
tenantId: tenantId,
|
|
172
|
+
offset: 0,
|
|
173
|
+
limit: 10000,
|
|
174
|
+
reportDownload: true
|
|
175
|
+
})).then(function (response) {
|
|
176
|
+
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
177
|
+
if (consumerList.length === 0) {
|
|
178
|
+
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
|
|
182
|
+
const headerMapping = {
|
|
183
|
+
kno: t("KNO") || "KNO",
|
|
184
|
+
firstName: t("FIRST_NAME") || "First Name",
|
|
185
|
+
middleName: t("MIDDLE_NAME") || "Middle Name",
|
|
186
|
+
lastName: t("LAST_NAME") || "Last Name",
|
|
187
|
+
gender: t("GENDER") || "Gender",
|
|
188
|
+
mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
|
|
189
|
+
emailId: t("EMAIL_ID") || "Email ID",
|
|
190
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
|
|
191
|
+
relationship: t("RELATIONSHIP") || "Relationship",
|
|
192
|
+
dob: t("DOB") || "Date of Birth",
|
|
193
|
+
ekycStatus: t("EKYC_STATUS") || "eKYC Status",
|
|
194
|
+
zoneName: t("ZONE") || "Zone",
|
|
195
|
+
assembly: t("ASSEMBLY") || "Assembly",
|
|
196
|
+
ward: t("WARD") || "Ward",
|
|
197
|
+
pincode: t("PINCODE") || "Pincode",
|
|
198
|
+
mrkey: t("MR_KEY") || "MR Key",
|
|
199
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
200
|
+
createdTime: t("CREATED_TIME") || "Created Time",
|
|
201
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
202
|
+
};
|
|
203
|
+
const toTitleCase = str => {
|
|
204
|
+
if (!str) return "";
|
|
205
|
+
const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
|
|
206
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
207
|
+
};
|
|
208
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime"];
|
|
209
|
+
const excelData = consumerList.map(item => {
|
|
210
|
+
const cleanObj = {};
|
|
211
|
+
const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
212
|
+
if (name) {
|
|
213
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
|
|
214
|
+
}
|
|
215
|
+
Object.keys(item).forEach(key => {
|
|
216
|
+
if (excludedKeys.includes(key)) return;
|
|
217
|
+
const val = item[key];
|
|
218
|
+
if (typeof val === "object" && val !== null) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
222
|
+
if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
223
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
224
|
+
} else {
|
|
225
|
+
cleanObj[friendlyHeader] = val;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
return cleanObj;
|
|
229
|
+
});
|
|
230
|
+
const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
|
|
231
|
+
Digit.Download.Excel(excelData, cleanFileName);
|
|
232
|
+
});
|
|
233
|
+
}, function (error) {
|
|
234
|
+
console.error("Error downloading eKYC Excel:", error);
|
|
235
|
+
});
|
|
236
|
+
}, function (_wasThrown, _result) {
|
|
237
|
+
setEkycDownloadLoading(false);
|
|
238
|
+
if (_wasThrown) throw _result;
|
|
239
|
+
return _result;
|
|
240
|
+
}));
|
|
241
|
+
} catch (e) {
|
|
242
|
+
return Promise.reject(e);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
63
245
|
const chartRef1 = React.useRef(null);
|
|
64
246
|
const chartInstance1 = React.useRef(null);
|
|
65
|
-
const total = (countData === null || countData === void 0 ? void 0 : countData.total) || 0;
|
|
66
|
-
const pending = (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
|
|
67
|
-
const active = (countData === null || countData === void 0 ? void 0 : countData.
|
|
68
|
-
const completed = 0;
|
|
69
|
-
const actualCompleted =
|
|
247
|
+
const total = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.total) || (countData === null || countData === void 0 ? void 0 : countData.total) || (countData === null || countData === void 0 ? void 0 : countData.totalCount) || 0;
|
|
248
|
+
const pending = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.pending) || (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
|
|
249
|
+
const active = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.active) || (countData === null || countData === void 0 ? void 0 : countData.active) || 0;
|
|
250
|
+
const completed = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.completed) || (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
|
|
251
|
+
const actualCompleted = completed;
|
|
70
252
|
const approved = actualCompleted;
|
|
71
253
|
const efficiency = total > 0 ? Math.round(actualCompleted / total * 100) : 0;
|
|
72
254
|
const healthPct = total > 0 ? Math.round(approved / total * 100) : 0;
|
|
@@ -139,7 +321,29 @@ const StatusCards = _ref => {
|
|
|
139
321
|
className: "total-number"
|
|
140
322
|
}, formatNumber(total)), /*#__PURE__*/React__default.createElement("div", {
|
|
141
323
|
className: "total-badge"
|
|
142
|
-
}, "\u2197 +12.4% ", t("EKYC_FROM_LAST_QUARTER") || "from last quarter")
|
|
324
|
+
}, "\u2197 +12.4% ", t("EKYC_FROM_LAST_QUARTER") || "from last quarter"), /*#__PURE__*/React__default.createElement("button", {
|
|
325
|
+
className: "download-excel-btn",
|
|
326
|
+
disabled: ekycDownloadLoading,
|
|
327
|
+
onClick: handleDownloadEkycData
|
|
328
|
+
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
329
|
+
width: "16",
|
|
330
|
+
height: "16",
|
|
331
|
+
viewBox: "0 0 24 24",
|
|
332
|
+
fill: "none",
|
|
333
|
+
stroke: "currentColor",
|
|
334
|
+
strokeWidth: "2.5",
|
|
335
|
+
strokeLinecap: "round",
|
|
336
|
+
strokeLinejoin: "round"
|
|
337
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
338
|
+
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
339
|
+
}), /*#__PURE__*/React__default.createElement("polyline", {
|
|
340
|
+
points: "7 10 12 15 17 10"
|
|
341
|
+
}), /*#__PURE__*/React__default.createElement("line", {
|
|
342
|
+
x1: "12",
|
|
343
|
+
y1: "15",
|
|
344
|
+
x2: "12",
|
|
345
|
+
y2: "3"
|
|
346
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))), /*#__PURE__*/React__default.createElement("div", {
|
|
143
347
|
className: "status-panels-grid"
|
|
144
348
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
145
349
|
className: "status-panel"
|
|
@@ -282,6 +486,10 @@ const DesktopInbox = _ref => {
|
|
|
282
486
|
countData = props.countData;
|
|
283
487
|
const _useTranslation = reactI18next.useTranslation(),
|
|
284
488
|
t = _useTranslation.t;
|
|
489
|
+
const toTitleCase = str => {
|
|
490
|
+
if (!str) return "";
|
|
491
|
+
return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
492
|
+
};
|
|
285
493
|
const history = reactRouterDom.useHistory();
|
|
286
494
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
287
495
|
const FilterComponent = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent(filterComponent);
|
|
@@ -324,37 +532,38 @@ const DesktopInbox = _ref => {
|
|
|
324
532
|
Cell: _ref3 => {
|
|
325
533
|
var _row$original3;
|
|
326
534
|
let row = _ref3.row;
|
|
327
|
-
return /*#__PURE__*/React__default.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
|
|
535
|
+
return /*#__PURE__*/React__default.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
|
|
328
536
|
}
|
|
329
537
|
}, {
|
|
330
538
|
Header: t("EKYC_STATUS"),
|
|
331
539
|
accessor: "actionStatus",
|
|
332
540
|
Cell: _ref4 => {
|
|
333
|
-
var _row$original4;
|
|
541
|
+
var _row$original4, _row$original5;
|
|
334
542
|
let row = _ref4.row;
|
|
335
543
|
const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
|
|
336
544
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
337
545
|
className: "ekyc-status-tag " + status
|
|
338
|
-
},
|
|
546
|
+
}, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
|
|
339
547
|
}
|
|
340
548
|
}, {
|
|
341
549
|
Header: t("EKYC_EKYC_STATUS"),
|
|
342
550
|
accessor: "ekycStatus",
|
|
343
551
|
Cell: _ref5 => {
|
|
344
|
-
var _row$
|
|
552
|
+
var _row$original6, _row$original7;
|
|
345
553
|
let row = _ref5.row;
|
|
346
|
-
const
|
|
554
|
+
const raw = ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycStatus) || ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.ekycstatus) || "NA";
|
|
555
|
+
const ekycStatus = raw.toUpperCase();
|
|
347
556
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
348
557
|
className: "ekyc-status-tag " + ekycStatus
|
|
349
|
-
},
|
|
558
|
+
}, toTitleCase(raw));
|
|
350
559
|
}
|
|
351
560
|
}, {
|
|
352
561
|
Header: t("EKYC_ACTION"),
|
|
353
562
|
accessor: "status",
|
|
354
563
|
Cell: _ref6 => {
|
|
355
|
-
var _row$
|
|
564
|
+
var _row$original8, _row$original9;
|
|
356
565
|
let row = _ref6.row;
|
|
357
|
-
const kno = ((_row$
|
|
566
|
+
const kno = ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.kno) || ((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.applicationNumber) || "NA";
|
|
358
567
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
359
568
|
className: "link",
|
|
360
569
|
onClick: () => handleReview(kno)
|
|
@@ -1593,31 +1802,6 @@ const CeoDashboard = () => {
|
|
|
1593
1802
|
}, /*#__PURE__*/React__default.createElement("h3", null, topKpis.successRate, "%"), /*#__PURE__*/React__default.createElement("p", null, "Operational Efficiency")))))));
|
|
1594
1803
|
};
|
|
1595
1804
|
|
|
1596
|
-
const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
1597
|
-
const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
1598
|
-
function _catch(body, recover) {
|
|
1599
|
-
try {
|
|
1600
|
-
var result = body();
|
|
1601
|
-
} catch (e) {
|
|
1602
|
-
return recover(e);
|
|
1603
|
-
}
|
|
1604
|
-
if (result && result.then) {
|
|
1605
|
-
return result.then(void 0, recover);
|
|
1606
|
-
}
|
|
1607
|
-
return result;
|
|
1608
|
-
}
|
|
1609
|
-
function _finallyRethrows(body, finalizer) {
|
|
1610
|
-
try {
|
|
1611
|
-
var result = body();
|
|
1612
|
-
} catch (e) {
|
|
1613
|
-
return finalizer(true, e);
|
|
1614
|
-
}
|
|
1615
|
-
if (result && result.then) {
|
|
1616
|
-
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
1617
|
-
}
|
|
1618
|
-
return finalizer(false, result);
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
1805
|
const downloadSurveyorPDF = function (_ref) {
|
|
1622
1806
|
let rows = _ref.rows,
|
|
1623
1807
|
surveyorName = _ref.surveyorName,
|
|
@@ -1707,6 +1891,123 @@ const downloadSurveyorPDF = function (_ref) {
|
|
|
1707
1891
|
return Promise.reject(e);
|
|
1708
1892
|
}
|
|
1709
1893
|
};
|
|
1894
|
+
const downloadSupervisorPDF = function (_ref2) {
|
|
1895
|
+
let rows = _ref2.rows,
|
|
1896
|
+
supervisorName = _ref2.supervisorName,
|
|
1897
|
+
mobileNumber = _ref2.mobileNumber,
|
|
1898
|
+
vendorName = _ref2.vendorName,
|
|
1899
|
+
dashboardInfo = _ref2.dashboardInfo,
|
|
1900
|
+
t = _ref2.t;
|
|
1901
|
+
try {
|
|
1902
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
1903
|
+
const name = "Delhi Jal Board";
|
|
1904
|
+
const email = "contact@delhijalboard.nic.in";
|
|
1905
|
+
const phoneNumber = "+91-11-23538416";
|
|
1906
|
+
const currentDate = new Date();
|
|
1907
|
+
const formattedDate = currentDate.toLocaleDateString("en-IN", {
|
|
1908
|
+
day: "2-digit",
|
|
1909
|
+
month: "2-digit",
|
|
1910
|
+
year: "numeric"
|
|
1911
|
+
});
|
|
1912
|
+
const formattedTime = currentDate.toLocaleTimeString("en-IN", {
|
|
1913
|
+
hour: "2-digit",
|
|
1914
|
+
minute: "2-digit",
|
|
1915
|
+
second: "2-digit",
|
|
1916
|
+
hour12: false
|
|
1917
|
+
});
|
|
1918
|
+
const downloadDateTime = formattedDate + " " + formattedTime;
|
|
1919
|
+
const isValDefined = val => val !== undefined && val !== null && val !== "";
|
|
1920
|
+
const details = [{
|
|
1921
|
+
title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
|
|
1922
|
+
asSectionHeader: true,
|
|
1923
|
+
values: [{
|
|
1924
|
+
title: t("SUPERVISOR_NAME") || "Supervisor Name",
|
|
1925
|
+
value: supervisorName
|
|
1926
|
+
}, {
|
|
1927
|
+
title: t("MOBILE_NUMBER") || "Mobile Number",
|
|
1928
|
+
value: mobileNumber
|
|
1929
|
+
}, {
|
|
1930
|
+
title: t("VENDOR_NAME") || "Vendor Name",
|
|
1931
|
+
value: vendorName
|
|
1932
|
+
}].filter(item => isValDefined(item.value))
|
|
1933
|
+
}, {
|
|
1934
|
+
title: t("SUMMARY_STATISTICS") || "Summary Statistics",
|
|
1935
|
+
asSectionHeader: true,
|
|
1936
|
+
values: [{
|
|
1937
|
+
title: t("TOTAL_ASSIGNED") || "Total Assigned",
|
|
1938
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
|
|
1939
|
+
}, {
|
|
1940
|
+
title: t("COMPLETED") || "Completed",
|
|
1941
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
|
|
1942
|
+
}, {
|
|
1943
|
+
title: t("PENDING") || "Pending",
|
|
1944
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
|
|
1945
|
+
}, {
|
|
1946
|
+
title: t("SUBMITTED") || "Submitted",
|
|
1947
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
|
|
1948
|
+
}].filter(item => isValDefined(item.value))
|
|
1949
|
+
}];
|
|
1950
|
+
const mappedRows = rows.map(row => {
|
|
1951
|
+
var _row$owner, _row$owner2;
|
|
1952
|
+
return {
|
|
1953
|
+
kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
|
|
1954
|
+
firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
|
|
1955
|
+
lastName: "",
|
|
1956
|
+
mobileNo: row.status || "N/A",
|
|
1957
|
+
zoneName: String(row.total || 0),
|
|
1958
|
+
ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
|
|
1959
|
+
submittedAt: 1717171717171,
|
|
1960
|
+
progress: row.progress || "0%"
|
|
1961
|
+
};
|
|
1962
|
+
});
|
|
1963
|
+
const originalToLocaleDateString = Date.prototype.toLocaleDateString;
|
|
1964
|
+
let progressIndex = 0;
|
|
1965
|
+
Date.prototype.toLocaleDateString = function () {
|
|
1966
|
+
if (progressIndex < mappedRows.length) {
|
|
1967
|
+
return mappedRows[progressIndex++].progress || "0%";
|
|
1968
|
+
}
|
|
1969
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1970
|
+
args[_key] = arguments[_key];
|
|
1971
|
+
}
|
|
1972
|
+
return originalToLocaleDateString.apply(this, args);
|
|
1973
|
+
};
|
|
1974
|
+
const customT = key => {
|
|
1975
|
+
if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
|
|
1976
|
+
if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
|
|
1977
|
+
if (key === "MOBILE") return t("STATUS") || "Status";
|
|
1978
|
+
if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
|
|
1979
|
+
if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
|
|
1980
|
+
if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
|
|
1981
|
+
if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
|
|
1982
|
+
return t(key);
|
|
1983
|
+
};
|
|
1984
|
+
try {
|
|
1985
|
+
if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
|
|
1986
|
+
window.Digit.Utils.pdf.generateSurveyorReport({
|
|
1987
|
+
tenantId,
|
|
1988
|
+
logo: null,
|
|
1989
|
+
name,
|
|
1990
|
+
email,
|
|
1991
|
+
phoneNumber,
|
|
1992
|
+
heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
|
|
1993
|
+
details,
|
|
1994
|
+
applicationNumber: mobileNumber,
|
|
1995
|
+
rows: mappedRows,
|
|
1996
|
+
t: customT,
|
|
1997
|
+
hideApplicationNumber: true,
|
|
1998
|
+
downloadTime: downloadDateTime
|
|
1999
|
+
});
|
|
2000
|
+
} else {
|
|
2001
|
+
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
2002
|
+
}
|
|
2003
|
+
} finally {
|
|
2004
|
+
Date.prototype.toLocaleDateString = originalToLocaleDateString;
|
|
2005
|
+
}
|
|
2006
|
+
return Promise.resolve();
|
|
2007
|
+
} catch (e) {
|
|
2008
|
+
return Promise.reject(e);
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
1710
2011
|
const downloadVendorPDF = function (_ref3) {
|
|
1711
2012
|
let rows = _ref3.rows,
|
|
1712
2013
|
vendorName = _ref3.vendorName,
|
|
@@ -1932,6 +2233,10 @@ const VendorDetailsCard = () => {
|
|
|
1932
2233
|
}
|
|
1933
2234
|
return "N/A";
|
|
1934
2235
|
}, [vendor]);
|
|
2236
|
+
const zoneIds = React.useMemo(() => {
|
|
2237
|
+
var _vendor$zoneIds;
|
|
2238
|
+
return vendor !== null && vendor !== void 0 && (_vendor$zoneIds = vendor.zoneIds) !== null && _vendor$zoneIds !== void 0 && _vendor$zoneIds.length ? vendor.zoneIds.map(zone => zone.toUpperCase().replace("", " ")).join(", ") : "N/A";
|
|
2239
|
+
}, [vendor]);
|
|
1935
2240
|
const cards = React.useMemo(() => {
|
|
1936
2241
|
const hasRealData = vendorSupervisors.some(s => s.totalKnos > 0);
|
|
1937
2242
|
const totalKnos = hasRealData ? vendorSupervisors.reduce((acc, s) => acc + (s.totalKnos || 0), 0) : (progressData === null || progressData === void 0 ? void 0 : progressData.totalKnos) || (vendor === null || vendor === void 0 ? void 0 : vendor.assignedConnections) || 0;
|
|
@@ -1989,7 +2294,7 @@ const VendorDetailsCard = () => {
|
|
|
1989
2294
|
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
1990
2295
|
return;
|
|
1991
2296
|
}
|
|
1992
|
-
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "
|
|
2297
|
+
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
|
|
1993
2298
|
const headerMapping = {
|
|
1994
2299
|
kno: t("KNO") || "KNO",
|
|
1995
2300
|
firstName: t("FIRST_NAME") || "First Name",
|
|
@@ -2314,9 +2619,9 @@ const VendorDetailsCard = () => {
|
|
|
2314
2619
|
className: "detail-item"
|
|
2315
2620
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
2316
2621
|
className: "label"
|
|
2317
|
-
}, t("
|
|
2622
|
+
}, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React__default.createElement("span", {
|
|
2318
2623
|
className: "value"
|
|
2319
|
-
},
|
|
2624
|
+
}, zoneIds)))), /*#__PURE__*/React__default.createElement("div", {
|
|
2320
2625
|
className: "details-right"
|
|
2321
2626
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2322
2627
|
className: "download-card"
|
|
@@ -2394,6 +2699,10 @@ const useInboxTableConfig = _ref => {
|
|
|
2394
2699
|
tableStyle = _ref$tableStyle === void 0 ? {} : _ref$tableStyle;
|
|
2395
2700
|
const _useTranslation = reactI18next.useTranslation(),
|
|
2396
2701
|
t = _useTranslation.t;
|
|
2702
|
+
const toTitleCase = str => {
|
|
2703
|
+
if (!str) return "";
|
|
2704
|
+
return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
2705
|
+
};
|
|
2397
2706
|
const history = reactRouterDom.useHistory();
|
|
2398
2707
|
const _useState = React.useState(""),
|
|
2399
2708
|
selectedKno = _useState[0],
|
|
@@ -2437,18 +2746,18 @@ const useInboxTableConfig = _ref => {
|
|
|
2437
2746
|
Cell: _ref3 => {
|
|
2438
2747
|
var _row$original3;
|
|
2439
2748
|
let row = _ref3.row;
|
|
2440
|
-
return /*#__PURE__*/React__default.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
|
|
2749
|
+
return /*#__PURE__*/React__default.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
|
|
2441
2750
|
}
|
|
2442
2751
|
}, {
|
|
2443
2752
|
Header: t("EKYC_STATUS"),
|
|
2444
2753
|
accessor: "actionStatus",
|
|
2445
2754
|
Cell: _ref4 => {
|
|
2446
|
-
var _row$original4;
|
|
2755
|
+
var _row$original4, _row$original5;
|
|
2447
2756
|
let row = _ref4.row;
|
|
2448
2757
|
const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
|
|
2449
2758
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
2450
2759
|
className: "ekyc-status-tag " + status
|
|
2451
|
-
},
|
|
2760
|
+
}, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
|
|
2452
2761
|
}
|
|
2453
2762
|
}, {
|
|
2454
2763
|
Header: t("SUBMITTED_AT") || "Submitted At",
|
|
@@ -2468,12 +2777,13 @@ const useInboxTableConfig = _ref => {
|
|
|
2468
2777
|
Header: t("EKYC_EKYC_STATUS"),
|
|
2469
2778
|
accessor: "ekycStatus",
|
|
2470
2779
|
Cell: _ref7 => {
|
|
2471
|
-
var _row$
|
|
2780
|
+
var _row$original6, _row$original7;
|
|
2472
2781
|
let row = _ref7.row;
|
|
2473
|
-
const
|
|
2782
|
+
const raw = ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycStatus) || ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.ekycstatus) || "NA";
|
|
2783
|
+
const ekycStatus = raw.toUpperCase();
|
|
2474
2784
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
2475
2785
|
className: "ekyc-status-tag " + ekycStatus
|
|
2476
|
-
},
|
|
2786
|
+
}, toTitleCase(raw));
|
|
2477
2787
|
}
|
|
2478
2788
|
}];
|
|
2479
2789
|
return {
|
|
@@ -3184,7 +3494,9 @@ const Inbox = _ref => {
|
|
|
3184
3494
|
propsForInboxTable,
|
|
3185
3495
|
propsForInboxMobileCards,
|
|
3186
3496
|
formState,
|
|
3187
|
-
countData: listData
|
|
3497
|
+
countData: listData,
|
|
3498
|
+
forceTable: true,
|
|
3499
|
+
showSearchOnMobile: true
|
|
3188
3500
|
})));
|
|
3189
3501
|
};
|
|
3190
3502
|
|
|
@@ -5864,12 +6176,14 @@ const AssignEkyc = () => {
|
|
|
5864
6176
|
propsForInboxMobileCards,
|
|
5865
6177
|
formState,
|
|
5866
6178
|
countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
|
|
5867
|
-
isCardLoading: isDataSearchLoading
|
|
6179
|
+
isCardLoading: isDataSearchLoading,
|
|
6180
|
+
showSearchOnMobile: true,
|
|
6181
|
+
forceTable: true
|
|
5868
6182
|
})));
|
|
5869
6183
|
};
|
|
5870
6184
|
|
|
5871
6185
|
const AdminDashboard = () => {
|
|
5872
|
-
var _Digit$SessionStorage
|
|
6186
|
+
var _Digit$SessionStorage;
|
|
5873
6187
|
const _useTranslation = reactI18next.useTranslation(),
|
|
5874
6188
|
t = _useTranslation.t;
|
|
5875
6189
|
const history = reactRouterDom.useHistory();
|
|
@@ -5878,177 +6192,55 @@ const AdminDashboard = () => {
|
|
|
5878
6192
|
tenantId = "dl.djb";
|
|
5879
6193
|
}
|
|
5880
6194
|
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
5881
|
-
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
5882
|
-
status: "ACTIVE"
|
|
5883
|
-
}, {
|
|
5884
|
-
enabled: !!tenantId
|
|
5885
|
-
}),
|
|
5886
|
-
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
5887
|
-
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
5888
|
-
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
5889
|
-
enabled: !!tenantId,
|
|
5890
|
-
keepPreviousData: true
|
|
5891
|
-
}),
|
|
5892
|
-
progressData = _Digit$Hooks$ekyc$use.data,
|
|
5893
|
-
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
5894
|
-
const vendorsList = React.useMemo(() => {
|
|
5895
|
-
if (vendorSearchResponse && vendorSearchResponse.length > 0) {
|
|
5896
|
-
return vendorSearchResponse.map(v => {
|
|
5897
|
-
var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
|
|
5898
|
-
const dso = v.dsoDetails || v;
|
|
5899
|
-
const supervisorsList = dso.supervisors || [];
|
|
5900
|
-
const surveyorsList = dso.surveyors || [];
|
|
5901
|
-
const supervisorIds = supervisorsList.map(s => {
|
|
5902
|
-
var _s$owner;
|
|
5903
|
-
return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
|
|
5904
|
-
}).filter(Boolean);
|
|
5905
|
-
const matchedReports = (progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.filter(r => supervisorIds.includes(r.supervisorId))) || [];
|
|
5906
|
-
const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
|
|
5907
|
-
const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
|
|
5908
|
-
const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
|
|
5909
|
-
const progress = total > 0 ? Math.round(completed / total * 100) : 0;
|
|
5910
|
-
const rejected = 0;
|
|
5911
|
-
return {
|
|
5912
|
-
id: dso.id || dso.vendorId || v.id || v.vendorId,
|
|
5913
|
-
name: dso.name || dso.displayName || v.name || "N/A",
|
|
5914
|
-
ownerName: ((_dso$owner = dso.owner) === null || _dso$owner === void 0 ? void 0 : _dso$owner.name) || ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.name) || "N/A",
|
|
5915
|
-
mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
|
|
5916
|
-
supervisors: supervisorsList.length,
|
|
5917
|
-
surveyors: surveyorsList.length,
|
|
5918
|
-
completed: completed,
|
|
5919
|
-
progress: progress,
|
|
5920
|
-
pending: pending,
|
|
5921
|
-
rejected: rejected
|
|
5922
|
-
};
|
|
5923
|
-
});
|
|
5924
|
-
}
|
|
5925
|
-
return [];
|
|
5926
|
-
}, [vendorSearchResponse, progressData]);
|
|
5927
|
-
const _useState = React.useState(false),
|
|
5928
|
-
ekycDownloadLoading = _useState[0],
|
|
5929
|
-
setEkycDownloadLoading = _useState[1];
|
|
5930
|
-
const _useState2 = React.useState(0),
|
|
5931
|
-
currentPage = _useState2[0];
|
|
5932
|
-
const _useState3 = React.useState(20),
|
|
5933
|
-
pageSize = _useState3[0];
|
|
5934
|
-
const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycApplicationList({}, {
|
|
5935
|
-
tenantId,
|
|
5936
|
-
offset: currentPage * pageSize,
|
|
5937
|
-
limit: pageSize
|
|
5938
|
-
}, {
|
|
5939
|
-
keepPreviousData: true
|
|
5940
|
-
});
|
|
5941
|
-
const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
|
|
5942
|
-
const mobileNumber = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || "N/A";
|
|
5943
|
-
const roleText = (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$roles = loggedInUser.roles) === null || _loggedInUser$roles === void 0 ? void 0 : _loggedInUser$roles.map(r => r.name).join(", ")) || "EKYC Admin";
|
|
5944
|
-
const handleDownloadEkycData = function () {
|
|
5945
|
-
try {
|
|
5946
|
-
setEkycDownloadLoading(true);
|
|
5947
|
-
return Promise.resolve(_finallyRethrows(function () {
|
|
5948
|
-
return _catch(function () {
|
|
5949
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
5950
|
-
tenantId: tenantId,
|
|
5951
|
-
offset: 0,
|
|
5952
|
-
limit: 10000,
|
|
5953
|
-
reportDownload: true
|
|
5954
|
-
})).then(function (response) {
|
|
5955
|
-
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
5956
|
-
if (consumerList.length === 0) {
|
|
5957
|
-
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
5958
|
-
return;
|
|
5959
|
-
}
|
|
5960
|
-
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "assignedTime", "isSelfAssigned", "userType", "tenantName", "tenantMobile"];
|
|
5961
|
-
const headerMapping = {
|
|
5962
|
-
kno: t("KNO") || "KNO",
|
|
5963
|
-
firstName: t("FIRST_NAME") || "First Name",
|
|
5964
|
-
middleName: t("MIDDLE_NAME") || "Middle Name",
|
|
5965
|
-
lastName: t("LAST_NAME") || "Last Name",
|
|
5966
|
-
gender: t("GENDER") || "Gender",
|
|
5967
|
-
mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
|
|
5968
|
-
emailId: t("EMAIL_ID") || "Email ID",
|
|
5969
|
-
fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
|
|
5970
|
-
relationship: t("RELATIONSHIP") || "Relationship",
|
|
5971
|
-
dob: t("DOB") || "Date of Birth",
|
|
5972
|
-
ekycStatus: t("EKYC_STATUS") || "eKYC Status",
|
|
5973
|
-
zoneName: t("ZONE") || "Zone",
|
|
5974
|
-
assembly: t("ASSEMBLY") || "Assembly",
|
|
5975
|
-
ward: t("WARD") || "Ward",
|
|
5976
|
-
pincode: t("PINCODE") || "Pincode",
|
|
5977
|
-
mrkey: t("MR_KEY") || "MR Key",
|
|
5978
|
-
createdTime: t("CREATED_TIME") || "Created Time",
|
|
5979
|
-
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
5980
|
-
};
|
|
5981
|
-
const excelData = consumerList.map(item => {
|
|
5982
|
-
const cleanObj = {};
|
|
5983
|
-
const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
5984
|
-
if (name) {
|
|
5985
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = name;
|
|
5986
|
-
}
|
|
5987
|
-
Object.keys(item).forEach(key => {
|
|
5988
|
-
if (excludedKeys.includes(key)) return;
|
|
5989
|
-
const val = item[key];
|
|
5990
|
-
if (typeof val === "object" && val !== null) {
|
|
5991
|
-
return;
|
|
5992
|
-
}
|
|
5993
|
-
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
5994
|
-
cleanObj[friendlyHeader] = val;
|
|
5995
|
-
});
|
|
5996
|
-
return cleanObj;
|
|
5997
|
-
});
|
|
5998
|
-
const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
|
|
5999
|
-
Digit.Download.Excel(excelData, cleanFileName);
|
|
6000
|
-
});
|
|
6001
|
-
}, function (error) {
|
|
6002
|
-
console.error("Error downloading eKYC Excel:", error);
|
|
6003
|
-
});
|
|
6004
|
-
}, function (_wasThrown, _result) {
|
|
6005
|
-
setEkycDownloadLoading(false);
|
|
6006
|
-
if (_wasThrown) throw _result;
|
|
6007
|
-
return _result;
|
|
6008
|
-
}));
|
|
6009
|
-
} catch (e) {
|
|
6010
|
-
return Promise.reject(e);
|
|
6195
|
+
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
6196
|
+
status: "ACTIVE"
|
|
6197
|
+
}, {
|
|
6198
|
+
enabled: !!tenantId
|
|
6199
|
+
}),
|
|
6200
|
+
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
6201
|
+
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
6202
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
6203
|
+
enabled: !!tenantId,
|
|
6204
|
+
keepPreviousData: true
|
|
6205
|
+
}),
|
|
6206
|
+
progressData = _Digit$Hooks$ekyc$use.data,
|
|
6207
|
+
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
6208
|
+
const vendorsList = React.useMemo(() => {
|
|
6209
|
+
if (vendorSearchResponse && vendorSearchResponse.length > 0) {
|
|
6210
|
+
return vendorSearchResponse.map(v => {
|
|
6211
|
+
var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
|
|
6212
|
+
const dso = v.dsoDetails || v;
|
|
6213
|
+
const supervisorsList = dso.supervisors || [];
|
|
6214
|
+
const surveyorsList = dso.surveyors || [];
|
|
6215
|
+
const supervisorIds = supervisorsList.map(s => {
|
|
6216
|
+
var _s$owner;
|
|
6217
|
+
return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
|
|
6218
|
+
}).filter(Boolean);
|
|
6219
|
+
const matchedReports = (progressData === null || progressData === void 0 ? void 0 : (_progressData$supervi = progressData.supervisorReport) === null || _progressData$supervi === void 0 ? void 0 : _progressData$supervi.filter(r => supervisorIds.includes(r.supervisorId))) || [];
|
|
6220
|
+
const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
|
|
6221
|
+
const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
|
|
6222
|
+
const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
|
|
6223
|
+
const progress = total > 0 ? Math.round(completed / total * 100) : 0;
|
|
6224
|
+
const rejected = 0;
|
|
6225
|
+
return {
|
|
6226
|
+
id: dso.id || dso.vendorId || v.id || v.vendorId,
|
|
6227
|
+
name: dso.name || dso.displayName || v.name || "N/A",
|
|
6228
|
+
ownerName: ((_dso$owner = dso.owner) === null || _dso$owner === void 0 ? void 0 : _dso$owner.name) || ((_v$owner = v.owner) === null || _v$owner === void 0 ? void 0 : _v$owner.name) || "N/A",
|
|
6229
|
+
mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
|
|
6230
|
+
supervisors: supervisorsList.length,
|
|
6231
|
+
surveyors: surveyorsList.length,
|
|
6232
|
+
completed: completed,
|
|
6233
|
+
progress: progress,
|
|
6234
|
+
pending: pending,
|
|
6235
|
+
rejected: rejected
|
|
6236
|
+
};
|
|
6237
|
+
});
|
|
6011
6238
|
}
|
|
6012
|
-
|
|
6239
|
+
return [];
|
|
6240
|
+
}, [vendorSearchResponse, progressData]);
|
|
6013
6241
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
6014
6242
|
className: "surveyor-dashboard"
|
|
6015
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6016
|
-
className: "ekyc-dashboard-section"
|
|
6017
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6018
|
-
className: "ekyc-dashboard-header"
|
|
6019
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6020
|
-
className: "avatar"
|
|
6021
|
-
}, 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", {
|
|
6022
|
-
className: "header-content"
|
|
6023
|
-
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
6024
|
-
className: "name"
|
|
6025
|
-
}, fullName), /*#__PURE__*/React__default.createElement("div", {
|
|
6026
|
-
className: "designation"
|
|
6027
|
-
}, t("EKYC_ADMIN") || "eKYC Admin / Manager"), /*#__PURE__*/React__default.createElement("div", {
|
|
6028
|
-
className: "mobile-number"
|
|
6029
|
-
}, mobileNumber))), /*#__PURE__*/React__default.createElement("button", {
|
|
6030
|
-
className: "download-excel-btn",
|
|
6031
|
-
disabled: ekycDownloadLoading,
|
|
6032
|
-
onClick: handleDownloadEkycData
|
|
6033
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
6034
|
-
width: "16",
|
|
6035
|
-
height: "16",
|
|
6036
|
-
viewBox: "0 0 24 24",
|
|
6037
|
-
fill: "none",
|
|
6038
|
-
stroke: "currentColor",
|
|
6039
|
-
strokeWidth: "2.5",
|
|
6040
|
-
strokeLinecap: "round",
|
|
6041
|
-
strokeLinejoin: "round"
|
|
6042
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
6043
|
-
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
6044
|
-
}), /*#__PURE__*/React__default.createElement("polyline", {
|
|
6045
|
-
points: "7 10 12 15 17 10"
|
|
6046
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
6047
|
-
x1: "12",
|
|
6048
|
-
y1: "15",
|
|
6049
|
-
x2: "12",
|
|
6050
|
-
y2: "3"
|
|
6051
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")), /*#__PURE__*/React__default.createElement(Dashboard, null), /*#__PURE__*/React__default.createElement("div", {
|
|
6243
|
+
}, /*#__PURE__*/React__default.createElement(Dashboard, null), /*#__PURE__*/React__default.createElement("div", {
|
|
6052
6244
|
className: "admin-performance-section"
|
|
6053
6245
|
}, /*#__PURE__*/React__default.createElement("h3", {
|
|
6054
6246
|
className: "section-title"
|
|
@@ -6336,7 +6528,8 @@ const SupervisorDetailsCard = () => {
|
|
|
6336
6528
|
showCustomPicker = _useState6[0],
|
|
6337
6529
|
setShowCustomPicker = _useState6[1];
|
|
6338
6530
|
const _useState7 = React.useState(false),
|
|
6339
|
-
reportLoading = _useState7[0]
|
|
6531
|
+
reportLoading = _useState7[0],
|
|
6532
|
+
setReportLoading = _useState7[1];
|
|
6340
6533
|
const reportMenuRef = React.useRef(null);
|
|
6341
6534
|
React.useEffect(() => {
|
|
6342
6535
|
const handler = e => {
|
|
@@ -6348,6 +6541,42 @@ const SupervisorDetailsCard = () => {
|
|
|
6348
6541
|
document.addEventListener("mousedown", handler);
|
|
6349
6542
|
return () => document.removeEventListener("mousedown", handler);
|
|
6350
6543
|
}, []);
|
|
6544
|
+
const handleDownload = () => {
|
|
6545
|
+
setReportLoading(true);
|
|
6546
|
+
try {
|
|
6547
|
+
const rowsWithStats = surveyors.map(s => ({
|
|
6548
|
+
name: s.surveyorName,
|
|
6549
|
+
mobileNo: s.mobileNo,
|
|
6550
|
+
status: s.status,
|
|
6551
|
+
total: s.totalKnos,
|
|
6552
|
+
completed: s.submittedKnos,
|
|
6553
|
+
pending: s.pendingKnos,
|
|
6554
|
+
progress: s.progressPercent + "%"
|
|
6555
|
+
}));
|
|
6556
|
+
const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
|
|
6557
|
+
const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
|
|
6558
|
+
downloadSupervisorPDF({
|
|
6559
|
+
rows: rowsWithStats,
|
|
6560
|
+
supervisorName: fullName,
|
|
6561
|
+
vendorName,
|
|
6562
|
+
mobileNumber,
|
|
6563
|
+
email,
|
|
6564
|
+
dashboardInfo: {
|
|
6565
|
+
total: totalKnos,
|
|
6566
|
+
completed: completedKnos,
|
|
6567
|
+
pending: totalKnos - completedKnos,
|
|
6568
|
+
submittedCount: completedKnos
|
|
6569
|
+
},
|
|
6570
|
+
t
|
|
6571
|
+
});
|
|
6572
|
+
} catch (err) {
|
|
6573
|
+
console.error("Failed to generate supervisor report:", err);
|
|
6574
|
+
} finally {
|
|
6575
|
+
setReportLoading(false);
|
|
6576
|
+
setShowReportMenu(false);
|
|
6577
|
+
setShowCustomPicker(false);
|
|
6578
|
+
}
|
|
6579
|
+
};
|
|
6351
6580
|
const handlePresetDownload = filter => {
|
|
6352
6581
|
handleDownload();
|
|
6353
6582
|
};
|
|
@@ -6403,14 +6632,21 @@ const SupervisorDetailsCard = () => {
|
|
|
6403
6632
|
ward: t("WARD") || "Ward",
|
|
6404
6633
|
pincode: t("PINCODE") || "Pincode",
|
|
6405
6634
|
mrkey: t("MR_KEY") || "MR Key",
|
|
6635
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
6406
6636
|
createdTime: t("CREATED_TIME") || "Created Time",
|
|
6407
6637
|
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
6408
6638
|
};
|
|
6639
|
+
const toTitleCase = str => {
|
|
6640
|
+
if (!str) return "";
|
|
6641
|
+
const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
|
|
6642
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
6643
|
+
};
|
|
6644
|
+
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
6409
6645
|
const excelData = consumerList.map(item => {
|
|
6410
6646
|
const cleanObj = {};
|
|
6411
6647
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6412
6648
|
if (fullName) {
|
|
6413
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
6649
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
6414
6650
|
}
|
|
6415
6651
|
Object.keys(item).forEach(key => {
|
|
6416
6652
|
if (excludedKeys.includes(key)) return;
|
|
@@ -6419,7 +6655,11 @@ const SupervisorDetailsCard = () => {
|
|
|
6419
6655
|
return;
|
|
6420
6656
|
}
|
|
6421
6657
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6422
|
-
|
|
6658
|
+
if (typeof val === "string" && titleCaseFields.includes(key)) {
|
|
6659
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
6660
|
+
} else {
|
|
6661
|
+
cleanObj[friendlyHeader] = val;
|
|
6662
|
+
}
|
|
6423
6663
|
});
|
|
6424
6664
|
return cleanObj;
|
|
6425
6665
|
});
|
|
@@ -7041,10 +7281,16 @@ const AssignEkycModal = _ref => {
|
|
|
7041
7281
|
onChange: e => handleFilterChange("ward", e.target.value)
|
|
7042
7282
|
}, /*#__PURE__*/React__default.createElement("option", {
|
|
7043
7283
|
value: ""
|
|
7044
|
-
}, "Select Ward"), wardOptions.
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
}
|
|
7284
|
+
}, "Select Ward"), wardOptions.filter(ward => {
|
|
7285
|
+
const stripped = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
|
|
7286
|
+
return stripped.trim().length > 0;
|
|
7287
|
+
}).map(ward => {
|
|
7288
|
+
const displayName = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
|
|
7289
|
+
return /*#__PURE__*/React__default.createElement("option", {
|
|
7290
|
+
key: ward.code,
|
|
7291
|
+
value: ward.name
|
|
7292
|
+
}, displayName);
|
|
7293
|
+
})), /*#__PURE__*/React__default.createElement("select", {
|
|
7048
7294
|
className: "form-control",
|
|
7049
7295
|
value: filters.assembly,
|
|
7050
7296
|
onChange: e => handleFilterChange("assembly", e.target.value)
|
|
@@ -7101,7 +7347,7 @@ const AssignEkycModal = _ref => {
|
|
|
7101
7347
|
};
|
|
7102
7348
|
|
|
7103
7349
|
const SurveyorDetailsDashboard = () => {
|
|
7104
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner8, _surveyor$owner9, _surveyor$owner0,
|
|
7350
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _surveyor$owner, _surveyor$owner2, _surveyor$owner3, _surveyor$owner4, _fullName$charAt, _dashboardData$dashbo, _dashboardData$dashbo2, _dashboardData$dashbo3, _dashboardData$dashbo4, _surveyor$owner8, _surveyor$owner9, _surveyor$owner0, _dashboardData$dashbo5, _dashboardData$dashbo6;
|
|
7105
7351
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
7106
7352
|
const _useState = React.useState(false),
|
|
7107
7353
|
showModal = _useState[0],
|
|
@@ -7205,16 +7451,22 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7205
7451
|
_Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
|
|
7206
7452
|
dashboardData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2,
|
|
7207
7453
|
refetchDashboard = _Digit$Hooks$ekyc$use.refetch;
|
|
7454
|
+
const toTitleCase = str => {
|
|
7455
|
+
if (!str) return "";
|
|
7456
|
+
const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
|
|
7457
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
7458
|
+
};
|
|
7208
7459
|
const knoColumns = React.useMemo(() => [{
|
|
7209
7460
|
Header: t("KNO") || "KNO",
|
|
7210
7461
|
accessor: "kno"
|
|
7211
7462
|
}, {
|
|
7212
7463
|
Header: t("CONSUMER_NAME") || "Consumer Name",
|
|
7213
|
-
accessor: row => ((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim(),
|
|
7464
|
+
accessor: row => toTitleCase(((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim()),
|
|
7214
7465
|
id: "consumerName"
|
|
7215
7466
|
}, {
|
|
7216
7467
|
Header: t("ZONE") || "Zone",
|
|
7217
|
-
accessor:
|
|
7468
|
+
accessor: row => toTitleCase(row.zoneName),
|
|
7469
|
+
id: "zoneName"
|
|
7218
7470
|
}, {
|
|
7219
7471
|
Header: t("EKYC_STATUS") || "eKYC Status",
|
|
7220
7472
|
accessor: "ekycStatus",
|
|
@@ -7223,7 +7475,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7223
7475
|
const status = (value || "NA").toUpperCase();
|
|
7224
7476
|
return value ? /*#__PURE__*/React__default.createElement("span", {
|
|
7225
7477
|
className: "ekyc-status-tag " + status
|
|
7226
|
-
},
|
|
7478
|
+
}, toTitleCase(value)) : "-";
|
|
7227
7479
|
}
|
|
7228
7480
|
}, {
|
|
7229
7481
|
Header: t("SUBMITTED_AT") || "Submitted At",
|
|
@@ -7462,6 +7714,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7462
7714
|
ward: t("WARD") || "Ward",
|
|
7463
7715
|
pincode: t("PINCODE") || "Pincode",
|
|
7464
7716
|
mrkey: t("MR_KEY") || "MR Key",
|
|
7717
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
7465
7718
|
createdTime: t("CREATED_TIME") || "Created Time",
|
|
7466
7719
|
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
7467
7720
|
};
|
|
@@ -7469,8 +7722,9 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7469
7722
|
const cleanObj = {};
|
|
7470
7723
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
7471
7724
|
if (fullName) {
|
|
7472
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
7725
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
7473
7726
|
}
|
|
7727
|
+
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
7474
7728
|
Object.keys(item).forEach(key => {
|
|
7475
7729
|
if (excludedKeys.includes(key)) return;
|
|
7476
7730
|
const val = item[key];
|
|
@@ -7478,7 +7732,11 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7478
7732
|
return;
|
|
7479
7733
|
}
|
|
7480
7734
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
7481
|
-
|
|
7735
|
+
if (typeof val === "string" && titleCaseFields.includes(key)) {
|
|
7736
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
7737
|
+
} else {
|
|
7738
|
+
cleanObj[friendlyHeader] = val;
|
|
7739
|
+
}
|
|
7482
7740
|
});
|
|
7483
7741
|
return cleanObj;
|
|
7484
7742
|
});
|
|
@@ -7642,12 +7900,6 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7642
7900
|
className: "detail-item"
|
|
7643
7901
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
7644
7902
|
className: "label"
|
|
7645
|
-
}, t("SERVICE_TYPE")), /*#__PURE__*/React__default.createElement("span", {
|
|
7646
|
-
className: "value"
|
|
7647
|
-
}, (surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$additionalD = surveyor.additionalDetails) === null || _surveyor$additionalD === void 0 ? void 0 : _surveyor$additionalD.serviceType) || "N/A")), /*#__PURE__*/React__default.createElement("div", {
|
|
7648
|
-
className: "detail-item"
|
|
7649
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
7650
|
-
className: "label"
|
|
7651
7903
|
}, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
|
|
7652
7904
|
className: "value"
|
|
7653
7905
|
}, vendorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -9123,74 +9375,6 @@ const MeterDetails = _ref => {
|
|
|
9123
9375
|
}));
|
|
9124
9376
|
};
|
|
9125
9377
|
|
|
9126
|
-
const Home = () => {
|
|
9127
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
9128
|
-
const _useTranslation = reactI18next.useTranslation(),
|
|
9129
|
-
t = _useTranslation.t;
|
|
9130
|
-
const propsForModuleCard = {
|
|
9131
|
-
moduleName: t("ACTION_TEST_EKYC"),
|
|
9132
|
-
kpis: [{
|
|
9133
|
-
count: "-",
|
|
9134
|
-
label: t("TOTAL_EKYC"),
|
|
9135
|
-
link: "/digit-ui/citizen/ekyc/dashboard"
|
|
9136
|
-
}],
|
|
9137
|
-
links: []
|
|
9138
|
-
};
|
|
9139
|
-
const citizenInfo = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.roles;
|
|
9140
|
-
const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
|
|
9141
|
-
if (roles.includes("EKYC_SURVEYOR")) {
|
|
9142
|
-
propsForModuleCard.links.push({
|
|
9143
|
-
label: t("SURVEYOR_DASHBOARD"),
|
|
9144
|
-
link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
|
|
9145
|
-
});
|
|
9146
|
-
}
|
|
9147
|
-
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
9148
|
-
propsForModuleCard.links.push({
|
|
9149
|
-
label: t("EKYC_INBOX"),
|
|
9150
|
-
link: "/digit-ui/citizen/ekyc/inbox"
|
|
9151
|
-
});
|
|
9152
|
-
}
|
|
9153
|
-
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
9154
|
-
propsForModuleCard.links.push({
|
|
9155
|
-
label: t("EKYC_SUPERVISOR_DASHBOARD"),
|
|
9156
|
-
link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
|
|
9157
|
-
}, {
|
|
9158
|
-
label: t("EKYC_ASSIGN"),
|
|
9159
|
-
link: "/digit-ui/citizen/ekyc/assign"
|
|
9160
|
-
});
|
|
9161
|
-
}
|
|
9162
|
-
if (roles.includes("EKYC_VENDOR")) {
|
|
9163
|
-
propsForModuleCard.links.push({
|
|
9164
|
-
label: t("EKYC_VENDOR_DASHBOARD"),
|
|
9165
|
-
link: "/digit-ui/citizen/ekyc/vendor-dashboard"
|
|
9166
|
-
});
|
|
9167
|
-
}
|
|
9168
|
-
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
9169
|
-
propsForModuleCard.links.push({
|
|
9170
|
-
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
9171
|
-
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
9172
|
-
});
|
|
9173
|
-
}
|
|
9174
|
-
if (roles.length === 1 && roles.includes("CITIZEN")) {
|
|
9175
|
-
propsForModuleCard.links.push({
|
|
9176
|
-
label: t("EKYC_STATUS"),
|
|
9177
|
-
link: "/digit-ui/citizen/ekyc/:id"
|
|
9178
|
-
});
|
|
9179
|
-
}
|
|
9180
|
-
const formattedLinks = propsForModuleCard.links.map(l => ({
|
|
9181
|
-
i18nKey: l.label,
|
|
9182
|
-
link: l.link,
|
|
9183
|
-
count: l.count
|
|
9184
|
-
}));
|
|
9185
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
|
|
9186
|
-
header: t("EKYC_MODULE_NAME"),
|
|
9187
|
-
links: formattedLinks,
|
|
9188
|
-
Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
|
|
9189
|
-
className: "fill-path-primary-main"
|
|
9190
|
-
})
|
|
9191
|
-
});
|
|
9192
|
-
};
|
|
9193
|
-
|
|
9194
9378
|
const Inbox$1 = _ref => {
|
|
9195
9379
|
var _formState$tableForm3, _formState$tableForm4, _formState$searchForm3, _formState$searchForm4, _dashboardData$dashbo;
|
|
9196
9380
|
let parentRoute = _ref.parentRoute;
|
|
@@ -9451,7 +9635,9 @@ const Inbox$1 = _ref => {
|
|
|
9451
9635
|
}, propsForSearchForm, propsForMobileSortForm, {
|
|
9452
9636
|
propsForInboxTable,
|
|
9453
9637
|
propsForInboxMobileCards,
|
|
9454
|
-
formState
|
|
9638
|
+
formState,
|
|
9639
|
+
forceTable: true,
|
|
9640
|
+
showSearchOnMobile: true
|
|
9455
9641
|
})));
|
|
9456
9642
|
};
|
|
9457
9643
|
|
|
@@ -9664,7 +9850,8 @@ const EkycStatus = () => {
|
|
|
9664
9850
|
}, propsForSearchForm, {
|
|
9665
9851
|
propsForInboxTable,
|
|
9666
9852
|
propsForInboxMobileCards,
|
|
9667
|
-
formState
|
|
9853
|
+
formState,
|
|
9854
|
+
showSearchOnMobile: true
|
|
9668
9855
|
})))), errorMsg && /*#__PURE__*/React__default.createElement("div", {
|
|
9669
9856
|
className: "ekyc-status-error-msg"
|
|
9670
9857
|
}, errorMsg), isLoading && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null), !isLoading && details && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
@@ -9712,10 +9899,7 @@ const CitizenApp = () => {
|
|
|
9712
9899
|
const location = reactRouterDom.useLocation();
|
|
9713
9900
|
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
9714
9901
|
path = _useRouteMatch.path;
|
|
9715
|
-
const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData()
|
|
9716
|
-
_Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
|
|
9717
|
-
_Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
|
|
9718
|
-
stateInfo = _Digit$Hooks$useStore3.stateInfo;
|
|
9902
|
+
const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData();
|
|
9719
9903
|
sessionStorage.removeItem("revalidateddone");
|
|
9720
9904
|
const getDynamicBreadcrumbs = () => {
|
|
9721
9905
|
const pathname = location.pathname;
|
|
@@ -9794,44 +9978,23 @@ const CitizenApp = () => {
|
|
|
9794
9978
|
}
|
|
9795
9979
|
return crumbs;
|
|
9796
9980
|
};
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
React__default.createElement("div", {
|
|
9803
|
-
className: "moduleLinkHomePage"
|
|
9804
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9805
|
-
style: {
|
|
9806
|
-
position: "relative"
|
|
9807
|
-
}
|
|
9808
|
-
}, /*#__PURE__*/React__default.createElement("img", {
|
|
9809
|
-
src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
|
|
9810
|
-
alt: "noimagefound"
|
|
9811
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, {
|
|
9812
|
-
className: "moduleLinkHomePageBackButton"
|
|
9813
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9814
|
-
className: "moduleTitle"
|
|
9815
|
-
}, isMobile ? /*#__PURE__*/React__default.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React__default.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React__default.createElement("div", {
|
|
9816
|
-
className: "moduleLinkHomePageModuleLinks"
|
|
9817
|
-
}, /*#__PURE__*/React__default.createElement(Home, null)))
|
|
9818
|
-
);
|
|
9819
|
-
}
|
|
9820
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9821
|
-
className: "ground-container form-container"
|
|
9981
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.AppContainer, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9982
|
+
className: "ground-container form-container",
|
|
9983
|
+
style: {
|
|
9984
|
+
flex: 1
|
|
9985
|
+
}
|
|
9822
9986
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleHeader, {
|
|
9823
9987
|
leftContent: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ArrowLeft, {
|
|
9824
9988
|
className: "icon"
|
|
9825
9989
|
}), t("CS_COMMON_BACK")),
|
|
9826
9990
|
onLeftClick: () => window.history.back(),
|
|
9827
9991
|
breadcrumbs: getDynamicBreadcrumbs()
|
|
9828
|
-
}), /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(
|
|
9992
|
+
}), /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
9829
9993
|
exact: true,
|
|
9830
|
-
path: "" + path
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
9994
|
+
path: "" + path
|
|
9995
|
+
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
9996
|
+
to: "/digit-ui/citizen/ekyc-home"
|
|
9997
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
9835
9998
|
path: [path + "/vendor-dashboard/:vendorId", path + "/vendor-dashboard"],
|
|
9836
9999
|
component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
9837
10000
|
layoutClass: "normal"
|
|
@@ -9937,19 +10100,61 @@ const EkycModule = _ref => {
|
|
|
9937
10100
|
} else return /*#__PURE__*/React__default.createElement(CitizenApp, null);
|
|
9938
10101
|
};
|
|
9939
10102
|
const EkycLinks = _ref2 => {
|
|
9940
|
-
|
|
10103
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
9941
10104
|
const _useTranslation = reactI18next.useTranslation(),
|
|
9942
10105
|
t = _useTranslation.t;
|
|
9943
|
-
const
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
10106
|
+
const propsForModuleCard = {
|
|
10107
|
+
links: []
|
|
10108
|
+
};
|
|
10109
|
+
const citizenInfo = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : (_Digit$SessionStorage2 = _Digit$SessionStorage.info) === null || _Digit$SessionStorage2 === void 0 ? void 0 : _Digit$SessionStorage2.roles;
|
|
10110
|
+
const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
|
|
10111
|
+
if (roles.includes("EKYC_SURVEYOR")) {
|
|
10112
|
+
propsForModuleCard.links.push({
|
|
10113
|
+
label: t("SURVEYOR_DASHBOARD"),
|
|
10114
|
+
link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
|
|
10115
|
+
});
|
|
10116
|
+
}
|
|
10117
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
10118
|
+
propsForModuleCard.links.push({
|
|
10119
|
+
label: t("EKYC_INBOX"),
|
|
10120
|
+
link: "/digit-ui/citizen/ekyc/inbox"
|
|
10121
|
+
});
|
|
10122
|
+
}
|
|
10123
|
+
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
10124
|
+
propsForModuleCard.links.push({
|
|
10125
|
+
label: t("EKYC_SUPERVISOR_DASHBOARD"),
|
|
10126
|
+
link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
|
|
10127
|
+
}, {
|
|
10128
|
+
label: t("EKYC_ASSIGN"),
|
|
10129
|
+
link: "/digit-ui/citizen/ekyc/assign"
|
|
10130
|
+
});
|
|
10131
|
+
}
|
|
10132
|
+
if (roles.includes("EKYC_VENDOR")) {
|
|
10133
|
+
propsForModuleCard.links.push({
|
|
10134
|
+
label: t("EKYC_VENDOR_DASHBOARD"),
|
|
10135
|
+
link: "/digit-ui/citizen/ekyc/vendor-dashboard"
|
|
10136
|
+
});
|
|
10137
|
+
}
|
|
10138
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
10139
|
+
propsForModuleCard.links.push({
|
|
10140
|
+
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
10141
|
+
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
10142
|
+
});
|
|
10143
|
+
}
|
|
10144
|
+
if (roles.length === 1 && roles.includes("CITIZEN")) {
|
|
10145
|
+
propsForModuleCard.links.push({
|
|
10146
|
+
label: t("EKYC_STATUS"),
|
|
10147
|
+
link: "/digit-ui/citizen/ekyc/:id"
|
|
10148
|
+
});
|
|
10149
|
+
}
|
|
10150
|
+
const formattedLinks = propsForModuleCard.links.map(l => ({
|
|
10151
|
+
i18nKey: l.label,
|
|
10152
|
+
link: l.link,
|
|
10153
|
+
count: l.count
|
|
10154
|
+
}));
|
|
9950
10155
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
|
|
9951
10156
|
header: t("EKYC_MODULE_NAME"),
|
|
9952
|
-
links:
|
|
10157
|
+
links: formattedLinks,
|
|
9953
10158
|
Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
|
|
9954
10159
|
className: "fill-path-primary-main"
|
|
9955
10160
|
})
|