@djb25/digit-ui-module-ekyc 1.0.43 → 1.0.45
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 +657 -415
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +659 -417
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,15 +7,17 @@ var reactRouterDom = require('react-router-dom');
|
|
|
7
7
|
var digitUiReactComponents = require('@djb25/digit-ui-react-components');
|
|
8
8
|
var Chartjs = require('chart.js/auto');
|
|
9
9
|
var Chartjs__default = _interopDefault(Chartjs);
|
|
10
|
+
require('three/tsl');
|
|
10
11
|
var fa = require('react-icons/fa');
|
|
11
12
|
var recharts = require('recharts');
|
|
12
13
|
|
|
13
14
|
const EKYCCard = () => {
|
|
14
|
-
var _Digit$SessionStorage, _Digit$SessionStorage2
|
|
15
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
15
16
|
const _useTranslation = reactI18next.useTranslation(),
|
|
16
17
|
t = _useTranslation.t;
|
|
17
18
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
18
|
-
const
|
|
19
|
+
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;
|
|
20
|
+
const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code || ele) : [];
|
|
19
21
|
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList({}, {
|
|
20
22
|
tenantId,
|
|
21
23
|
offset: 0,
|
|
@@ -26,50 +28,235 @@ const EKYCCard = () => {
|
|
|
26
28
|
listData = _Digit$Hooks$ekyc$use.data,
|
|
27
29
|
isLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
28
30
|
const totalCount = isLoading ? "-" : (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const isCitizen = window.location.pathname.includes("/citizen");
|
|
32
|
+
const prefix = isCitizen ? "/digit-ui/citizen/ekyc" : "/digit-ui/employee/ekyc";
|
|
33
|
+
let links = [];
|
|
34
|
+
if (isCitizen) {
|
|
35
|
+
if (roles.includes("EKYC_SURVEYOR")) {
|
|
36
|
+
links.push({
|
|
37
|
+
label: t("SURVEYOR_DASHBOARD"),
|
|
38
|
+
link: prefix + "/surveyor-dashboard"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
42
|
+
links.push({
|
|
43
|
+
count: totalCount,
|
|
44
|
+
label: t("EKYC_INBOX"),
|
|
45
|
+
link: prefix + "/inbox"
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
49
|
+
links.push({
|
|
50
|
+
label: t("EKYC_SUPERVISOR_DASHBOARD"),
|
|
51
|
+
link: prefix + "/supervisor-dashboard"
|
|
52
|
+
}, {
|
|
53
|
+
label: t("EKYC_ASSIGN"),
|
|
54
|
+
link: prefix + "/assign"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (roles.includes("EKYC_VENDOR")) {
|
|
58
|
+
links.push({
|
|
59
|
+
label: t("EKYC_VENDOR_DASHBOARD"),
|
|
60
|
+
link: prefix + "/vendor-dashboard"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
64
|
+
links.push({
|
|
65
|
+
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
66
|
+
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (links.length === 0 || roles.length === 1 && roles.includes("CITIZEN")) {
|
|
70
|
+
links.push({
|
|
71
|
+
label: t("EKYC_STATUS"),
|
|
72
|
+
link: prefix + "/:id"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
links = [{
|
|
38
77
|
label: t("CEO_M.F_DOR_FINANCE_VIEW"),
|
|
39
|
-
link: "/
|
|
78
|
+
link: prefix + "/ceo-dashboard"
|
|
40
79
|
}, {
|
|
41
80
|
label: t("EKYC_ADMIN_DASHBOARD") || "Admin Dashboard",
|
|
42
|
-
link: "/
|
|
81
|
+
link: prefix + "/admin-dashboard"
|
|
43
82
|
}, {
|
|
44
83
|
count: totalCount,
|
|
45
84
|
label: t("EKYC_INBOX"),
|
|
46
|
-
link: "/
|
|
85
|
+
link: prefix + "/inbox"
|
|
47
86
|
}, ...(!roles.includes("EMPLOYEE") ? [{
|
|
48
87
|
label: t("EKYC_ASSIGN"),
|
|
49
|
-
link: "/
|
|
50
|
-
}] : [])]
|
|
88
|
+
link: prefix + "/assign"
|
|
89
|
+
}] : [])];
|
|
90
|
+
}
|
|
91
|
+
const propsForModuleCard = {
|
|
92
|
+
Icon: /*#__PURE__*/React__default.createElement(digitUiReactComponents.PersonIcon, null),
|
|
93
|
+
moduleName: t("ACTION_TEST_EKYC"),
|
|
94
|
+
kpis: isCitizen ? [] : [{
|
|
95
|
+
count: totalCount,
|
|
96
|
+
label: t("TOTAL_EKYC"),
|
|
97
|
+
link: prefix + "/admin-dashboard"
|
|
98
|
+
}],
|
|
99
|
+
links: links
|
|
51
100
|
};
|
|
52
101
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.EmployeeModuleCard, propsForModuleCard);
|
|
53
102
|
};
|
|
54
103
|
|
|
104
|
+
const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
105
|
+
const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
106
|
+
function _catch(body, recover) {
|
|
107
|
+
try {
|
|
108
|
+
var result = body();
|
|
109
|
+
} catch (e) {
|
|
110
|
+
return recover(e);
|
|
111
|
+
}
|
|
112
|
+
if (result && result.then) {
|
|
113
|
+
return result.then(void 0, recover);
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
function _finallyRethrows(body, finalizer) {
|
|
118
|
+
try {
|
|
119
|
+
var result = body();
|
|
120
|
+
} catch (e) {
|
|
121
|
+
return finalizer(true, e);
|
|
122
|
+
}
|
|
123
|
+
if (result && result.then) {
|
|
124
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
125
|
+
}
|
|
126
|
+
return finalizer(false, result);
|
|
127
|
+
}
|
|
128
|
+
|
|
55
129
|
const getChartConstructor = () => {
|
|
56
130
|
const C = Chartjs.Chart || Chartjs__default || Chartjs;
|
|
57
131
|
return C;
|
|
58
132
|
};
|
|
59
133
|
const StatusCards = _ref => {
|
|
134
|
+
var _Digit$SessionStorage;
|
|
60
135
|
let countData = _ref.countData;
|
|
61
136
|
const _useTranslation = reactI18next.useTranslation(),
|
|
62
137
|
t = _useTranslation.t;
|
|
138
|
+
const _useState = React.useState(false),
|
|
139
|
+
ekycDownloadLoading = _useState[0],
|
|
140
|
+
setEkycDownloadLoading = _useState[1];
|
|
141
|
+
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
142
|
+
if (!tenantId || tenantId === "dl") {
|
|
143
|
+
tenantId = "dl.djb";
|
|
144
|
+
}
|
|
145
|
+
const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
|
|
146
|
+
const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
|
|
147
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
|
|
148
|
+
tenantId,
|
|
149
|
+
offset: 0,
|
|
150
|
+
limit: 10,
|
|
151
|
+
ekycStatus: "submitted"
|
|
152
|
+
}, {
|
|
153
|
+
enabled: !!tenantId
|
|
154
|
+
}),
|
|
155
|
+
dashboardData = _Digit$Hooks$ekyc$use.data;
|
|
156
|
+
const apiCountData = React__default.useMemo(() => {
|
|
157
|
+
const info = (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo) || {};
|
|
158
|
+
return {
|
|
159
|
+
total: info.total || 0,
|
|
160
|
+
completed: info.completed || 0,
|
|
161
|
+
pending: info.pending || 0,
|
|
162
|
+
submittedCount: info.submittedCount || 0,
|
|
163
|
+
inProgressCount: info.inProgressCount || 0,
|
|
164
|
+
rejected: info.rejected || 0,
|
|
165
|
+
active: info.active || 0
|
|
166
|
+
};
|
|
167
|
+
}, [dashboardData]);
|
|
168
|
+
const handleDownloadEkycData = function () {
|
|
169
|
+
try {
|
|
170
|
+
setEkycDownloadLoading(true);
|
|
171
|
+
return Promise.resolve(_finallyRethrows(function () {
|
|
172
|
+
return _catch(function () {
|
|
173
|
+
return Promise.resolve(Digit.EkycService.application_list({
|
|
174
|
+
tenantId: tenantId,
|
|
175
|
+
offset: 0,
|
|
176
|
+
limit: 10000,
|
|
177
|
+
reportDownload: true
|
|
178
|
+
})).then(function (response) {
|
|
179
|
+
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
180
|
+
if (consumerList.length === 0) {
|
|
181
|
+
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
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"];
|
|
185
|
+
const headerMapping = {
|
|
186
|
+
kno: t("KNO") || "KNO",
|
|
187
|
+
firstName: t("FIRST_NAME") || "First Name",
|
|
188
|
+
middleName: t("MIDDLE_NAME") || "Middle Name",
|
|
189
|
+
lastName: t("LAST_NAME") || "Last Name",
|
|
190
|
+
gender: t("GENDER") || "Gender",
|
|
191
|
+
mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
|
|
192
|
+
emailId: t("EMAIL_ID") || "Email ID",
|
|
193
|
+
fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
|
|
194
|
+
relationship: t("RELATIONSHIP") || "Relationship",
|
|
195
|
+
dob: t("DOB") || "Date of Birth",
|
|
196
|
+
ekycStatus: t("EKYC_STATUS") || "eKYC Status",
|
|
197
|
+
zoneName: t("ZONE") || "Zone",
|
|
198
|
+
assembly: t("ASSEMBLY") || "Assembly",
|
|
199
|
+
ward: t("WARD") || "Ward",
|
|
200
|
+
pincode: t("PINCODE") || "Pincode",
|
|
201
|
+
mrkey: t("MR_KEY") || "MR Key",
|
|
202
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
203
|
+
createdTime: t("CREATED_TIME") || "Created Time",
|
|
204
|
+
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
205
|
+
};
|
|
206
|
+
const toTitleCase = str => {
|
|
207
|
+
if (!str) return "";
|
|
208
|
+
const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
|
|
209
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
210
|
+
};
|
|
211
|
+
const skipTitleCase = ["kno", "mobileNumber", "emailId", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime"];
|
|
212
|
+
const excelData = consumerList.map(item => {
|
|
213
|
+
const cleanObj = {};
|
|
214
|
+
const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
215
|
+
if (name) {
|
|
216
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
|
|
217
|
+
}
|
|
218
|
+
Object.keys(item).forEach(key => {
|
|
219
|
+
if (excludedKeys.includes(key)) return;
|
|
220
|
+
const val = item[key];
|
|
221
|
+
if (typeof val === "object" && val !== null) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
225
|
+
if (typeof val === "string" && !skipTitleCase.includes(key)) {
|
|
226
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
227
|
+
} else {
|
|
228
|
+
cleanObj[friendlyHeader] = val;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return cleanObj;
|
|
232
|
+
});
|
|
233
|
+
const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
|
|
234
|
+
Digit.Download.Excel(excelData, cleanFileName);
|
|
235
|
+
});
|
|
236
|
+
}, function (error) {
|
|
237
|
+
console.error("Error downloading eKYC Excel:", error);
|
|
238
|
+
});
|
|
239
|
+
}, function (_wasThrown, _result) {
|
|
240
|
+
setEkycDownloadLoading(false);
|
|
241
|
+
if (_wasThrown) throw _result;
|
|
242
|
+
return _result;
|
|
243
|
+
}));
|
|
244
|
+
} catch (e) {
|
|
245
|
+
return Promise.reject(e);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
63
248
|
const chartRef1 = React.useRef(null);
|
|
64
249
|
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
|
|
250
|
+
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;
|
|
251
|
+
const pending = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.pending) || (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
|
|
252
|
+
const active = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.active) || (countData === null || countData === void 0 ? void 0 : countData.active) || 0;
|
|
253
|
+
const completed = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.completed) || (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
|
|
254
|
+
const inprocess = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.inProgressCount) || (countData === null || countData === void 0 ? void 0 : countData.inProgressCount) || 0;
|
|
255
|
+
const submitted = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.submittedCount) || (countData === null || countData === void 0 ? void 0 : countData.submittedCount) || 0;
|
|
256
|
+
const actualCompleted = completed;
|
|
70
257
|
const approved = actualCompleted;
|
|
71
|
-
const efficiency = total > 0 ? Math.round(
|
|
72
|
-
const healthPct =
|
|
258
|
+
const efficiency = total > 0 ? Math.round((submitted + completed) / total * 100) : 0;
|
|
259
|
+
const healthPct = submitted > 0 ? Math.round(approved / submitted * 100) : 0;
|
|
73
260
|
const formatNumber = num => new Intl.NumberFormat("en-IN").format(num || 0);
|
|
74
261
|
React.useEffect(() => {
|
|
75
262
|
if (chartRef1.current) {
|
|
@@ -79,11 +266,11 @@ const StatusCards = _ref => {
|
|
|
79
266
|
chartInstance1.current = new ChartConstructor(ctx1, {
|
|
80
267
|
type: "doughnut",
|
|
81
268
|
data: {
|
|
82
|
-
labels: [t("
|
|
269
|
+
labels: [t("EKYC_PENDING"), t("EKYC_COMPLETED"), t("EKYC_SUBMITTED"), t("EKYC_INPROCESS")],
|
|
83
270
|
datasets: [{
|
|
84
|
-
data: [
|
|
85
|
-
backgroundColor: ["#0c2a52", "#77B6EA", "#c8ddf5"],
|
|
86
|
-
borderColor: ["#ffffff", "#ffffff", "#ffffff"],
|
|
271
|
+
data: [pending, completed, submitted, inprocess],
|
|
272
|
+
backgroundColor: ["#0c2a52", "#77B6EA", "#c8ddf5", "#49a3fb"],
|
|
273
|
+
borderColor: ["#ffffff", "#ffffff", "#ffffff", "#ffffff"],
|
|
87
274
|
borderWidth: 2,
|
|
88
275
|
hoverOffset: 4
|
|
89
276
|
}]
|
|
@@ -105,17 +292,21 @@ const StatusCards = _ref => {
|
|
|
105
292
|
};
|
|
106
293
|
}, [pending, completed, active, t]);
|
|
107
294
|
const legendItems = [{
|
|
108
|
-
color: "#0c2a52",
|
|
109
|
-
label: t("EKYC_ACTIVE"),
|
|
110
|
-
value: active
|
|
111
|
-
}, {
|
|
112
295
|
color: "#77B6EA",
|
|
296
|
+
label: t("EKYC_COMPLETED"),
|
|
297
|
+
value: completed
|
|
298
|
+
}, {
|
|
299
|
+
color: "#0c2a52",
|
|
113
300
|
label: t("EKYC_PENDING"),
|
|
114
301
|
value: pending
|
|
115
302
|
}, {
|
|
116
303
|
color: "#c8ddf5",
|
|
117
|
-
label: t("
|
|
118
|
-
value:
|
|
304
|
+
label: t("EKYC_SUBMITTED"),
|
|
305
|
+
value: submitted
|
|
306
|
+
}, {
|
|
307
|
+
color: "#49a3fb",
|
|
308
|
+
label: t("EKYC_INPROCESS"),
|
|
309
|
+
value: inprocess
|
|
119
310
|
}];
|
|
120
311
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
121
312
|
className: "ekyc-employee-container"
|
|
@@ -137,9 +328,29 @@ const StatusCards = _ref => {
|
|
|
137
328
|
className: "total-label"
|
|
138
329
|
}, t("EKYC_TOTAL_APPLICATIONS") || "Total Applications Processed"), /*#__PURE__*/React__default.createElement("div", {
|
|
139
330
|
className: "total-number"
|
|
140
|
-
}, formatNumber(total)), /*#__PURE__*/React__default.createElement("
|
|
141
|
-
className: "
|
|
142
|
-
|
|
331
|
+
}, formatNumber(total)), /*#__PURE__*/React__default.createElement("button", {
|
|
332
|
+
className: "download-excel-btn",
|
|
333
|
+
disabled: ekycDownloadLoading,
|
|
334
|
+
onClick: handleDownloadEkycData
|
|
335
|
+
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
336
|
+
width: "16",
|
|
337
|
+
height: "16",
|
|
338
|
+
viewBox: "0 0 24 24",
|
|
339
|
+
fill: "none",
|
|
340
|
+
stroke: "currentColor",
|
|
341
|
+
strokeWidth: "2.5",
|
|
342
|
+
strokeLinecap: "round",
|
|
343
|
+
strokeLinejoin: "round"
|
|
344
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
345
|
+
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
346
|
+
}), /*#__PURE__*/React__default.createElement("polyline", {
|
|
347
|
+
points: "7 10 12 15 17 10"
|
|
348
|
+
}), /*#__PURE__*/React__default.createElement("line", {
|
|
349
|
+
x1: "12",
|
|
350
|
+
y1: "15",
|
|
351
|
+
x2: "12",
|
|
352
|
+
y2: "3"
|
|
353
|
+
})), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))), /*#__PURE__*/React__default.createElement("div", {
|
|
143
354
|
className: "status-panels-grid"
|
|
144
355
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
145
356
|
className: "status-panel"
|
|
@@ -181,17 +392,13 @@ const StatusCards = _ref => {
|
|
|
181
392
|
className: "status-panel"
|
|
182
393
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
183
394
|
className: "panel-title"
|
|
184
|
-
}, t("EKYC_SUBMISSION_HEALTH") || "Submission Health", /*#__PURE__*/React__default.createElement("
|
|
185
|
-
className: "optimal-badge"
|
|
186
|
-
}, t("EKYC_OPTIMAL") || "Optimal")), /*#__PURE__*/React__default.createElement("div", {
|
|
395
|
+
}, t("EKYC_SUBMISSION_HEALTH") || "Submission Health"), /*#__PURE__*/React__default.createElement("div", {
|
|
187
396
|
className: "panel-subtitle"
|
|
188
397
|
}, t("EKYC_PLATFORM_EFFICIENCY") || "Platform operational efficiency"), /*#__PURE__*/React__default.createElement("div", {
|
|
189
398
|
className: "health-metrics-row"
|
|
190
399
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
191
400
|
className: "health-percentage"
|
|
192
|
-
}, healthPct, "%"), /*#__PURE__*/React__default.createElement("div", {
|
|
193
|
-
className: "health-trend"
|
|
194
|
-
}, "\u2197 +2.1%")), /*#__PURE__*/React__default.createElement("div", {
|
|
401
|
+
}, healthPct, "%")), /*#__PURE__*/React__default.createElement("div", {
|
|
195
402
|
className: "status-progress-bar"
|
|
196
403
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
197
404
|
className: "progress-fill",
|
|
@@ -206,13 +413,13 @@ const StatusCards = _ref => {
|
|
|
206
413
|
className: "metric-label"
|
|
207
414
|
}, t("EKYC_AVG_LATENCY") || "Avg Latency"), /*#__PURE__*/React__default.createElement("div", {
|
|
208
415
|
className: "metric-value"
|
|
209
|
-
}, "
|
|
416
|
+
}, "0s")), /*#__PURE__*/React__default.createElement("div", {
|
|
210
417
|
className: "metric-box"
|
|
211
418
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
212
419
|
className: "metric-label"
|
|
213
420
|
}, t("EKYC_ERROR_RATE") || "Error Rate"), /*#__PURE__*/React__default.createElement("div", {
|
|
214
421
|
className: "metric-value"
|
|
215
|
-
}, "0.
|
|
422
|
+
}, "0.0%")))))));
|
|
216
423
|
};
|
|
217
424
|
|
|
218
425
|
const Dashboard = () => {
|
|
@@ -282,6 +489,10 @@ const DesktopInbox = _ref => {
|
|
|
282
489
|
countData = props.countData;
|
|
283
490
|
const _useTranslation = reactI18next.useTranslation(),
|
|
284
491
|
t = _useTranslation.t;
|
|
492
|
+
const toTitleCase = str => {
|
|
493
|
+
if (!str) return "";
|
|
494
|
+
return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
495
|
+
};
|
|
285
496
|
const history = reactRouterDom.useHistory();
|
|
286
497
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
287
498
|
const FilterComponent = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent(filterComponent);
|
|
@@ -324,37 +535,38 @@ const DesktopInbox = _ref => {
|
|
|
324
535
|
Cell: _ref3 => {
|
|
325
536
|
var _row$original3;
|
|
326
537
|
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");
|
|
538
|
+
return /*#__PURE__*/React__default.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
|
|
328
539
|
}
|
|
329
540
|
}, {
|
|
330
541
|
Header: t("EKYC_STATUS"),
|
|
331
542
|
accessor: "actionStatus",
|
|
332
543
|
Cell: _ref4 => {
|
|
333
|
-
var _row$original4;
|
|
544
|
+
var _row$original4, _row$original5;
|
|
334
545
|
let row = _ref4.row;
|
|
335
546
|
const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
|
|
336
547
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
337
548
|
className: "ekyc-status-tag " + status
|
|
338
|
-
},
|
|
549
|
+
}, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
|
|
339
550
|
}
|
|
340
551
|
}, {
|
|
341
552
|
Header: t("EKYC_EKYC_STATUS"),
|
|
342
553
|
accessor: "ekycStatus",
|
|
343
554
|
Cell: _ref5 => {
|
|
344
|
-
var _row$
|
|
555
|
+
var _row$original6, _row$original7;
|
|
345
556
|
let row = _ref5.row;
|
|
346
|
-
const
|
|
557
|
+
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";
|
|
558
|
+
const ekycStatus = raw.toUpperCase();
|
|
347
559
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
348
560
|
className: "ekyc-status-tag " + ekycStatus
|
|
349
|
-
},
|
|
561
|
+
}, toTitleCase(raw));
|
|
350
562
|
}
|
|
351
563
|
}, {
|
|
352
564
|
Header: t("EKYC_ACTION"),
|
|
353
565
|
accessor: "status",
|
|
354
566
|
Cell: _ref6 => {
|
|
355
|
-
var _row$
|
|
567
|
+
var _row$original8, _row$original9;
|
|
356
568
|
let row = _ref6.row;
|
|
357
|
-
const kno = ((_row$
|
|
569
|
+
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
570
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
359
571
|
className: "link",
|
|
360
572
|
onClick: () => handleReview(kno)
|
|
@@ -1593,31 +1805,6 @@ const CeoDashboard = () => {
|
|
|
1593
1805
|
}, /*#__PURE__*/React__default.createElement("h3", null, topKpis.successRate, "%"), /*#__PURE__*/React__default.createElement("p", null, "Operational Efficiency")))))));
|
|
1594
1806
|
};
|
|
1595
1807
|
|
|
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
1808
|
const downloadSurveyorPDF = function (_ref) {
|
|
1622
1809
|
let rows = _ref.rows,
|
|
1623
1810
|
surveyorName = _ref.surveyorName,
|
|
@@ -1707,6 +1894,123 @@ const downloadSurveyorPDF = function (_ref) {
|
|
|
1707
1894
|
return Promise.reject(e);
|
|
1708
1895
|
}
|
|
1709
1896
|
};
|
|
1897
|
+
const downloadSupervisorPDF = function (_ref2) {
|
|
1898
|
+
let rows = _ref2.rows,
|
|
1899
|
+
supervisorName = _ref2.supervisorName,
|
|
1900
|
+
mobileNumber = _ref2.mobileNumber,
|
|
1901
|
+
vendorName = _ref2.vendorName,
|
|
1902
|
+
dashboardInfo = _ref2.dashboardInfo,
|
|
1903
|
+
t = _ref2.t;
|
|
1904
|
+
try {
|
|
1905
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
1906
|
+
const name = "Delhi Jal Board";
|
|
1907
|
+
const email = "contact@delhijalboard.nic.in";
|
|
1908
|
+
const phoneNumber = "+91-11-23538416";
|
|
1909
|
+
const currentDate = new Date();
|
|
1910
|
+
const formattedDate = currentDate.toLocaleDateString("en-IN", {
|
|
1911
|
+
day: "2-digit",
|
|
1912
|
+
month: "2-digit",
|
|
1913
|
+
year: "numeric"
|
|
1914
|
+
});
|
|
1915
|
+
const formattedTime = currentDate.toLocaleTimeString("en-IN", {
|
|
1916
|
+
hour: "2-digit",
|
|
1917
|
+
minute: "2-digit",
|
|
1918
|
+
second: "2-digit",
|
|
1919
|
+
hour12: false
|
|
1920
|
+
});
|
|
1921
|
+
const downloadDateTime = formattedDate + " " + formattedTime;
|
|
1922
|
+
const isValDefined = val => val !== undefined && val !== null && val !== "";
|
|
1923
|
+
const details = [{
|
|
1924
|
+
title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
|
|
1925
|
+
asSectionHeader: true,
|
|
1926
|
+
values: [{
|
|
1927
|
+
title: t("SUPERVISOR_NAME") || "Supervisor Name",
|
|
1928
|
+
value: supervisorName
|
|
1929
|
+
}, {
|
|
1930
|
+
title: t("MOBILE_NUMBER") || "Mobile Number",
|
|
1931
|
+
value: mobileNumber
|
|
1932
|
+
}, {
|
|
1933
|
+
title: t("VENDOR_NAME") || "Vendor Name",
|
|
1934
|
+
value: vendorName
|
|
1935
|
+
}].filter(item => isValDefined(item.value))
|
|
1936
|
+
}, {
|
|
1937
|
+
title: t("SUMMARY_STATISTICS") || "Summary Statistics",
|
|
1938
|
+
asSectionHeader: true,
|
|
1939
|
+
values: [{
|
|
1940
|
+
title: t("TOTAL_ASSIGNED") || "Total Assigned",
|
|
1941
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
|
|
1942
|
+
}, {
|
|
1943
|
+
title: t("COMPLETED") || "Completed",
|
|
1944
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
|
|
1945
|
+
}, {
|
|
1946
|
+
title: t("PENDING") || "Pending",
|
|
1947
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
|
|
1948
|
+
}, {
|
|
1949
|
+
title: t("SUBMITTED") || "Submitted",
|
|
1950
|
+
value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
|
|
1951
|
+
}].filter(item => isValDefined(item.value))
|
|
1952
|
+
}];
|
|
1953
|
+
const mappedRows = rows.map(row => {
|
|
1954
|
+
var _row$owner, _row$owner2;
|
|
1955
|
+
return {
|
|
1956
|
+
kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
|
|
1957
|
+
firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
|
|
1958
|
+
lastName: "",
|
|
1959
|
+
mobileNo: row.status || "N/A",
|
|
1960
|
+
zoneName: String(row.total || 0),
|
|
1961
|
+
ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
|
|
1962
|
+
submittedAt: 1717171717171,
|
|
1963
|
+
progress: row.progress || "0%"
|
|
1964
|
+
};
|
|
1965
|
+
});
|
|
1966
|
+
const originalToLocaleDateString = Date.prototype.toLocaleDateString;
|
|
1967
|
+
let progressIndex = 0;
|
|
1968
|
+
Date.prototype.toLocaleDateString = function () {
|
|
1969
|
+
if (progressIndex < mappedRows.length) {
|
|
1970
|
+
return mappedRows[progressIndex++].progress || "0%";
|
|
1971
|
+
}
|
|
1972
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1973
|
+
args[_key] = arguments[_key];
|
|
1974
|
+
}
|
|
1975
|
+
return originalToLocaleDateString.apply(this, args);
|
|
1976
|
+
};
|
|
1977
|
+
const customT = key => {
|
|
1978
|
+
if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
|
|
1979
|
+
if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
|
|
1980
|
+
if (key === "MOBILE") return t("STATUS") || "Status";
|
|
1981
|
+
if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
|
|
1982
|
+
if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
|
|
1983
|
+
if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
|
|
1984
|
+
if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
|
|
1985
|
+
return t(key);
|
|
1986
|
+
};
|
|
1987
|
+
try {
|
|
1988
|
+
if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
|
|
1989
|
+
window.Digit.Utils.pdf.generateSurveyorReport({
|
|
1990
|
+
tenantId,
|
|
1991
|
+
logo: null,
|
|
1992
|
+
name,
|
|
1993
|
+
email,
|
|
1994
|
+
phoneNumber,
|
|
1995
|
+
heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
|
|
1996
|
+
details,
|
|
1997
|
+
applicationNumber: mobileNumber,
|
|
1998
|
+
rows: mappedRows,
|
|
1999
|
+
t: customT,
|
|
2000
|
+
hideApplicationNumber: true,
|
|
2001
|
+
downloadTime: downloadDateTime
|
|
2002
|
+
});
|
|
2003
|
+
} else {
|
|
2004
|
+
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
2005
|
+
}
|
|
2006
|
+
} finally {
|
|
2007
|
+
Date.prototype.toLocaleDateString = originalToLocaleDateString;
|
|
2008
|
+
}
|
|
2009
|
+
return Promise.resolve();
|
|
2010
|
+
} catch (e) {
|
|
2011
|
+
return Promise.reject(e);
|
|
2012
|
+
}
|
|
2013
|
+
};
|
|
1710
2014
|
const downloadVendorPDF = function (_ref3) {
|
|
1711
2015
|
let rows = _ref3.rows,
|
|
1712
2016
|
vendorName = _ref3.vendorName,
|
|
@@ -1932,6 +2236,10 @@ const VendorDetailsCard = () => {
|
|
|
1932
2236
|
}
|
|
1933
2237
|
return "N/A";
|
|
1934
2238
|
}, [vendor]);
|
|
2239
|
+
const zoneIds = React.useMemo(() => {
|
|
2240
|
+
var _vendor$zoneIds;
|
|
2241
|
+
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";
|
|
2242
|
+
}, [vendor]);
|
|
1935
2243
|
const cards = React.useMemo(() => {
|
|
1936
2244
|
const hasRealData = vendorSupervisors.some(s => s.totalKnos > 0);
|
|
1937
2245
|
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 +2297,7 @@ const VendorDetailsCard = () => {
|
|
|
1989
2297
|
alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
|
|
1990
2298
|
return;
|
|
1991
2299
|
}
|
|
1992
|
-
const excludedKeys = ["status", "source", "submittedAt", "assignedAt", "connectionType", "approvedAt", "alternateMobileNo", "city", "state", "addressType", "addressProofType", "mrcode", "areacode", "verificationStatus", "surveyorId", "supervisorId", "vendorId", "assignmentType", "assignmentValue", "
|
|
2300
|
+
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
2301
|
const headerMapping = {
|
|
1994
2302
|
kno: t("KNO") || "KNO",
|
|
1995
2303
|
firstName: t("FIRST_NAME") || "First Name",
|
|
@@ -2314,9 +2622,9 @@ const VendorDetailsCard = () => {
|
|
|
2314
2622
|
className: "detail-item"
|
|
2315
2623
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
2316
2624
|
className: "label"
|
|
2317
|
-
}, t("
|
|
2625
|
+
}, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React__default.createElement("span", {
|
|
2318
2626
|
className: "value"
|
|
2319
|
-
},
|
|
2627
|
+
}, zoneIds)))), /*#__PURE__*/React__default.createElement("div", {
|
|
2320
2628
|
className: "details-right"
|
|
2321
2629
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2322
2630
|
className: "download-card"
|
|
@@ -2394,6 +2702,10 @@ const useInboxTableConfig = _ref => {
|
|
|
2394
2702
|
tableStyle = _ref$tableStyle === void 0 ? {} : _ref$tableStyle;
|
|
2395
2703
|
const _useTranslation = reactI18next.useTranslation(),
|
|
2396
2704
|
t = _useTranslation.t;
|
|
2705
|
+
const toTitleCase = str => {
|
|
2706
|
+
if (!str) return "";
|
|
2707
|
+
return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
2708
|
+
};
|
|
2397
2709
|
const history = reactRouterDom.useHistory();
|
|
2398
2710
|
const _useState = React.useState(""),
|
|
2399
2711
|
selectedKno = _useState[0],
|
|
@@ -2437,18 +2749,18 @@ const useInboxTableConfig = _ref => {
|
|
|
2437
2749
|
Cell: _ref3 => {
|
|
2438
2750
|
var _row$original3;
|
|
2439
2751
|
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");
|
|
2752
|
+
return /*#__PURE__*/React__default.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
|
|
2441
2753
|
}
|
|
2442
2754
|
}, {
|
|
2443
2755
|
Header: t("EKYC_STATUS"),
|
|
2444
2756
|
accessor: "actionStatus",
|
|
2445
2757
|
Cell: _ref4 => {
|
|
2446
|
-
var _row$original4;
|
|
2758
|
+
var _row$original4, _row$original5;
|
|
2447
2759
|
let row = _ref4.row;
|
|
2448
2760
|
const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
|
|
2449
2761
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
2450
2762
|
className: "ekyc-status-tag " + status
|
|
2451
|
-
},
|
|
2763
|
+
}, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
|
|
2452
2764
|
}
|
|
2453
2765
|
}, {
|
|
2454
2766
|
Header: t("SUBMITTED_AT") || "Submitted At",
|
|
@@ -2468,12 +2780,13 @@ const useInboxTableConfig = _ref => {
|
|
|
2468
2780
|
Header: t("EKYC_EKYC_STATUS"),
|
|
2469
2781
|
accessor: "ekycStatus",
|
|
2470
2782
|
Cell: _ref7 => {
|
|
2471
|
-
var _row$
|
|
2783
|
+
var _row$original6, _row$original7;
|
|
2472
2784
|
let row = _ref7.row;
|
|
2473
|
-
const
|
|
2785
|
+
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";
|
|
2786
|
+
const ekycStatus = raw.toUpperCase();
|
|
2474
2787
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
2475
2788
|
className: "ekyc-status-tag " + ekycStatus
|
|
2476
|
-
},
|
|
2789
|
+
}, toTitleCase(raw));
|
|
2477
2790
|
}
|
|
2478
2791
|
}];
|
|
2479
2792
|
return {
|
|
@@ -3184,7 +3497,9 @@ const Inbox = _ref => {
|
|
|
3184
3497
|
propsForInboxTable,
|
|
3185
3498
|
propsForInboxMobileCards,
|
|
3186
3499
|
formState,
|
|
3187
|
-
countData: listData
|
|
3500
|
+
countData: listData,
|
|
3501
|
+
forceTable: true,
|
|
3502
|
+
showSearchOnMobile: true
|
|
3188
3503
|
})));
|
|
3189
3504
|
};
|
|
3190
3505
|
|
|
@@ -5864,12 +6179,24 @@ const AssignEkyc = () => {
|
|
|
5864
6179
|
propsForInboxMobileCards,
|
|
5865
6180
|
formState,
|
|
5866
6181
|
countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
|
|
5867
|
-
isCardLoading: isDataSearchLoading
|
|
6182
|
+
isCardLoading: isDataSearchLoading,
|
|
6183
|
+
showSearchOnMobile: true,
|
|
6184
|
+
forceTable: true
|
|
5868
6185
|
})));
|
|
5869
6186
|
};
|
|
5870
6187
|
|
|
6188
|
+
const parseAdditionalDetails = additionalDetails => {
|
|
6189
|
+
if (!additionalDetails) return {};
|
|
6190
|
+
if (typeof additionalDetails === "object") return additionalDetails;
|
|
6191
|
+
if (typeof additionalDetails !== "string") return {};
|
|
6192
|
+
try {
|
|
6193
|
+
return JSON.parse(additionalDetails);
|
|
6194
|
+
} catch (error) {
|
|
6195
|
+
return {};
|
|
6196
|
+
}
|
|
6197
|
+
};
|
|
5871
6198
|
const AdminDashboard = () => {
|
|
5872
|
-
var _Digit$SessionStorage
|
|
6199
|
+
var _Digit$SessionStorage;
|
|
5873
6200
|
const _useTranslation = reactI18next.useTranslation(),
|
|
5874
6201
|
t = _useTranslation.t;
|
|
5875
6202
|
const history = reactRouterDom.useHistory();
|
|
@@ -5893,162 +6220,46 @@ const AdminDashboard = () => {
|
|
|
5893
6220
|
isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
|
|
5894
6221
|
const vendorsList = React.useMemo(() => {
|
|
5895
6222
|
if (vendorSearchResponse && vendorSearchResponse.length > 0) {
|
|
5896
|
-
|
|
6223
|
+
const filteredVendors = vendorSearchResponse.filter(v => {
|
|
6224
|
+
var _additionalDetails$se;
|
|
6225
|
+
const dso = v.dsoDetails || v;
|
|
6226
|
+
const additionalDetails = parseAdditionalDetails(dso.additionalDetails || v.additionalDetails);
|
|
6227
|
+
return (additionalDetails === null || additionalDetails === void 0 ? void 0 : (_additionalDetails$se = additionalDetails.serviceType) === null || _additionalDetails$se === void 0 ? void 0 : _additionalDetails$se.toLowerCase()) === "ekyc";
|
|
6228
|
+
});
|
|
6229
|
+
return filteredVendors.map(v => {
|
|
5897
6230
|
var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
|
|
5898
6231
|
const dso = v.dsoDetails || v;
|
|
5899
6232
|
const supervisorsList = dso.supervisors || [];
|
|
5900
6233
|
const surveyorsList = dso.surveyors || [];
|
|
5901
6234
|
const supervisorIds = supervisorsList.map(s => {
|
|
5902
6235
|
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);
|
|
6236
|
+
return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
|
|
6237
|
+
}).filter(Boolean);
|
|
6238
|
+
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))) || [];
|
|
6239
|
+
const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
|
|
6240
|
+
const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
|
|
6241
|
+
const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
|
|
6242
|
+
const progress = total > 0 ? Math.round(completed / total * 100) : 0;
|
|
6243
|
+
const rejected = 0;
|
|
6244
|
+
return {
|
|
6245
|
+
id: dso.id || dso.vendorId || v.id || v.vendorId,
|
|
6246
|
+
name: dso.name || dso.displayName || v.name || "N/A",
|
|
6247
|
+
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",
|
|
6248
|
+
mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
|
|
6249
|
+
supervisors: supervisorsList.length,
|
|
6250
|
+
surveyors: surveyorsList.length,
|
|
6251
|
+
completed: completed,
|
|
6252
|
+
progress: progress,
|
|
6253
|
+
pending: pending,
|
|
6254
|
+
rejected: rejected
|
|
6255
|
+
};
|
|
6256
|
+
});
|
|
6011
6257
|
}
|
|
6012
|
-
|
|
6258
|
+
return [];
|
|
6259
|
+
}, [vendorSearchResponse, progressData]);
|
|
6013
6260
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
6014
6261
|
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", {
|
|
6262
|
+
}, /*#__PURE__*/React__default.createElement(Dashboard, null), /*#__PURE__*/React__default.createElement("div", {
|
|
6052
6263
|
className: "admin-performance-section"
|
|
6053
6264
|
}, /*#__PURE__*/React__default.createElement("h3", {
|
|
6054
6265
|
className: "section-title"
|
|
@@ -6336,7 +6547,8 @@ const SupervisorDetailsCard = () => {
|
|
|
6336
6547
|
showCustomPicker = _useState6[0],
|
|
6337
6548
|
setShowCustomPicker = _useState6[1];
|
|
6338
6549
|
const _useState7 = React.useState(false),
|
|
6339
|
-
reportLoading = _useState7[0]
|
|
6550
|
+
reportLoading = _useState7[0],
|
|
6551
|
+
setReportLoading = _useState7[1];
|
|
6340
6552
|
const reportMenuRef = React.useRef(null);
|
|
6341
6553
|
React.useEffect(() => {
|
|
6342
6554
|
const handler = e => {
|
|
@@ -6348,6 +6560,42 @@ const SupervisorDetailsCard = () => {
|
|
|
6348
6560
|
document.addEventListener("mousedown", handler);
|
|
6349
6561
|
return () => document.removeEventListener("mousedown", handler);
|
|
6350
6562
|
}, []);
|
|
6563
|
+
const handleDownload = () => {
|
|
6564
|
+
setReportLoading(true);
|
|
6565
|
+
try {
|
|
6566
|
+
const rowsWithStats = surveyors.map(s => ({
|
|
6567
|
+
name: s.surveyorName,
|
|
6568
|
+
mobileNo: s.mobileNo,
|
|
6569
|
+
status: s.status,
|
|
6570
|
+
total: s.totalKnos,
|
|
6571
|
+
completed: s.submittedKnos,
|
|
6572
|
+
pending: s.pendingKnos,
|
|
6573
|
+
progress: s.progressPercent + "%"
|
|
6574
|
+
}));
|
|
6575
|
+
const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
|
|
6576
|
+
const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
|
|
6577
|
+
downloadSupervisorPDF({
|
|
6578
|
+
rows: rowsWithStats,
|
|
6579
|
+
supervisorName: fullName,
|
|
6580
|
+
vendorName,
|
|
6581
|
+
mobileNumber,
|
|
6582
|
+
email,
|
|
6583
|
+
dashboardInfo: {
|
|
6584
|
+
total: totalKnos,
|
|
6585
|
+
completed: completedKnos,
|
|
6586
|
+
pending: totalKnos - completedKnos,
|
|
6587
|
+
submittedCount: completedKnos
|
|
6588
|
+
},
|
|
6589
|
+
t
|
|
6590
|
+
});
|
|
6591
|
+
} catch (err) {
|
|
6592
|
+
console.error("Failed to generate supervisor report:", err);
|
|
6593
|
+
} finally {
|
|
6594
|
+
setReportLoading(false);
|
|
6595
|
+
setShowReportMenu(false);
|
|
6596
|
+
setShowCustomPicker(false);
|
|
6597
|
+
}
|
|
6598
|
+
};
|
|
6351
6599
|
const handlePresetDownload = filter => {
|
|
6352
6600
|
handleDownload();
|
|
6353
6601
|
};
|
|
@@ -6367,20 +6615,13 @@ const SupervisorDetailsCard = () => {
|
|
|
6367
6615
|
setEkycDownloadLoading(true);
|
|
6368
6616
|
return Promise.resolve(_finallyRethrows(function () {
|
|
6369
6617
|
return _catch(function () {
|
|
6370
|
-
|
|
6618
|
+
return Promise.resolve(Digit.EkycService.application_list({
|
|
6371
6619
|
tenantId: tenantId || "dl.djb",
|
|
6372
6620
|
offset: 0,
|
|
6373
|
-
limit:
|
|
6374
|
-
surveyorId: s.surveyorId || s.id,
|
|
6621
|
+
limit: 10000,
|
|
6375
6622
|
reportDownload: true
|
|
6376
|
-
}).
|
|
6377
|
-
|
|
6378
|
-
return {
|
|
6379
|
-
consumerList: []
|
|
6380
|
-
};
|
|
6381
|
-
}));
|
|
6382
|
-
return Promise.resolve(Promise.all(fetchPromises)).then(function (results) {
|
|
6383
|
-
const consumerList = results.flatMap(res => (res === null || res === void 0 ? void 0 : res.consumerList) || []);
|
|
6623
|
+
})).then(function (response) {
|
|
6624
|
+
const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
|
|
6384
6625
|
if (consumerList.length === 0) {
|
|
6385
6626
|
alert(t("NO_DATA_FOUND") || "No data found for download.");
|
|
6386
6627
|
return;
|
|
@@ -6403,14 +6644,21 @@ const SupervisorDetailsCard = () => {
|
|
|
6403
6644
|
ward: t("WARD") || "Ward",
|
|
6404
6645
|
pincode: t("PINCODE") || "Pincode",
|
|
6405
6646
|
mrkey: t("MR_KEY") || "MR Key",
|
|
6647
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
6406
6648
|
createdTime: t("CREATED_TIME") || "Created Time",
|
|
6407
6649
|
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
6408
6650
|
};
|
|
6651
|
+
const toTitleCase = str => {
|
|
6652
|
+
if (!str) return "";
|
|
6653
|
+
const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
|
|
6654
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
6655
|
+
};
|
|
6656
|
+
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
6409
6657
|
const excelData = consumerList.map(item => {
|
|
6410
6658
|
const cleanObj = {};
|
|
6411
6659
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
6412
6660
|
if (fullName) {
|
|
6413
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
6661
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
6414
6662
|
}
|
|
6415
6663
|
Object.keys(item).forEach(key => {
|
|
6416
6664
|
if (excludedKeys.includes(key)) return;
|
|
@@ -6419,7 +6667,11 @@ const SupervisorDetailsCard = () => {
|
|
|
6419
6667
|
return;
|
|
6420
6668
|
}
|
|
6421
6669
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
6422
|
-
|
|
6670
|
+
if (typeof val === "string" && titleCaseFields.includes(key)) {
|
|
6671
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
6672
|
+
} else {
|
|
6673
|
+
cleanObj[friendlyHeader] = val;
|
|
6674
|
+
}
|
|
6423
6675
|
});
|
|
6424
6676
|
return cleanObj;
|
|
6425
6677
|
});
|
|
@@ -6660,9 +6912,11 @@ const SupervisorDetailsCard = () => {
|
|
|
6660
6912
|
const AssignEkycModal = _ref => {
|
|
6661
6913
|
let surveyor = _ref.surveyor,
|
|
6662
6914
|
closeModal = _ref.closeModal,
|
|
6663
|
-
refetchDashboard = _ref.refetchDashboard
|
|
6915
|
+
refetchDashboard = _ref.refetchDashboard,
|
|
6916
|
+
propsTenantId = _ref.tenantId;
|
|
6664
6917
|
const _useTranslation = reactI18next.useTranslation(),
|
|
6665
6918
|
t = _useTranslation.t;
|
|
6919
|
+
const tenantId = propsTenantId || Digit.ULBService.getCurrentTenantId();
|
|
6666
6920
|
const _useState = React.useState([]),
|
|
6667
6921
|
selectedKnos = _useState[0],
|
|
6668
6922
|
setSelectedKnos = _useState[1];
|
|
@@ -6699,16 +6953,15 @@ const AssignEkycModal = _ref => {
|
|
|
6699
6953
|
const _useState8 = React.useState(filters),
|
|
6700
6954
|
debouncedFilters = _useState8[0],
|
|
6701
6955
|
setDebouncedFilters = _useState8[1];
|
|
6702
|
-
const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.ZROLocation(
|
|
6703
|
-
zroLocationsData = _Digit$Hooks$ws$useWS.data
|
|
6704
|
-
isZroLoading = _Digit$Hooks$ws$useWS.isLoading;
|
|
6956
|
+
const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.ZROLocation(tenantId),
|
|
6957
|
+
zroLocationsData = _Digit$Hooks$ws$useWS.data;
|
|
6705
6958
|
const mappedZROLocation = React.useMemo(() => {
|
|
6706
6959
|
return (zroLocationsData || []).map(item => ({
|
|
6707
6960
|
code: item.code,
|
|
6708
6961
|
name: item.name
|
|
6709
6962
|
}));
|
|
6710
6963
|
}, [zroLocationsData]);
|
|
6711
|
-
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(
|
|
6964
|
+
const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]),
|
|
6712
6965
|
egovLocationData = _Digit$Hooks$useCommo.data;
|
|
6713
6966
|
const boundaryData = React.useMemo(() => {
|
|
6714
6967
|
var _egovLocationData$ego;
|
|
@@ -6786,6 +7039,27 @@ const AssignEkycModal = _ref => {
|
|
|
6786
7039
|
});
|
|
6787
7040
|
return Array.from(pinSet).sort();
|
|
6788
7041
|
}, [structuredLocalityData]);
|
|
7042
|
+
const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList({
|
|
7043
|
+
unassignedOnly: true,
|
|
7044
|
+
fetchFilterOptions: true
|
|
7045
|
+
}, {
|
|
7046
|
+
tenantId: tenantId,
|
|
7047
|
+
offset: 0,
|
|
7048
|
+
limit: 1000
|
|
7049
|
+
}, {
|
|
7050
|
+
staleTime: Infinity
|
|
7051
|
+
}),
|
|
7052
|
+
filterOptionsData = _Digit$Hooks$ekyc$use.data;
|
|
7053
|
+
const pincodeOptions = React.useMemo(() => {
|
|
7054
|
+
if (!filterOptionsData) return fetchedPincodes || [];
|
|
7055
|
+
const pins = filterOptionsData.pincodeOptions || [];
|
|
7056
|
+
return Array.isArray(pins) ? pins.filter(Boolean).map(String).sort() : [];
|
|
7057
|
+
}, [filterOptionsData, fetchedPincodes]);
|
|
7058
|
+
const mrkeyOptions = React.useMemo(() => {
|
|
7059
|
+
if (!filterOptionsData) return [];
|
|
7060
|
+
const keys = filterOptionsData.mrkeyOptions || [];
|
|
7061
|
+
return Array.isArray(keys) ? keys.filter(Boolean).map(String).sort() : [];
|
|
7062
|
+
}, [filterOptionsData]);
|
|
6789
7063
|
React.useEffect(() => {
|
|
6790
7064
|
const timer = setTimeout(() => {
|
|
6791
7065
|
setDebouncedFilters(filters);
|
|
@@ -6795,7 +7069,7 @@ const AssignEkycModal = _ref => {
|
|
|
6795
7069
|
React.useEffect(() => {
|
|
6796
7070
|
setCurrentPage(0);
|
|
6797
7071
|
}, [debouncedFilters, filters.kno]);
|
|
6798
|
-
const _Digit$Hooks$ekyc$
|
|
7072
|
+
const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycApplicationList(_extends({
|
|
6799
7073
|
unassignedOnly: true
|
|
6800
7074
|
}, filters.kno && {
|
|
6801
7075
|
kno: filters.kno
|
|
@@ -6812,14 +7086,15 @@ const AssignEkycModal = _ref => {
|
|
|
6812
7086
|
}, debouncedFilters.pincode && {
|
|
6813
7087
|
pincode: debouncedFilters.pincode
|
|
6814
7088
|
}), {
|
|
6815
|
-
tenantId:
|
|
7089
|
+
tenantId: tenantId,
|
|
6816
7090
|
offset: currentPage * pageSize,
|
|
6817
7091
|
limit: pageSize
|
|
6818
7092
|
}, {
|
|
6819
7093
|
keepPreviousData: true
|
|
6820
7094
|
}),
|
|
6821
|
-
applicationData = _Digit$Hooks$ekyc$
|
|
6822
|
-
isLoading = _Digit$Hooks$ekyc$
|
|
7095
|
+
applicationData = _Digit$Hooks$ekyc$use2.data,
|
|
7096
|
+
isLoading = _Digit$Hooks$ekyc$use2.isFetching,
|
|
7097
|
+
refetchApplicationList = _Digit$Hooks$ekyc$use2.refetch;
|
|
6823
7098
|
const handleAssignmentError = (errMsg, variables) => {
|
|
6824
7099
|
const isAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("active assignment") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key") || errMsg.toLowerCase().includes("kno") || errMsg.toLowerCase().includes("already exists");
|
|
6825
7100
|
if (isAlreadyAssigned) {
|
|
@@ -6864,9 +7139,23 @@ const AssignEkycModal = _ref => {
|
|
|
6864
7139
|
setShowToast(true);
|
|
6865
7140
|
setTimeout(function () {
|
|
6866
7141
|
try {
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
7142
|
+
function _temp4() {
|
|
7143
|
+
function _temp2() {
|
|
7144
|
+
closeModal();
|
|
7145
|
+
}
|
|
7146
|
+
const _temp = function () {
|
|
7147
|
+
if (refetchApplicationList) {
|
|
7148
|
+
return Promise.resolve(refetchApplicationList()).then(function () {});
|
|
7149
|
+
}
|
|
7150
|
+
}();
|
|
7151
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
|
7152
|
+
}
|
|
7153
|
+
const _temp3 = function () {
|
|
7154
|
+
if (refetchDashboard) {
|
|
7155
|
+
return Promise.resolve(refetchDashboard()).then(function () {});
|
|
7156
|
+
}
|
|
7157
|
+
}();
|
|
7158
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
|
6870
7159
|
} catch (e) {
|
|
6871
7160
|
return Promise.reject(e);
|
|
6872
7161
|
}
|
|
@@ -6922,7 +7211,7 @@ const AssignEkycModal = _ref => {
|
|
|
6922
7211
|
assignmentType = _getAssignmentPayload.assignmentType,
|
|
6923
7212
|
assignmentValue = _getAssignmentPayload.assignmentValue;
|
|
6924
7213
|
assignmentMutation.mutate({
|
|
6925
|
-
tenantId:
|
|
7214
|
+
tenantId: tenantId,
|
|
6926
7215
|
surveyorId: surveyor === null || surveyor === void 0 ? void 0 : (_surveyor$owner = surveyor.owner) === null || _surveyor$owner === void 0 ? void 0 : _surveyor$owner.uuid,
|
|
6927
7216
|
assignmentType,
|
|
6928
7217
|
assignmentValue
|
|
@@ -6998,7 +7287,7 @@ const AssignEkycModal = _ref => {
|
|
|
6998
7287
|
}),
|
|
6999
7288
|
actionCancelLabel: "Cancel",
|
|
7000
7289
|
actionCancelOnSubmit: closeModal,
|
|
7001
|
-
actionSaveLabel: "
|
|
7290
|
+
actionSaveLabel: t("EKYC_ASSIGN_KNOS") || "Assign KNOs",
|
|
7002
7291
|
actionSaveOnSubmit: handleAssign,
|
|
7003
7292
|
isDisabled: !(selectedKnos !== null && selectedKnos !== void 0 && selectedKnos.length)
|
|
7004
7293
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -7016,35 +7305,25 @@ const AssignEkycModal = _ref => {
|
|
|
7016
7305
|
onChange: e => handleFilterChange("pincode", e.target.value)
|
|
7017
7306
|
}, /*#__PURE__*/React__default.createElement("option", {
|
|
7018
7307
|
value: ""
|
|
7019
|
-
}, "Select Pincode"),
|
|
7308
|
+
}, "Select Pincode"), pincodeOptions.map(pin => /*#__PURE__*/React__default.createElement("option", {
|
|
7020
7309
|
key: pin,
|
|
7021
7310
|
value: pin
|
|
7022
7311
|
}, pin))), /*#__PURE__*/React__default.createElement("select", {
|
|
7023
|
-
className: "form-control",
|
|
7024
|
-
value: filters.zoneName,
|
|
7025
|
-
onChange: e => {
|
|
7026
|
-
const val = e.target.value;
|
|
7027
|
-
setFilters(prev => _extends({}, prev, {
|
|
7028
|
-
zoneCode: val,
|
|
7029
|
-
zoneName: val
|
|
7030
|
-
}));
|
|
7031
|
-
},
|
|
7032
|
-
disabled: isZroLoading
|
|
7033
|
-
}, /*#__PURE__*/React__default.createElement("option", {
|
|
7034
|
-
value: ""
|
|
7035
|
-
}, isZroLoading ? "Loading ZRO Locations..." : "Select ZRO Location"), mappedZROLocation.map(loc => /*#__PURE__*/React__default.createElement("option", {
|
|
7036
|
-
key: loc.code,
|
|
7037
|
-
value: loc.name
|
|
7038
|
-
}, loc.name))), /*#__PURE__*/React__default.createElement("select", {
|
|
7039
7312
|
className: "form-control",
|
|
7040
7313
|
value: filters.ward,
|
|
7041
7314
|
onChange: e => handleFilterChange("ward", e.target.value)
|
|
7042
7315
|
}, /*#__PURE__*/React__default.createElement("option", {
|
|
7043
7316
|
value: ""
|
|
7044
|
-
}, "Select Ward"), wardOptions.
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
}
|
|
7317
|
+
}, "Select Ward"), wardOptions.filter(ward => {
|
|
7318
|
+
const stripped = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
|
|
7319
|
+
return stripped.trim().length > 0;
|
|
7320
|
+
}).map(ward => {
|
|
7321
|
+
const displayName = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
|
|
7322
|
+
return /*#__PURE__*/React__default.createElement("option", {
|
|
7323
|
+
key: ward.code,
|
|
7324
|
+
value: ward.name
|
|
7325
|
+
}, displayName);
|
|
7326
|
+
})), /*#__PURE__*/React__default.createElement("select", {
|
|
7048
7327
|
className: "form-control",
|
|
7049
7328
|
value: filters.assembly,
|
|
7050
7329
|
onChange: e => handleFilterChange("assembly", e.target.value)
|
|
@@ -7053,16 +7332,20 @@ const AssignEkycModal = _ref => {
|
|
|
7053
7332
|
}, "Select Assembly"), assemblyOptions.map(assembly => /*#__PURE__*/React__default.createElement("option", {
|
|
7054
7333
|
key: assembly.code,
|
|
7055
7334
|
value: assembly.name
|
|
7056
|
-
}, assembly.name))), /*#__PURE__*/React__default.createElement("
|
|
7335
|
+
}, assembly.name))), /*#__PURE__*/React__default.createElement("select", {
|
|
7057
7336
|
className: "form-control",
|
|
7058
|
-
placeholder: "MR Key",
|
|
7059
7337
|
value: filters.mrkey,
|
|
7060
7338
|
onChange: e => handleFilterChange("mrkey", e.target.value)
|
|
7061
|
-
}
|
|
7339
|
+
}, /*#__PURE__*/React__default.createElement("option", {
|
|
7340
|
+
value: ""
|
|
7341
|
+
}, "Select MR Key"), mrkeyOptions.map(key => /*#__PURE__*/React__default.createElement("option", {
|
|
7342
|
+
key: key,
|
|
7343
|
+
value: key
|
|
7344
|
+
}, key))), selectedKnos.length > 0 && /*#__PURE__*/React__default.createElement("button", {
|
|
7062
7345
|
className: "clear-selected-btn",
|
|
7063
7346
|
type: "button",
|
|
7064
7347
|
onClick: () => setSelectedKnos([])
|
|
7065
|
-
}, t("EKYC_CLEAR_SELECTION") || "Clear Selected
|
|
7348
|
+
}, t("EKYC_CLEAR_SELECTION") || "Clear Selected")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Table, {
|
|
7066
7349
|
tableTitle: "eKYC Applications",
|
|
7067
7350
|
tableClass: "ekycTable",
|
|
7068
7351
|
data: tableData,
|
|
@@ -7101,7 +7384,7 @@ const AssignEkycModal = _ref => {
|
|
|
7101
7384
|
};
|
|
7102
7385
|
|
|
7103
7386
|
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,
|
|
7387
|
+
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
7388
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
7106
7389
|
const _useState = React.useState(false),
|
|
7107
7390
|
showModal = _useState[0],
|
|
@@ -7205,16 +7488,22 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7205
7488
|
_Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
|
|
7206
7489
|
dashboardData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2,
|
|
7207
7490
|
refetchDashboard = _Digit$Hooks$ekyc$use.refetch;
|
|
7491
|
+
const toTitleCase = str => {
|
|
7492
|
+
if (!str) return "";
|
|
7493
|
+
const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
|
|
7494
|
+
return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
7495
|
+
};
|
|
7208
7496
|
const knoColumns = React.useMemo(() => [{
|
|
7209
7497
|
Header: t("KNO") || "KNO",
|
|
7210
7498
|
accessor: "kno"
|
|
7211
7499
|
}, {
|
|
7212
7500
|
Header: t("CONSUMER_NAME") || "Consumer Name",
|
|
7213
|
-
accessor: row => ((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim(),
|
|
7501
|
+
accessor: row => toTitleCase(((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim()),
|
|
7214
7502
|
id: "consumerName"
|
|
7215
7503
|
}, {
|
|
7216
7504
|
Header: t("ZONE") || "Zone",
|
|
7217
|
-
accessor:
|
|
7505
|
+
accessor: row => toTitleCase(row.zoneName),
|
|
7506
|
+
id: "zoneName"
|
|
7218
7507
|
}, {
|
|
7219
7508
|
Header: t("EKYC_STATUS") || "eKYC Status",
|
|
7220
7509
|
accessor: "ekycStatus",
|
|
@@ -7223,7 +7512,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7223
7512
|
const status = (value || "NA").toUpperCase();
|
|
7224
7513
|
return value ? /*#__PURE__*/React__default.createElement("span", {
|
|
7225
7514
|
className: "ekyc-status-tag " + status
|
|
7226
|
-
},
|
|
7515
|
+
}, toTitleCase(value)) : "-";
|
|
7227
7516
|
}
|
|
7228
7517
|
}, {
|
|
7229
7518
|
Header: t("SUBMITTED_AT") || "Submitted At",
|
|
@@ -7462,6 +7751,7 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7462
7751
|
ward: t("WARD") || "Ward",
|
|
7463
7752
|
pincode: t("PINCODE") || "Pincode",
|
|
7464
7753
|
mrkey: t("MR_KEY") || "MR Key",
|
|
7754
|
+
consumerType: t("CONSUMER_TYPE") || "Consumer Type",
|
|
7465
7755
|
createdTime: t("CREATED_TIME") || "Created Time",
|
|
7466
7756
|
lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
|
|
7467
7757
|
};
|
|
@@ -7469,8 +7759,9 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7469
7759
|
const cleanObj = {};
|
|
7470
7760
|
const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
|
|
7471
7761
|
if (fullName) {
|
|
7472
|
-
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
|
|
7762
|
+
cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
|
|
7473
7763
|
}
|
|
7764
|
+
const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
|
|
7474
7765
|
Object.keys(item).forEach(key => {
|
|
7475
7766
|
if (excludedKeys.includes(key)) return;
|
|
7476
7767
|
const val = item[key];
|
|
@@ -7478,7 +7769,11 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7478
7769
|
return;
|
|
7479
7770
|
}
|
|
7480
7771
|
const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
|
|
7481
|
-
|
|
7772
|
+
if (typeof val === "string" && titleCaseFields.includes(key)) {
|
|
7773
|
+
cleanObj[friendlyHeader] = toTitleCase(val);
|
|
7774
|
+
} else {
|
|
7775
|
+
cleanObj[friendlyHeader] = val;
|
|
7776
|
+
}
|
|
7482
7777
|
});
|
|
7483
7778
|
return cleanObj;
|
|
7484
7779
|
});
|
|
@@ -7642,12 +7937,6 @@ const SurveyorDetailsDashboard = () => {
|
|
|
7642
7937
|
className: "detail-item"
|
|
7643
7938
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
7644
7939
|
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
7940
|
}, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React__default.createElement("span", {
|
|
7652
7941
|
className: "value"
|
|
7653
7942
|
}, vendorName)), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -9123,74 +9412,6 @@ const MeterDetails = _ref => {
|
|
|
9123
9412
|
}));
|
|
9124
9413
|
};
|
|
9125
9414
|
|
|
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
9415
|
const Inbox$1 = _ref => {
|
|
9195
9416
|
var _formState$tableForm3, _formState$tableForm4, _formState$searchForm3, _formState$searchForm4, _dashboardData$dashbo;
|
|
9196
9417
|
let parentRoute = _ref.parentRoute;
|
|
@@ -9451,7 +9672,9 @@ const Inbox$1 = _ref => {
|
|
|
9451
9672
|
}, propsForSearchForm, propsForMobileSortForm, {
|
|
9452
9673
|
propsForInboxTable,
|
|
9453
9674
|
propsForInboxMobileCards,
|
|
9454
|
-
formState
|
|
9675
|
+
formState,
|
|
9676
|
+
forceTable: true,
|
|
9677
|
+
showSearchOnMobile: true
|
|
9455
9678
|
})));
|
|
9456
9679
|
};
|
|
9457
9680
|
|
|
@@ -9664,7 +9887,8 @@ const EkycStatus = () => {
|
|
|
9664
9887
|
}, propsForSearchForm, {
|
|
9665
9888
|
propsForInboxTable,
|
|
9666
9889
|
propsForInboxMobileCards,
|
|
9667
|
-
formState
|
|
9890
|
+
formState,
|
|
9891
|
+
showSearchOnMobile: true
|
|
9668
9892
|
})))), errorMsg && /*#__PURE__*/React__default.createElement("div", {
|
|
9669
9893
|
className: "ekyc-status-error-msg"
|
|
9670
9894
|
}, errorMsg), isLoading && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null), !isLoading && details && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
@@ -9712,10 +9936,7 @@ const CitizenApp = () => {
|
|
|
9712
9936
|
const location = reactRouterDom.useLocation();
|
|
9713
9937
|
const _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
9714
9938
|
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;
|
|
9939
|
+
const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData();
|
|
9719
9940
|
sessionStorage.removeItem("revalidateddone");
|
|
9720
9941
|
const getDynamicBreadcrumbs = () => {
|
|
9721
9942
|
const pathname = location.pathname;
|
|
@@ -9794,44 +10015,23 @@ const CitizenApp = () => {
|
|
|
9794
10015
|
}
|
|
9795
10016
|
return crumbs;
|
|
9796
10017
|
};
|
|
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"
|
|
10018
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.AppContainer, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10019
|
+
className: "ground-container form-container",
|
|
10020
|
+
style: {
|
|
10021
|
+
flex: 1
|
|
10022
|
+
}
|
|
9822
10023
|
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleHeader, {
|
|
9823
10024
|
leftContent: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ArrowLeft, {
|
|
9824
10025
|
className: "icon"
|
|
9825
10026
|
}), t("CS_COMMON_BACK")),
|
|
9826
10027
|
onLeftClick: () => window.history.back(),
|
|
9827
10028
|
breadcrumbs: getDynamicBreadcrumbs()
|
|
9828
|
-
}), /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(
|
|
10029
|
+
}), /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
|
|
9829
10030
|
exact: true,
|
|
9830
|
-
path: "" + path
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
10031
|
+
path: "" + path
|
|
10032
|
+
}, /*#__PURE__*/React__default.createElement(reactRouterDom.Redirect, {
|
|
10033
|
+
to: "/digit-ui/citizen/ekyc-home"
|
|
10034
|
+
})), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
9835
10035
|
path: [path + "/vendor-dashboard/:vendorId", path + "/vendor-dashboard"],
|
|
9836
10036
|
component: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
|
|
9837
10037
|
layoutClass: "normal"
|
|
@@ -9937,19 +10137,61 @@ const EkycModule = _ref => {
|
|
|
9937
10137
|
} else return /*#__PURE__*/React__default.createElement(CitizenApp, null);
|
|
9938
10138
|
};
|
|
9939
10139
|
const EkycLinks = _ref2 => {
|
|
9940
|
-
|
|
10140
|
+
var _Digit$SessionStorage, _Digit$SessionStorage2;
|
|
9941
10141
|
const _useTranslation = reactI18next.useTranslation(),
|
|
9942
10142
|
t = _useTranslation.t;
|
|
9943
|
-
const
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
10143
|
+
const propsForModuleCard = {
|
|
10144
|
+
links: []
|
|
10145
|
+
};
|
|
10146
|
+
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;
|
|
10147
|
+
const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
|
|
10148
|
+
if (roles.includes("EKYC_SURVEYOR")) {
|
|
10149
|
+
propsForModuleCard.links.push({
|
|
10150
|
+
label: t("SURVEYOR_DASHBOARD"),
|
|
10151
|
+
link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
|
|
10152
|
+
});
|
|
10153
|
+
}
|
|
10154
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
10155
|
+
propsForModuleCard.links.push({
|
|
10156
|
+
label: t("EKYC_INBOX"),
|
|
10157
|
+
link: "/digit-ui/citizen/ekyc/inbox"
|
|
10158
|
+
});
|
|
10159
|
+
}
|
|
10160
|
+
if (roles.includes("EKYC_SUPERVISOR")) {
|
|
10161
|
+
propsForModuleCard.links.push({
|
|
10162
|
+
label: t("EKYC_SUPERVISOR_DASHBOARD"),
|
|
10163
|
+
link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
|
|
10164
|
+
}, {
|
|
10165
|
+
label: t("EKYC_ASSIGN"),
|
|
10166
|
+
link: "/digit-ui/citizen/ekyc/assign"
|
|
10167
|
+
});
|
|
10168
|
+
}
|
|
10169
|
+
if (roles.includes("EKYC_VENDOR")) {
|
|
10170
|
+
propsForModuleCard.links.push({
|
|
10171
|
+
label: t("EKYC_VENDOR_DASHBOARD"),
|
|
10172
|
+
link: "/digit-ui/citizen/ekyc/vendor-dashboard"
|
|
10173
|
+
});
|
|
10174
|
+
}
|
|
10175
|
+
if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
|
|
10176
|
+
propsForModuleCard.links.push({
|
|
10177
|
+
label: t("TITLE_VENDOR_MANAGEMENT"),
|
|
10178
|
+
link: "/digit-ui/citizen/vendor/search-vendor"
|
|
10179
|
+
});
|
|
10180
|
+
}
|
|
10181
|
+
if (roles.length === 1 && roles.includes("CITIZEN")) {
|
|
10182
|
+
propsForModuleCard.links.push({
|
|
10183
|
+
label: t("EKYC_STATUS"),
|
|
10184
|
+
link: "/digit-ui/citizen/ekyc/:id"
|
|
10185
|
+
});
|
|
10186
|
+
}
|
|
10187
|
+
const formattedLinks = propsForModuleCard.links.map(l => ({
|
|
10188
|
+
i18nKey: l.label,
|
|
10189
|
+
link: l.link,
|
|
10190
|
+
count: l.count
|
|
10191
|
+
}));
|
|
9950
10192
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
|
|
9951
10193
|
header: t("EKYC_MODULE_NAME"),
|
|
9952
|
-
links:
|
|
10194
|
+
links: formattedLinks,
|
|
9953
10195
|
Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
|
|
9954
10196
|
className: "fill-path-primary-main"
|
|
9955
10197
|
})
|