@djb25/digit-ui-module-ekyc 1.0.42 → 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 +620 -456
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +622 -458
- 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 {
|
|
@@ -2822,7 +3132,9 @@ const SearchFormFieldsComponents = _ref => {
|
|
|
2822
3132
|
const useInboxMobileCardsData = _ref => {
|
|
2823
3133
|
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
|
|
2824
3134
|
let table = _ref.table,
|
|
2825
|
-
tenantId = _ref.tenantId
|
|
3135
|
+
tenantId = _ref.tenantId,
|
|
3136
|
+
_ref$isSupervisor = _ref.isSupervisor,
|
|
3137
|
+
isSupervisor = _ref$isSupervisor === void 0 ? false : _ref$isSupervisor;
|
|
2826
3138
|
const _useTranslation = reactI18next.useTranslation(),
|
|
2827
3139
|
t = _useTranslation.t;
|
|
2828
3140
|
const history = reactRouterDom.useHistory();
|
|
@@ -2834,38 +3146,58 @@ const useInboxMobileCardsData = _ref => {
|
|
|
2834
3146
|
getReview = _Digit$Hooks$ekyc$use.getReview;
|
|
2835
3147
|
const userType = ((_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$SessionStorage3 = _Digit$SessionStorage2.type) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.toLowerCase()) || "citizen";
|
|
2836
3148
|
React__default.useEffect(() => {
|
|
2837
|
-
if (reviewData) {
|
|
3149
|
+
if (!isSupervisor && reviewData) {
|
|
2838
3150
|
history.push("/digit-ui/" + userType + "/ekyc/review/" + selectedKno, {
|
|
2839
3151
|
aadhaarData: reviewData === null || reviewData === void 0 ? void 0 : reviewData.aadhaarData,
|
|
2840
3152
|
reviewData
|
|
2841
3153
|
});
|
|
2842
3154
|
}
|
|
2843
|
-
}, [reviewData]);
|
|
3155
|
+
}, [reviewData, isSupervisor]);
|
|
2844
3156
|
const handleReview = kno => {
|
|
2845
3157
|
setSelectedKno(kno);
|
|
2846
3158
|
getReview({
|
|
2847
3159
|
kno
|
|
2848
3160
|
});
|
|
2849
3161
|
};
|
|
3162
|
+
const handleSupervisorReview = id => {
|
|
3163
|
+
history.push("/digit-ui/" + userType + "/ekyc/assign/surveyor-details/" + id);
|
|
3164
|
+
};
|
|
2850
3165
|
const dataForMobileInboxCards = table === null || table === void 0 ? void 0 : table.map(item => {
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
3166
|
+
if (isSupervisor) {
|
|
3167
|
+
var _item$owner;
|
|
3168
|
+
const id = item.id;
|
|
3169
|
+
const status = item.status || "DEFAULT";
|
|
3170
|
+
return {
|
|
3171
|
+
[t("SURVEYOR_NAME")]: /*#__PURE__*/React__default.createElement("span", {
|
|
3172
|
+
className: "link",
|
|
3173
|
+
onClick: () => handleSupervisorReview(id)
|
|
3174
|
+
}, item.surveyorName || item.name || "NA"),
|
|
3175
|
+
[t("MOBILE_NUMBER")]: item.mobileNo || ((_item$owner = item.owner) === null || _item$owner === void 0 ? void 0 : _item$owner.mobileNumber) || "NA",
|
|
3176
|
+
[t("STATUS")]: /*#__PURE__*/React__default.createElement("span", {
|
|
3177
|
+
className: "ekyc-status-tag " + status
|
|
3178
|
+
}, t(status)),
|
|
3179
|
+
[t("SERVICE_TYPE")]: item.serviceType || "NA"
|
|
3180
|
+
};
|
|
3181
|
+
} else {
|
|
3182
|
+
const kno = item.kno || item.applicationNumber || "NA";
|
|
3183
|
+
const status = (item.status || "DEFAULT").toUpperCase();
|
|
3184
|
+
const ekycStatus = (item.ekycStatus || item.ekycstatus || "NA").toUpperCase();
|
|
3185
|
+
return {
|
|
3186
|
+
[t("EKYC_APPLICATION_NO")]: /*#__PURE__*/React__default.createElement("span", {
|
|
3187
|
+
className: "link",
|
|
3188
|
+
onClick: () => handleReview(kno)
|
|
3189
|
+
}, kno),
|
|
3190
|
+
[t("EKYC_CITIZEN_NAME")]: item.citizenName || "NA",
|
|
3191
|
+
[t("EKYC_STATUS")]: /*#__PURE__*/React__default.createElement("span", {
|
|
3192
|
+
className: "ekyc-status-tag " + status
|
|
3193
|
+
}, t("" + status)),
|
|
3194
|
+
[t("SUBMITTED_AT")]: item.submittedAt ? Digit.DateUtils.ConvertEpochToDate(item.submittedAt) : "-",
|
|
3195
|
+
[t("ASSIGNED_AT")]: item.assignedAt ? Digit.DateUtils.ConvertEpochToDate(item.assignedAt) : "-",
|
|
3196
|
+
[t("EKYC_EKYC_STATUS")]: /*#__PURE__*/React__default.createElement("span", {
|
|
3197
|
+
className: "ekyc-status-tag " + ekycStatus
|
|
3198
|
+
}, t("" + ekycStatus))
|
|
3199
|
+
};
|
|
3200
|
+
}
|
|
2869
3201
|
});
|
|
2870
3202
|
const MobileSortFormValues = () => {
|
|
2871
3203
|
const sortOrderOptions = [{
|
|
@@ -2900,7 +3232,7 @@ const useInboxMobileCardsData = _ref => {
|
|
|
2900
3232
|
isTwoDynamicPrefix: true,
|
|
2901
3233
|
getRedirectionLink: () => {},
|
|
2902
3234
|
handleClickEnabled: false,
|
|
2903
|
-
serviceRequestIdKey: "applicationNo",
|
|
3235
|
+
serviceRequestIdKey: isSupervisor ? "id" : "applicationNo",
|
|
2904
3236
|
MobileSortFormValues
|
|
2905
3237
|
};
|
|
2906
3238
|
};
|
|
@@ -3162,7 +3494,9 @@ const Inbox = _ref => {
|
|
|
3162
3494
|
propsForInboxTable,
|
|
3163
3495
|
propsForInboxMobileCards,
|
|
3164
3496
|
formState,
|
|
3165
|
-
countData: listData
|
|
3497
|
+
countData: listData,
|
|
3498
|
+
forceTable: true,
|
|
3499
|
+
showSearchOnMobile: true
|
|
3166
3500
|
})));
|
|
3167
3501
|
};
|
|
3168
3502
|
|
|
@@ -5651,70 +5985,6 @@ const SupervisorInboxTableConfig = _ref => {
|
|
|
5651
5985
|
};
|
|
5652
5986
|
};
|
|
5653
5987
|
|
|
5654
|
-
const useSupervisorInboxMobileCardsData = _ref => {
|
|
5655
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
|
|
5656
|
-
let table = _ref.table;
|
|
5657
|
-
const _useTranslation = reactI18next.useTranslation(),
|
|
5658
|
-
t = _useTranslation.t;
|
|
5659
|
-
const history = reactRouterDom.useHistory();
|
|
5660
|
-
const userType = ((_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$SessionStorage3 = _Digit$SessionStorage2.type) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.toLowerCase()) || "citizen";
|
|
5661
|
-
const handleReview = id => {
|
|
5662
|
-
history.push("/digit-ui/" + userType + "/ekyc/assign/surveyor-details/" + id);
|
|
5663
|
-
};
|
|
5664
|
-
const dataForMobileInboxCards = table === null || table === void 0 ? void 0 : table.map(item => {
|
|
5665
|
-
var _item$owner;
|
|
5666
|
-
const id = item.id;
|
|
5667
|
-
const status = item.status || "DEFAULT";
|
|
5668
|
-
return {
|
|
5669
|
-
[t("SURVEYOR_NAME")]: /*#__PURE__*/React__default.createElement("span", {
|
|
5670
|
-
className: "link",
|
|
5671
|
-
onClick: () => handleReview(id)
|
|
5672
|
-
}, item.surveyorName || item.name || "NA"),
|
|
5673
|
-
[t("MOBILE_NUMBER")]: item.mobileNo || ((_item$owner = item.owner) === null || _item$owner === void 0 ? void 0 : _item$owner.mobileNumber) || "NA",
|
|
5674
|
-
[t("STATUS")]: /*#__PURE__*/React__default.createElement("span", {
|
|
5675
|
-
className: "ekyc-status-tag " + status
|
|
5676
|
-
}, t(status)),
|
|
5677
|
-
[t("SERVICE_TYPE")]: item.serviceType || "NA"
|
|
5678
|
-
};
|
|
5679
|
-
});
|
|
5680
|
-
const MobileSortFormValues = () => {
|
|
5681
|
-
const sortOrderOptions = [{
|
|
5682
|
-
code: "DESC",
|
|
5683
|
-
i18nKey: "ES_INBOX_DATE_LATEST_FIRST"
|
|
5684
|
-
}, {
|
|
5685
|
-
code: "ASC",
|
|
5686
|
-
i18nKey: "ES_INBOX_DATE_LATEST_LAST"
|
|
5687
|
-
}];
|
|
5688
|
-
const _useFormContext = useFormContext(),
|
|
5689
|
-
controlSortForm = _useFormContext.control;
|
|
5690
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.SearchField, null, /*#__PURE__*/React__default.createElement(Controller, {
|
|
5691
|
-
name: "sortOrder",
|
|
5692
|
-
control: controlSortForm,
|
|
5693
|
-
render: _ref2 => {
|
|
5694
|
-
let onChange = _ref2.onChange,
|
|
5695
|
-
value = _ref2.value;
|
|
5696
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.RadioButtons, {
|
|
5697
|
-
onSelect: e => {
|
|
5698
|
-
onChange(e.code);
|
|
5699
|
-
},
|
|
5700
|
-
selectedOption: sortOrderOptions.filter(option => option.code === value)[0],
|
|
5701
|
-
optionsKey: "i18nKey",
|
|
5702
|
-
name: "sortOrder",
|
|
5703
|
-
options: sortOrderOptions
|
|
5704
|
-
});
|
|
5705
|
-
}
|
|
5706
|
-
}));
|
|
5707
|
-
};
|
|
5708
|
-
return {
|
|
5709
|
-
data: dataForMobileInboxCards,
|
|
5710
|
-
isTwoDynamicPrefix: true,
|
|
5711
|
-
getRedirectionLink: () => {},
|
|
5712
|
-
handleClickEnabled: false,
|
|
5713
|
-
serviceRequestIdKey: "id",
|
|
5714
|
-
MobileSortFormValues
|
|
5715
|
-
};
|
|
5716
|
-
};
|
|
5717
|
-
|
|
5718
5988
|
const AssignEkyc = () => {
|
|
5719
5989
|
var _formState$tableForm, _formState$tableForm2, _formState$tableForm3, _formState$tableForm4, _formState$searchForm, _dashboardData$dashbo;
|
|
5720
5990
|
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
@@ -5893,8 +6163,9 @@ const AssignEkyc = () => {
|
|
|
5893
6163
|
sortFormDefaultValues: formState === null || formState === void 0 ? void 0 : formState.tableForm,
|
|
5894
6164
|
onSortFormReset
|
|
5895
6165
|
};
|
|
5896
|
-
const propsForInboxMobileCards =
|
|
5897
|
-
table: filteredData
|
|
6166
|
+
const propsForInboxMobileCards = useInboxMobileCardsData({
|
|
6167
|
+
table: filteredData,
|
|
6168
|
+
isSupervisor: true
|
|
5898
6169
|
});
|
|
5899
6170
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
5900
6171
|
className: "app-container"
|
|
@@ -5905,12 +6176,14 @@ const AssignEkyc = () => {
|
|
|
5905
6176
|
propsForInboxMobileCards,
|
|
5906
6177
|
formState,
|
|
5907
6178
|
countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
|
|
5908
|
-
isCardLoading: isDataSearchLoading
|
|
6179
|
+
isCardLoading: isDataSearchLoading,
|
|
6180
|
+
showSearchOnMobile: true,
|
|
6181
|
+
forceTable: true
|
|
5909
6182
|
})));
|
|
5910
6183
|
};
|
|
5911
6184
|
|
|
5912
6185
|
const AdminDashboard = () => {
|
|
5913
|
-
var _Digit$SessionStorage
|
|
6186
|
+
var _Digit$SessionStorage;
|
|
5914
6187
|
const _useTranslation = reactI18next.useTranslation(),
|
|
5915
6188
|
t = _useTranslation.t;
|
|
5916
6189
|
const history = reactRouterDom.useHistory();
|
|
@@ -5919,177 +6192,55 @@ const AdminDashboard = () => {
|
|
|
5919
6192
|
tenantId = "dl.djb";
|
|
5920
6193
|
}
|
|
5921
6194
|
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
5922
|
-
const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
|
|
5923
|
-
status: "ACTIVE"
|
|
5924
|
-
}, {
|
|
5925
|
-
enabled: !!tenantId
|
|
5926
|
-
}),
|
|
5927
|
-
vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
|
|
5928
|
-
isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
|
|
5929
|
-
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
5930
|
-
enabled: !!tenantId,
|
|
5931
|
-
keepPreviousData: true
|
|
5932
|
-
}),
|
|
5933
|
-
progressData = _Digit$Hooks$ekyc$use.data,
|
|
5934
|
-
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
5935
|
-
const vendorsList = React.useMemo(() => {
|
|
5936
|
-
if (vendorSearchResponse && vendorSearchResponse.length > 0) {
|
|
5937
|
-
return vendorSearchResponse.map(v => {
|
|
5938
|
-
var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
|
|
5939
|
-
const dso = v.dsoDetails || v;
|
|
5940
|
-
const supervisorsList = dso.supervisors || [];
|
|
5941
|
-
const surveyorsList = dso.surveyors || [];
|
|
5942
|
-
const supervisorIds = supervisorsList.map(s => {
|
|
5943
|
-
var _s$owner;
|
|
5944
|
-
return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
|
|
5945
|
-
}).filter(Boolean);
|
|
5946
|
-
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))) || [];
|
|
5947
|
-
const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
|
|
5948
|
-
const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
|
|
5949
|
-
const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
|
|
5950
|
-
const progress = total > 0 ? Math.round(completed / total * 100) : 0;
|
|
5951
|
-
const rejected = 0;
|
|
5952
|
-
return {
|
|
5953
|
-
id: dso.id || dso.vendorId || v.id || v.vendorId,
|
|
5954
|
-
name: dso.name || dso.displayName || v.name || "N/A",
|
|
5955
|
-
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",
|
|
5956
|
-
mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
|
|
5957
|
-
supervisors: supervisorsList.length,
|
|
5958
|
-
surveyors: surveyorsList.length,
|
|
5959
|
-
completed: completed,
|
|
5960
|
-
progress: progress,
|
|
5961
|
-
pending: pending,
|
|
5962
|
-
rejected: rejected
|
|
5963
|
-
};
|
|
5964
|
-
});
|
|
5965
|
-
}
|
|
5966
|
-
return [];
|
|
5967
|
-
}, [vendorSearchResponse, progressData]);
|
|
5968
|
-
const _useState = React.useState(false),
|
|
5969
|
-
ekycDownloadLoading = _useState[0],
|
|
5970
|
-
setEkycDownloadLoading = _useState[1];
|
|
5971
|
-
const _useState2 = React.useState(0),
|
|
5972
|
-
currentPage = _useState2[0];
|
|
5973
|
-
const _useState3 = React.useState(20),
|
|
5974
|
-
pageSize = _useState3[0];
|
|
5975
|
-
const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycApplicationList({}, {
|
|
5976
|
-
tenantId,
|
|
5977
|
-
offset: currentPage * pageSize,
|
|
5978
|
-
limit: pageSize
|
|
5979
|
-
}, {
|
|
5980
|
-
keepPreviousData: true
|
|
5981
|
-
});
|
|
5982
|
-
const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
|
|
5983
|
-
const mobileNumber = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || "N/A";
|
|
5984
|
-
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";
|
|
5985
|
-
const handleDownloadEkycData = function () {
|
|
5986
|
-
try {
|
|
5987
|
-
setEkycDownloadLoading(true);
|
|
5988
|
-
return Promise.resolve(_finallyRethrows(function () {
|
|
5989
|
-
return _catch(function () {
|
|
5990
|
-
return Promise.resolve(Digit.EkycService.application_list({
|
|
5991
|
-
tenantId: tenantId,
|
|
5992
|
-
offset: 0,
|
|
5993
|
-
limit: 10000,
|
|
5994
|
-
reportDownload: true
|
|
5995
|
-
})).then(function (response) {
|
|
5996
|
-
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
5997
|
-
if (consumerList.length === 0) {
|
|
5998
|
-
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
5999
|
-
return;
|
|
6000
|
-
}
|
|
6001
|
-
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"];
|
|
6002
|
-
const headerMapping = {
|
|
6003
|
-
kno: t("KNO") || "KNO",
|
|
6004
|
-
firstName: t("FIRST_NAME") || "First Name",
|
|
6005
|
-
middleName: t("MIDDLE_NAME") || "Middle Name",
|
|
6006
|
-
lastName: t("LAST_NAME") || "Last Name",
|
|
6007
|
-
gender: t("GENDER") || "Gender",
|
|
6008
|
-
mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
|
|
6009
|
-
emailId: t("EMAIL_ID") || "Email ID",
|
|
6010
|
-
fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
|
|
6011
|
-
relationship: t("RELATIONSHIP") || "Relationship",
|
|
6012
|
-
dob: t("DOB") || "Date of Birth",
|
|
6013
|
-
ekycStatus: t("EKYC_STATUS") || "eKYC Status",
|
|
6014
|
-
zoneName: t("ZONE") || "Zone",
|
|
6015
|
-
assembly: t("ASSEMBLY") || "Assembly",
|
|
6016
|
-
ward: t("WARD") || "Ward",
|
|
6017
|
-
pincode: t("PINCODE") || "Pincode",
|
|
6018
|
-
mrkey: t("MR_KEY") || "MR Key",
|
|
6019
|
-
createdTime: t("CREATED_TIME") || "Created Time",
|
|
6020
|
-
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
6021
|
-
};
|
|
6022
|
-
const excelData = consumerList.map(item => {
|
|
6023
|
-
const cleanObj = {};
|
|
6024
|
-
const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6025
|
-
if (name) {
|
|
6026
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = name;
|
|
6027
|
-
}
|
|
6028
|
-
Object.keys(item).forEach(key => {
|
|
6029
|
-
if (excludedKeys.includes(key)) return;
|
|
6030
|
-
const val = item[key];
|
|
6031
|
-
if (typeof val === "object" && val !== null) {
|
|
6032
|
-
return;
|
|
6033
|
-
}
|
|
6034
|
-
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6035
|
-
cleanObj[friendlyHeader] = val;
|
|
6036
|
-
});
|
|
6037
|
-
return cleanObj;
|
|
6038
|
-
});
|
|
6039
|
-
const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
|
|
6040
|
-
Digit.Download.Excel(excelData, cleanFileName);
|
|
6041
|
-
});
|
|
6042
|
-
}, function (error) {
|
|
6043
|
-
console.error("Error downloading eKYC Excel:", error);
|
|
6044
|
-
});
|
|
6045
|
-
}, function (_wasThrown, _result) {
|
|
6046
|
-
setEkycDownloadLoading(false);
|
|
6047
|
-
if (_wasThrown) throw _result;
|
|
6048
|
-
return _result;
|
|
6049
|
-
}));
|
|
6050
|
-
} catch (e) {
|
|
6051
|
-
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
|
+
});
|
|
6052
6238
|
}
|
|
6053
|
-
|
|
6239
|
+
return [];
|
|
6240
|
+
}, [vendorSearchResponse, progressData]);
|
|
6054
6241
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
6055
6242
|
className: "surveyor-dashboard"
|
|
6056
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6057
|
-
className: "ekyc-dashboard-section"
|
|
6058
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6059
|
-
className: "ekyc-dashboard-header"
|
|
6060
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
6061
|
-
className: "avatar"
|
|
6062
|
-
}, 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", {
|
|
6063
|
-
className: "header-content"
|
|
6064
|
-
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
6065
|
-
className: "name"
|
|
6066
|
-
}, fullName), /*#__PURE__*/React__default.createElement("div", {
|
|
6067
|
-
className: "designation"
|
|
6068
|
-
}, t("EKYC_ADMIN") || "eKYC Admin / Manager"), /*#__PURE__*/React__default.createElement("div", {
|
|
6069
|
-
className: "mobile-number"
|
|
6070
|
-
}, mobileNumber))), /*#__PURE__*/React__default.createElement("button", {
|
|
6071
|
-
className: "download-excel-btn",
|
|
6072
|
-
disabled: ekycDownloadLoading,
|
|
6073
|
-
onClick: handleDownloadEkycData
|
|
6074
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
6075
|
-
width: "16",
|
|
6076
|
-
height: "16",
|
|
6077
|
-
viewBox: "0 0 24 24",
|
|
6078
|
-
fill: "none",
|
|
6079
|
-
stroke: "currentColor",
|
|
6080
|
-
strokeWidth: "2.5",
|
|
6081
|
-
strokeLinecap: "round",
|
|
6082
|
-
strokeLinejoin: "round"
|
|
6083
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
6084
|
-
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
6085
|
-
}), /*#__PURE__*/React__default.createElement("polyline", {
|
|
6086
|
-
points: "7 10 12 15 17 10"
|
|
6087
|
-
}), /*#__PURE__*/React__default.createElement("line", {
|
|
6088
|
-
x1: "12",
|
|
6089
|
-
y1: "15",
|
|
6090
|
-
x2: "12",
|
|
6091
|
-
y2: "3"
|
|
6092
|
-
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")), /*#__PURE__*/React__default.createElement("div", {
|
|
6243
|
+
}, /*#__PURE__*/React__default.createElement(Dashboard, null), /*#__PURE__*/React__default.createElement("div", {
|
|
6093
6244
|
className: "admin-performance-section"
|
|
6094
6245
|
}, /*#__PURE__*/React__default.createElement("h3", {
|
|
6095
6246
|
className: "section-title"
|
|
@@ -6377,7 +6528,8 @@ const SupervisorDetailsCard = () => {
|
|
|
6377
6528
|
showCustomPicker = _useState6[0],
|
|
6378
6529
|
setShowCustomPicker = _useState6[1];
|
|
6379
6530
|
const _useState7 = React.useState(false),
|
|
6380
|
-
reportLoading = _useState7[0]
|
|
6531
|
+
reportLoading = _useState7[0],
|
|
6532
|
+
setReportLoading = _useState7[1];
|
|
6381
6533
|
const reportMenuRef = React.useRef(null);
|
|
6382
6534
|
React.useEffect(() => {
|
|
6383
6535
|
const handler = e => {
|
|
@@ -6389,6 +6541,42 @@ const SupervisorDetailsCard = () => {
|
|
|
6389
6541
|
document.addEventListener("mousedown", handler);
|
|
6390
6542
|
return () => document.removeEventListener("mousedown", handler);
|
|
6391
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
|
+
};
|
|
6392
6580
|
const handlePresetDownload = filter => {
|
|
6393
6581
|
handleDownload();
|
|
6394
6582
|
};
|
|
@@ -6444,14 +6632,21 @@ const SupervisorDetailsCard = () => {
|
|
|
6444
6632
|
ward: t("WARD") || "Ward",
|
|
6445
6633
|
pincode: t("PINCODE") || "Pincode",
|
|
6446
6634
|
mrkey: t("MR_KEY") || "MR Key",
|
|
6635
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
6447
6636
|
createdTime: t("CREATED_TIME") || "Created Time",
|
|
6448
6637
|
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
6449
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"];
|
|
6450
6645
|
const excelData = consumerList.map(item => {
|
|
6451
6646
|
const cleanObj = {};
|
|
6452
6647
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6453
6648
|
if (fullName) {
|
|
6454
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
6649
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
6455
6650
|
}
|
|
6456
6651
|
Object.keys(item).forEach(key => {
|
|
6457
6652
|
if (excludedKeys.includes(key)) return;
|
|
@@ -6460,7 +6655,11 @@ const SupervisorDetailsCard = () => {
|
|
|
6460
6655
|
return;
|
|
6461
6656
|
}
|
|
6462
6657
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6463
|
-
|
|
6658
|
+
if (typeof val === "string" && titleCaseFields.includes(key)) {
|
|
6659
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
6660
|
+
} else {
|
|
6661
|
+
cleanObj[friendlyHeader] = val;
|
|
6662
|
+
}
|
|
6464
6663
|
});
|
|
6465
6664
|
return cleanObj;
|
|
6466
6665
|
});
|
|
@@ -7082,10 +7281,16 @@ const AssignEkycModal = _ref => {
|
|
|
7082
7281
|
onChange: e => handleFilterChange("ward", e.target.value)
|
|
7083
7282
|
}, /*#__PURE__*/React__default.createElement("option", {
|
|
7084
7283
|
value: ""
|
|
7085
|
-
}, "Select Ward"), wardOptions.
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
}
|
|
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", {
|
|
7089
7294
|
className: "form-control",
|
|
7090
7295
|
value: filters.assembly,
|
|
7091
7296
|
onChange: e => handleFilterChange("assembly", e.target.value)
|
|
@@ -7142,7 +7347,7 @@ const AssignEkycModal = _ref => {
|
|
|
7142
7347
|
};
|
|
7143
7348
|
|
|
7144
7349
|
const SurveyorDetailsDashboard = () => {
|
|
7145
|
-
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;
|
|
7146
7351
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
7147
7352
|
const _useState = React.useState(false),
|
|
7148
7353
|
showModal = _useState[0],
|
|
@@ -7246,16 +7451,22 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7246
7451
|
_Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
|
|
7247
7452
|
dashboardData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2,
|
|
7248
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
|
+
};
|
|
7249
7459
|
const knoColumns = React.useMemo(() => [{
|
|
7250
7460
|
Header: t("KNO") || "KNO",
|
|
7251
7461
|
accessor: "kno"
|
|
7252
7462
|
}, {
|
|
7253
7463
|
Header: t("CONSUMER_NAME") || "Consumer Name",
|
|
7254
|
-
accessor: row => ((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim(),
|
|
7464
|
+
accessor: row => toTitleCase(((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim()),
|
|
7255
7465
|
id: "consumerName"
|
|
7256
7466
|
}, {
|
|
7257
7467
|
Header: t("ZONE") || "Zone",
|
|
7258
|
-
accessor:
|
|
7468
|
+
accessor: row => toTitleCase(row.zoneName),
|
|
7469
|
+
id: "zoneName"
|
|
7259
7470
|
}, {
|
|
7260
7471
|
Header: t("EKYC_STATUS") || "eKYC Status",
|
|
7261
7472
|
accessor: "ekycStatus",
|
|
@@ -7264,7 +7475,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7264
7475
|
const status = (value || "NA").toUpperCase();
|
|
7265
7476
|
return value ? /*#__PURE__*/React__default.createElement("span", {
|
|
7266
7477
|
className: "ekyc-status-tag " + status
|
|
7267
|
-
},
|
|
7478
|
+
}, toTitleCase(value)) : "-";
|
|
7268
7479
|
}
|
|
7269
7480
|
}, {
|
|
7270
7481
|
Header: t("SUBMITTED_AT") || "Submitted At",
|
|
@@ -7503,6 +7714,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7503
7714
|
ward: t("WARD") || "Ward",
|
|
7504
7715
|
pincode: t("PINCODE") || "Pincode",
|
|
7505
7716
|
mrkey: t("MR_KEY") || "MR Key",
|
|
7717
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
7506
7718
|
createdTime: t("CREATED_TIME") || "Created Time",
|
|
7507
7719
|
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
7508
7720
|
};
|
|
@@ -7510,8 +7722,9 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7510
7722
|
const cleanObj = {};
|
|
7511
7723
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
7512
7724
|
if (fullName) {
|
|
7513
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
7725
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
7514
7726
|
}
|
|
7727
|
+
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
7515
7728
|
Object.keys(item).forEach(key => {
|
|
7516
7729
|
if (excludedKeys.includes(key)) return;
|
|
7517
7730
|
const val = item[key];
|
|
@@ -7519,7 +7732,11 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7519
7732
|
return;
|
|
7520
7733
|
}
|
|
7521
7734
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
7522
|
-
|
|
7735
|
+
if (typeof val === "string" && titleCaseFields.includes(key)) {
|
|
7736
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
7737
|
+
} else {
|
|
7738
|
+
cleanObj[friendlyHeader] = val;
|
|
7739
|
+
}
|
|
7523
7740
|
});
|
|
7524
7741
|
return cleanObj;
|
|
7525
7742
|
});
|
|
@@ -7683,12 +7900,6 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7683
7900
|
className: "detail-item"
|
|
7684
7901
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
7685
7902
|
className: "label"
|
|
7686
|
-
}, t("SERVICE_TYPE")), /*#__PURE__*/React__default.createElement("span", {
|
|
7687
|
-
className: "value"
|
|
7688
|
-
}, (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", {
|
|
7689
|
-
className: "detail-item"
|
|
7690
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
7691
|
-
className: "label"
|
|
7692
7903
|
}, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
|
|
7693
7904
|
className: "value"
|
|
7694
7905
|
}, vendorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -9164,74 +9375,6 @@ const MeterDetails = _ref => {
|
|
|
9164
9375
|
}));
|
|
9165
9376
|
};
|
|
9166
9377
|
|
|
9167
|
-
const Home = () => {
|
|
9168
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
9169
|
-
const _useTranslation = reactI18next.useTranslation(),
|
|
9170
|
-
t = _useTranslation.t;
|
|
9171
|
-
const propsForModuleCard = {
|
|
9172
|
-
moduleName: t("ACTION_TEST_EKYC"),
|
|
9173
|
-
kpis: [{
|
|
9174
|
-
count: "-",
|
|
9175
|
-
label: t("TOTAL_EKYC"),
|
|
9176
|
-
link: "/digit-ui/citizen/ekyc/dashboard"
|
|
9177
|
-
}],
|
|
9178
|
-
links: []
|
|
9179
|
-
};
|
|
9180
|
-
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;
|
|
9181
|
-
const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
|
|
9182
|
-
if (roles.includes("EKYC_SURVEYOR")) {
|
|
9183
|
-
propsForModuleCard.links.push({
|
|
9184
|
-
label: t("SURVEYOR_DASHBOARD"),
|
|
9185
|
-
link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
|
|
9186
|
-
});
|
|
9187
|
-
}
|
|
9188
|
-
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
9189
|
-
propsForModuleCard.links.push({
|
|
9190
|
-
label: t("EKYC_INBOX"),
|
|
9191
|
-
link: "/digit-ui/citizen/ekyc/inbox"
|
|
9192
|
-
});
|
|
9193
|
-
}
|
|
9194
|
-
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
9195
|
-
propsForModuleCard.links.push({
|
|
9196
|
-
label: t("EKYC_SUPERVISOR_DASHBOARD"),
|
|
9197
|
-
link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
|
|
9198
|
-
}, {
|
|
9199
|
-
label: t("EKYC_ASSIGN"),
|
|
9200
|
-
link: "/digit-ui/citizen/ekyc/assign"
|
|
9201
|
-
});
|
|
9202
|
-
}
|
|
9203
|
-
if (roles.includes("EKYC_VENDOR")) {
|
|
9204
|
-
propsForModuleCard.links.push({
|
|
9205
|
-
label: t("EKYC_VENDOR_DASHBOARD"),
|
|
9206
|
-
link: "/digit-ui/citizen/ekyc/vendor-dashboard"
|
|
9207
|
-
});
|
|
9208
|
-
}
|
|
9209
|
-
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
9210
|
-
propsForModuleCard.links.push({
|
|
9211
|
-
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
9212
|
-
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
9213
|
-
});
|
|
9214
|
-
}
|
|
9215
|
-
if (roles.length === 1 && roles.includes("CITIZEN")) {
|
|
9216
|
-
propsForModuleCard.links.push({
|
|
9217
|
-
label: t("EKYC_STATUS"),
|
|
9218
|
-
link: "/digit-ui/citizen/ekyc/:id"
|
|
9219
|
-
});
|
|
9220
|
-
}
|
|
9221
|
-
const formattedLinks = propsForModuleCard.links.map(l => ({
|
|
9222
|
-
i18nKey: l.label,
|
|
9223
|
-
link: l.link,
|
|
9224
|
-
count: l.count
|
|
9225
|
-
}));
|
|
9226
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
|
|
9227
|
-
header: t("EKYC_MODULE_NAME"),
|
|
9228
|
-
links: formattedLinks,
|
|
9229
|
-
Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
|
|
9230
|
-
className: "fill-path-primary-main"
|
|
9231
|
-
})
|
|
9232
|
-
});
|
|
9233
|
-
};
|
|
9234
|
-
|
|
9235
9378
|
const Inbox$1 = _ref => {
|
|
9236
9379
|
var _formState$tableForm3, _formState$tableForm4, _formState$searchForm3, _formState$searchForm4, _dashboardData$dashbo;
|
|
9237
9380
|
let parentRoute = _ref.parentRoute;
|
|
@@ -9492,7 +9635,9 @@ const Inbox$1 = _ref => {
|
|
|
9492
9635
|
}, propsForSearchForm, propsForMobileSortForm, {
|
|
9493
9636
|
propsForInboxTable,
|
|
9494
9637
|
propsForInboxMobileCards,
|
|
9495
|
-
formState
|
|
9638
|
+
formState,
|
|
9639
|
+
forceTable: true,
|
|
9640
|
+
showSearchOnMobile: true
|
|
9496
9641
|
})));
|
|
9497
9642
|
};
|
|
9498
9643
|
|
|
@@ -9705,7 +9850,8 @@ const EkycStatus = () => {
|
|
|
9705
9850
|
}, propsForSearchForm, {
|
|
9706
9851
|
propsForInboxTable,
|
|
9707
9852
|
propsForInboxMobileCards,
|
|
9708
|
-
formState
|
|
9853
|
+
formState,
|
|
9854
|
+
showSearchOnMobile: true
|
|
9709
9855
|
})))), errorMsg && /*#__PURE__*/React__default.createElement("div", {
|
|
9710
9856
|
className: "ekyc-status-error-msg"
|
|
9711
9857
|
}, errorMsg), isLoading && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null), !isLoading && details && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
@@ -9753,10 +9899,7 @@ const CitizenApp = () => {
|
|
|
9753
9899
|
const location = reactRouterDom.useLocation();
|
|
9754
9900
|
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
9755
9901
|
path = _useRouteMatch.path;
|
|
9756
|
-
const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData()
|
|
9757
|
-
_Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
|
|
9758
|
-
_Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
|
|
9759
|
-
stateInfo = _Digit$Hooks$useStore3.stateInfo;
|
|
9902
|
+
const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData();
|
|
9760
9903
|
sessionStorage.removeItem("revalidateddone");
|
|
9761
9904
|
const getDynamicBreadcrumbs = () => {
|
|
9762
9905
|
const pathname = location.pathname;
|
|
@@ -9835,44 +9978,23 @@ const CitizenApp = () => {
|
|
|
9835
9978
|
}
|
|
9836
9979
|
return crumbs;
|
|
9837
9980
|
};
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
React__default.createElement("div", {
|
|
9844
|
-
className: "moduleLinkHomePage"
|
|
9845
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9846
|
-
style: {
|
|
9847
|
-
position: "relative"
|
|
9848
|
-
}
|
|
9849
|
-
}, /*#__PURE__*/React__default.createElement("img", {
|
|
9850
|
-
src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
|
|
9851
|
-
alt: "noimagefound"
|
|
9852
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, {
|
|
9853
|
-
className: "moduleLinkHomePageBackButton"
|
|
9854
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9855
|
-
className: "moduleTitle"
|
|
9856
|
-
}, isMobile ? /*#__PURE__*/React__default.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React__default.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React__default.createElement("div", {
|
|
9857
|
-
className: "moduleLinkHomePageModuleLinks"
|
|
9858
|
-
}, /*#__PURE__*/React__default.createElement(Home, null)))
|
|
9859
|
-
);
|
|
9860
|
-
}
|
|
9861
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9862
|
-
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
|
+
}
|
|
9863
9986
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleHeader, {
|
|
9864
9987
|
leftContent: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ArrowLeft, {
|
|
9865
9988
|
className: "icon"
|
|
9866
9989
|
}), t("CS_COMMON_BACK")),
|
|
9867
9990
|
onLeftClick: () => window.history.back(),
|
|
9868
9991
|
breadcrumbs: getDynamicBreadcrumbs()
|
|
9869
|
-
}), /*#__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, {
|
|
9870
9993
|
exact: true,
|
|
9871
|
-
path: "" + path
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
}), /*#__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, {
|
|
9876
9998
|
path: [path + "/vendor-dashboard/:vendorId", path + "/vendor-dashboard"],
|
|
9877
9999
|
component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
9878
10000
|
layoutClass: "normal"
|
|
@@ -9978,19 +10100,61 @@ const EkycModule = _ref => {
|
|
|
9978
10100
|
} else return /*#__PURE__*/React__default.createElement(CitizenApp, null);
|
|
9979
10101
|
};
|
|
9980
10102
|
const EkycLinks = _ref2 => {
|
|
9981
|
-
|
|
10103
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
9982
10104
|
const _useTranslation = reactI18next.useTranslation(),
|
|
9983
10105
|
t = _useTranslation.t;
|
|
9984
|
-
const
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
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
|
+
}));
|
|
9991
10155
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
|
|
9992
10156
|
header: t("EKYC_MODULE_NAME"),
|
|
9993
|
-
links:
|
|
10157
|
+
links: formattedLinks,
|
|
9994
10158
|
Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
|
|
9995
10159
|
className: "fill-path-primary-main"
|
|
9996
10160
|
})
|