@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.
@@ -1,18 +1,19 @@
1
- import React, { useRef, useEffect, useMemo, useState, createContext, useContext, isValidElement, cloneElement, createElement, useCallback, useReducer, Fragment } from 'react';
1
+ import React, { useState, useRef, useEffect, useMemo, createContext, useContext, isValidElement, cloneElement, createElement, useCallback, useReducer, Fragment } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { useHistory, Link, useLocation, useParams, useRouteMatch, Switch, Route, Redirect } from 'react-router-dom';
4
- import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, SearchField, RadioButtons, InboxComposer, EditIcon, DeleteIcon, CardHeader, CardText, LabelFieldPair, CardLabel, ActionBar, Modal, Toast, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, Menu, LinkButton, UploadFile, FormComposer, VerticalTimeline, Close, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CitizenHomeCard, DocumentIcon, BackButton } from '@djb25/digit-ui-react-components';
4
+ import { PersonIcon, EmployeeModuleCard, Loader, Card, InboxLinks, Table, HomeIcon, TextInput, Header, SubmitBar, DetailsCard, FilterForm, FilterFormField, Dropdown, Label, CustomTooltip, CardLabelError, SearchField, RadioButtons, InboxComposer, EditIcon, DeleteIcon, CardHeader, CardText, LabelFieldPair, CardLabel, ActionBar, Modal, Toast, CardSubHeader, StatusTable, Row, GenericFileIcon, CheckBox, Menu, LinkButton, UploadFile, FormComposer, VerticalTimeline, Close, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, CitizenHomeCard, DocumentIcon } from '@djb25/digit-ui-react-components';
5
5
  import * as Chartjs from 'chart.js/auto';
6
6
  import Chartjs__default, { Chart } from 'chart.js/auto';
7
7
  import { FaUsers, FaCheckCircle, FaClock, FaExclamationTriangle, FaUserTie, FaChartLine, FaSearch, FaArrowRight, FaMapMarkedAlt } from 'react-icons/fa';
8
8
  import { ResponsiveContainer, LineChart, CartesianGrid, XAxis, YAxis, Tooltip, Legend, Line, BarChart, Bar, PieChart, Pie, Cell } from 'recharts';
9
9
 
10
10
  const EKYCCard = () => {
11
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
11
+ var _Digit$SessionStorage, _Digit$SessionStorage2;
12
12
  const _useTranslation = useTranslation(),
13
13
  t = _useTranslation.t;
14
14
  const tenantId = Digit.ULBService.getCurrentTenantId();
15
- const roles = ((_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.roles) === null || _Digit$SessionStorage3 === void 0 ? void 0 : _Digit$SessionStorage3.map(r => r.code)) || [];
15
+ 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;
16
+ const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code || ele) : [];
16
17
  const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycApplicationList({}, {
17
18
  tenantId,
18
19
  offset: 0,
@@ -23,47 +24,228 @@ const EKYCCard = () => {
23
24
  listData = _Digit$Hooks$ekyc$use.data,
24
25
  isLoading = _Digit$Hooks$ekyc$use.isLoading;
25
26
  const totalCount = isLoading ? "-" : (listData === null || listData === void 0 ? void 0 : listData.totalCount) || 0;
26
- const propsForModuleCard = {
27
- Icon: /*#__PURE__*/React.createElement(PersonIcon, null),
28
- moduleName: t("ACTION_TEST_EKYC"),
29
- kpis: [{
30
- count: totalCount,
31
- label: t("TOTAL_EKYC"),
32
- link: "/digit-ui/employee/ekyc/dashboard"
33
- }],
34
- links: [{
27
+ const isCitizen = window.location.pathname.includes("/citizen");
28
+ const prefix = isCitizen ? "/digit-ui/citizen/ekyc" : "/digit-ui/employee/ekyc";
29
+ let links = [];
30
+ if (isCitizen) {
31
+ if (roles.includes("EKYC_SURVEYOR")) {
32
+ links.push({
33
+ label: t("SURVEYOR_DASHBOARD"),
34
+ link: prefix + "/surveyor-dashboard"
35
+ });
36
+ }
37
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
38
+ links.push({
39
+ count: totalCount,
40
+ label: t("EKYC_INBOX"),
41
+ link: prefix + "/inbox"
42
+ });
43
+ }
44
+ if (roles.includes("EKYC_SUPERVISOR")) {
45
+ links.push({
46
+ label: t("EKYC_SUPERVISOR_DASHBOARD"),
47
+ link: prefix + "/supervisor-dashboard"
48
+ }, {
49
+ label: t("EKYC_ASSIGN"),
50
+ link: prefix + "/assign"
51
+ });
52
+ }
53
+ if (roles.includes("EKYC_VENDOR")) {
54
+ links.push({
55
+ label: t("EKYC_VENDOR_DASHBOARD"),
56
+ link: prefix + "/vendor-dashboard"
57
+ });
58
+ }
59
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
60
+ links.push({
61
+ label: t("TITLE_VENDOR_MANAGEMENT"),
62
+ link: "/digit-ui/citizen/vendor/search-vendor"
63
+ });
64
+ }
65
+ if (links.length === 0 || roles.length === 1 && roles.includes("CITIZEN")) {
66
+ links.push({
67
+ label: t("EKYC_STATUS"),
68
+ link: prefix + "/:id"
69
+ });
70
+ }
71
+ } else {
72
+ links = [{
35
73
  label: t("CEO_M.F_DOR_FINANCE_VIEW"),
36
- link: "/digit-ui/employee/ekyc/ceo-dashboard"
74
+ link: prefix + "/ceo-dashboard"
37
75
  }, {
38
76
  label: t("EKYC_ADMIN_DASHBOARD") || "Admin Dashboard",
39
- link: "/digit-ui/employee/ekyc/admin-dashboard"
77
+ link: prefix + "/admin-dashboard"
40
78
  }, {
41
79
  count: totalCount,
42
80
  label: t("EKYC_INBOX"),
43
- link: "/digit-ui/employee/ekyc/inbox"
81
+ link: prefix + "/inbox"
44
82
  }, ...(!roles.includes("EMPLOYEE") ? [{
45
83
  label: t("EKYC_ASSIGN"),
46
- link: "/digit-ui/employee/ekyc/assign"
47
- }] : [])]
84
+ link: prefix + "/assign"
85
+ }] : [])];
86
+ }
87
+ const propsForModuleCard = {
88
+ Icon: /*#__PURE__*/React.createElement(PersonIcon, null),
89
+ moduleName: t("ACTION_TEST_EKYC"),
90
+ kpis: isCitizen ? [] : [{
91
+ count: totalCount,
92
+ label: t("TOTAL_EKYC"),
93
+ link: prefix + "/admin-dashboard"
94
+ }],
95
+ links: links
48
96
  };
49
97
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
50
98
  };
51
99
 
100
+ const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
101
+ const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
102
+ function _catch(body, recover) {
103
+ try {
104
+ var result = body();
105
+ } catch (e) {
106
+ return recover(e);
107
+ }
108
+ if (result && result.then) {
109
+ return result.then(void 0, recover);
110
+ }
111
+ return result;
112
+ }
113
+ function _finallyRethrows(body, finalizer) {
114
+ try {
115
+ var result = body();
116
+ } catch (e) {
117
+ return finalizer(true, e);
118
+ }
119
+ if (result && result.then) {
120
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
121
+ }
122
+ return finalizer(false, result);
123
+ }
124
+
52
125
  const getChartConstructor = () => {
53
126
  const C = Chart || Chartjs__default || Chartjs;
54
127
  return C;
55
128
  };
56
129
  const StatusCards = _ref => {
130
+ var _Digit$SessionStorage;
57
131
  let countData = _ref.countData;
58
132
  const _useTranslation = useTranslation(),
59
133
  t = _useTranslation.t;
134
+ const _useState = useState(false),
135
+ ekycDownloadLoading = _useState[0],
136
+ setEkycDownloadLoading = _useState[1];
137
+ let tenantId = Digit.ULBService.getCurrentTenantId();
138
+ if (!tenantId || tenantId === "dl") {
139
+ tenantId = "dl.djb";
140
+ }
141
+ const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
142
+ const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
143
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycSurveyorDashboard({}, {
144
+ tenantId,
145
+ offset: 0,
146
+ limit: 10,
147
+ ekycStatus: "submitted"
148
+ }, {
149
+ enabled: !!tenantId
150
+ }),
151
+ dashboardData = _Digit$Hooks$ekyc$use.data;
152
+ const apiCountData = React.useMemo(() => {
153
+ const info = (dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo) || {};
154
+ return {
155
+ total: info.total || 0,
156
+ completed: info.completed || 0,
157
+ pending: info.pending || 0,
158
+ rejected: info.rejected || 0,
159
+ active: info.active || 0
160
+ };
161
+ }, [dashboardData]);
162
+ const handleDownloadEkycData = function () {
163
+ try {
164
+ setEkycDownloadLoading(true);
165
+ return Promise.resolve(_finallyRethrows(function () {
166
+ return _catch(function () {
167
+ return Promise.resolve(Digit.EkycService.application_list({
168
+ tenantId: tenantId,
169
+ offset: 0,
170
+ limit: 10000,
171
+ reportDownload: true
172
+ })).then(function (response) {
173
+ const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
174
+ if (consumerList.length === 0) {
175
+ alert(t("NO_DATA_FOUND") || "No data found for download.");
176
+ return;
177
+ }
178
+ 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"];
179
+ const headerMapping = {
180
+ kno: t("KNO") || "KNO",
181
+ firstName: t("FIRST_NAME") || "First Name",
182
+ middleName: t("MIDDLE_NAME") || "Middle Name",
183
+ lastName: t("LAST_NAME") || "Last Name",
184
+ gender: t("GENDER") || "Gender",
185
+ mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
186
+ emailId: t("EMAIL_ID") || "Email ID",
187
+ fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
188
+ relationship: t("RELATIONSHIP") || "Relationship",
189
+ dob: t("DOB") || "Date of Birth",
190
+ ekycStatus: t("EKYC_STATUS") || "eKYC Status",
191
+ zoneName: t("ZONE") || "Zone",
192
+ assembly: t("ASSEMBLY") || "Assembly",
193
+ ward: t("WARD") || "Ward",
194
+ pincode: t("PINCODE") || "Pincode",
195
+ mrkey: t("MR_KEY") || "MR Key",
196
+ consumerType: t("CONSUMER_TYPE") || "Consumer Type",
197
+ createdTime: t("CREATED_TIME") || "Created Time",
198
+ lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
199
+ };
200
+ const toTitleCase = str => {
201
+ if (!str) return "";
202
+ const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
203
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
204
+ };
205
+ const skipTitleCase = ["kno", "mobileNumber", "emailId", "pincode", "mrkey", "dob", "createdTime", "lastModifiedTime"];
206
+ const excelData = consumerList.map(item => {
207
+ const cleanObj = {};
208
+ const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
209
+ if (name) {
210
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(name);
211
+ }
212
+ Object.keys(item).forEach(key => {
213
+ if (excludedKeys.includes(key)) return;
214
+ const val = item[key];
215
+ if (typeof val === "object" && val !== null) {
216
+ return;
217
+ }
218
+ const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
219
+ if (typeof val === "string" && !skipTitleCase.includes(key)) {
220
+ cleanObj[friendlyHeader] = toTitleCase(val);
221
+ } else {
222
+ cleanObj[friendlyHeader] = val;
223
+ }
224
+ });
225
+ return cleanObj;
226
+ });
227
+ const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
228
+ Digit.Download.Excel(excelData, cleanFileName);
229
+ });
230
+ }, function (error) {
231
+ console.error("Error downloading eKYC Excel:", error);
232
+ });
233
+ }, function (_wasThrown, _result) {
234
+ setEkycDownloadLoading(false);
235
+ if (_wasThrown) throw _result;
236
+ return _result;
237
+ }));
238
+ } catch (e) {
239
+ return Promise.reject(e);
240
+ }
241
+ };
60
242
  const chartRef1 = useRef(null);
61
243
  const chartInstance1 = useRef(null);
62
- const total = (countData === null || countData === void 0 ? void 0 : countData.total) || 0;
63
- const pending = (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
64
- const active = (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
65
- const completed = 0;
66
- const actualCompleted = (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
244
+ 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;
245
+ const pending = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.pending) || (countData === null || countData === void 0 ? void 0 : countData.pending) || 0;
246
+ const active = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.active) || (countData === null || countData === void 0 ? void 0 : countData.active) || 0;
247
+ const completed = (apiCountData === null || apiCountData === void 0 ? void 0 : apiCountData.completed) || (countData === null || countData === void 0 ? void 0 : countData.completed) || 0;
248
+ const actualCompleted = completed;
67
249
  const approved = actualCompleted;
68
250
  const efficiency = total > 0 ? Math.round(actualCompleted / total * 100) : 0;
69
251
  const healthPct = total > 0 ? Math.round(approved / total * 100) : 0;
@@ -136,7 +318,29 @@ const StatusCards = _ref => {
136
318
  className: "total-number"
137
319
  }, formatNumber(total)), /*#__PURE__*/React.createElement("div", {
138
320
  className: "total-badge"
139
- }, "\u2197 +12.4% ", t("EKYC_FROM_LAST_QUARTER") || "from last quarter"))), /*#__PURE__*/React.createElement("div", {
321
+ }, "\u2197 +12.4% ", t("EKYC_FROM_LAST_QUARTER") || "from last quarter"), /*#__PURE__*/React.createElement("button", {
322
+ className: "download-excel-btn",
323
+ disabled: ekycDownloadLoading,
324
+ onClick: handleDownloadEkycData
325
+ }, /*#__PURE__*/React.createElement("svg", {
326
+ width: "16",
327
+ height: "16",
328
+ viewBox: "0 0 24 24",
329
+ fill: "none",
330
+ stroke: "currentColor",
331
+ strokeWidth: "2.5",
332
+ strokeLinecap: "round",
333
+ strokeLinejoin: "round"
334
+ }, /*#__PURE__*/React.createElement("path", {
335
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
336
+ }), /*#__PURE__*/React.createElement("polyline", {
337
+ points: "7 10 12 15 17 10"
338
+ }), /*#__PURE__*/React.createElement("line", {
339
+ x1: "12",
340
+ y1: "15",
341
+ x2: "12",
342
+ y2: "3"
343
+ })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel"))), /*#__PURE__*/React.createElement("div", {
140
344
  className: "status-panels-grid"
141
345
  }, /*#__PURE__*/React.createElement("div", {
142
346
  className: "status-panel"
@@ -279,6 +483,10 @@ const DesktopInbox = _ref => {
279
483
  countData = props.countData;
280
484
  const _useTranslation = useTranslation(),
281
485
  t = _useTranslation.t;
486
+ const toTitleCase = str => {
487
+ if (!str) return "";
488
+ return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
489
+ };
282
490
  const history = useHistory();
283
491
  const tenantId = Digit.ULBService.getCurrentTenantId();
284
492
  const FilterComponent = (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent(filterComponent);
@@ -321,37 +529,38 @@ const DesktopInbox = _ref => {
321
529
  Cell: _ref3 => {
322
530
  var _row$original3;
323
531
  let row = _ref3.row;
324
- return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
532
+ return /*#__PURE__*/React.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
325
533
  }
326
534
  }, {
327
535
  Header: t("EKYC_STATUS"),
328
536
  accessor: "actionStatus",
329
537
  Cell: _ref4 => {
330
- var _row$original4;
538
+ var _row$original4, _row$original5;
331
539
  let row = _ref4.row;
332
540
  const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
333
541
  return /*#__PURE__*/React.createElement("span", {
334
542
  className: "ekyc-status-tag " + status
335
- }, t("" + status));
543
+ }, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
336
544
  }
337
545
  }, {
338
546
  Header: t("EKYC_EKYC_STATUS"),
339
547
  accessor: "ekycStatus",
340
548
  Cell: _ref5 => {
341
- var _row$original5, _row$original6;
549
+ var _row$original6, _row$original7;
342
550
  let row = _ref5.row;
343
- const ekycStatus = (((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.ekycStatus) || ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycstatus) || "NA").toUpperCase();
551
+ 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";
552
+ const ekycStatus = raw.toUpperCase();
344
553
  return /*#__PURE__*/React.createElement("span", {
345
554
  className: "ekyc-status-tag " + ekycStatus
346
- }, t("" + ekycStatus));
555
+ }, toTitleCase(raw));
347
556
  }
348
557
  }, {
349
558
  Header: t("EKYC_ACTION"),
350
559
  accessor: "status",
351
560
  Cell: _ref6 => {
352
- var _row$original7, _row$original8;
561
+ var _row$original8, _row$original9;
353
562
  let row = _ref6.row;
354
- const kno = ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.kno) || ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.applicationNumber) || "NA";
563
+ 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";
355
564
  return /*#__PURE__*/React.createElement("span", {
356
565
  className: "link",
357
566
  onClick: () => handleReview(kno)
@@ -1590,31 +1799,6 @@ const CeoDashboard = () => {
1590
1799
  }, /*#__PURE__*/React.createElement("h3", null, topKpis.successRate, "%"), /*#__PURE__*/React.createElement("p", null, "Operational Efficiency")))))));
1591
1800
  };
1592
1801
 
1593
- const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
1594
- const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
1595
- function _catch(body, recover) {
1596
- try {
1597
- var result = body();
1598
- } catch (e) {
1599
- return recover(e);
1600
- }
1601
- if (result && result.then) {
1602
- return result.then(void 0, recover);
1603
- }
1604
- return result;
1605
- }
1606
- function _finallyRethrows(body, finalizer) {
1607
- try {
1608
- var result = body();
1609
- } catch (e) {
1610
- return finalizer(true, e);
1611
- }
1612
- if (result && result.then) {
1613
- return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
1614
- }
1615
- return finalizer(false, result);
1616
- }
1617
-
1618
1802
  const downloadSurveyorPDF = function (_ref) {
1619
1803
  let rows = _ref.rows,
1620
1804
  surveyorName = _ref.surveyorName,
@@ -1704,6 +1888,123 @@ const downloadSurveyorPDF = function (_ref) {
1704
1888
  return Promise.reject(e);
1705
1889
  }
1706
1890
  };
1891
+ const downloadSupervisorPDF = function (_ref2) {
1892
+ let rows = _ref2.rows,
1893
+ supervisorName = _ref2.supervisorName,
1894
+ mobileNumber = _ref2.mobileNumber,
1895
+ vendorName = _ref2.vendorName,
1896
+ dashboardInfo = _ref2.dashboardInfo,
1897
+ t = _ref2.t;
1898
+ try {
1899
+ const tenantId = Digit.ULBService.getCurrentTenantId();
1900
+ const name = "Delhi Jal Board";
1901
+ const email = "contact@delhijalboard.nic.in";
1902
+ const phoneNumber = "+91-11-23538416";
1903
+ const currentDate = new Date();
1904
+ const formattedDate = currentDate.toLocaleDateString("en-IN", {
1905
+ day: "2-digit",
1906
+ month: "2-digit",
1907
+ year: "numeric"
1908
+ });
1909
+ const formattedTime = currentDate.toLocaleTimeString("en-IN", {
1910
+ hour: "2-digit",
1911
+ minute: "2-digit",
1912
+ second: "2-digit",
1913
+ hour12: false
1914
+ });
1915
+ const downloadDateTime = formattedDate + " " + formattedTime;
1916
+ const isValDefined = val => val !== undefined && val !== null && val !== "";
1917
+ const details = [{
1918
+ title: t("SUPERVISOR_DETAILS") || "Supervisor Details",
1919
+ asSectionHeader: true,
1920
+ values: [{
1921
+ title: t("SUPERVISOR_NAME") || "Supervisor Name",
1922
+ value: supervisorName
1923
+ }, {
1924
+ title: t("MOBILE_NUMBER") || "Mobile Number",
1925
+ value: mobileNumber
1926
+ }, {
1927
+ title: t("VENDOR_NAME") || "Vendor Name",
1928
+ value: vendorName
1929
+ }].filter(item => isValDefined(item.value))
1930
+ }, {
1931
+ title: t("SUMMARY_STATISTICS") || "Summary Statistics",
1932
+ asSectionHeader: true,
1933
+ values: [{
1934
+ title: t("TOTAL_ASSIGNED") || "Total Assigned",
1935
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.total) || 0
1936
+ }, {
1937
+ title: t("COMPLETED") || "Completed",
1938
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.completed) || 0
1939
+ }, {
1940
+ title: t("PENDING") || "Pending",
1941
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.pending) || 0
1942
+ }, {
1943
+ title: t("SUBMITTED") || "Submitted",
1944
+ value: (dashboardInfo === null || dashboardInfo === void 0 ? void 0 : dashboardInfo.submittedCount) || 0
1945
+ }].filter(item => isValDefined(item.value))
1946
+ }];
1947
+ const mappedRows = rows.map(row => {
1948
+ var _row$owner, _row$owner2;
1949
+ return {
1950
+ kno: row.name || ((_row$owner = row.owner) === null || _row$owner === void 0 ? void 0 : _row$owner.name) || "N/A",
1951
+ firstName: ((_row$owner2 = row.owner) === null || _row$owner2 === void 0 ? void 0 : _row$owner2.mobileNumber) || row.mobileNo || "N/A",
1952
+ lastName: "",
1953
+ mobileNo: row.status || "N/A",
1954
+ zoneName: String(row.total || 0),
1955
+ ekycStatus: (row.completed || 0) + " / " + (row.pending || 0),
1956
+ submittedAt: 1717171717171,
1957
+ progress: row.progress || "0%"
1958
+ };
1959
+ });
1960
+ const originalToLocaleDateString = Date.prototype.toLocaleDateString;
1961
+ let progressIndex = 0;
1962
+ Date.prototype.toLocaleDateString = function () {
1963
+ if (progressIndex < mappedRows.length) {
1964
+ return mappedRows[progressIndex++].progress || "0%";
1965
+ }
1966
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1967
+ args[_key] = arguments[_key];
1968
+ }
1969
+ return originalToLocaleDateString.apply(this, args);
1970
+ };
1971
+ const customT = key => {
1972
+ if (key === "KNO") return t("SURVEYOR_NAME") || "Surveyor Name";
1973
+ if (key === "CONSUMER") return t("MOBILE_NUMBER") || "Mobile Number";
1974
+ if (key === "MOBILE") return t("STATUS") || "Status";
1975
+ if (key === "ZONE") return t("TOTAL_EKYC_APPLICATIONS") || "Total eKYC Applications";
1976
+ if (key === "EKYC_STATUS") return t("COMPLETED_PENDING") || "Completed / Pending";
1977
+ if (key === "SUBMITTED_DATE") return t("OVERALL_PROGRESS") || "Overall Progress";
1978
+ if (key === "CONSUMER_LIST") return t("CONNECTED_SURVEYORS") || "Connected Surveyors";
1979
+ return t(key);
1980
+ };
1981
+ try {
1982
+ if (window.Digit && window.Digit.Utils && window.Digit.Utils.pdf && window.Digit.Utils.pdf.generateSurveyorReport) {
1983
+ window.Digit.Utils.pdf.generateSurveyorReport({
1984
+ tenantId,
1985
+ logo: null,
1986
+ name,
1987
+ email,
1988
+ phoneNumber,
1989
+ heading: t("EKYC_SUPERVISOR_REPORT") || "eKYC Supervisor Report",
1990
+ details,
1991
+ applicationNumber: mobileNumber,
1992
+ rows: mappedRows,
1993
+ t: customT,
1994
+ hideApplicationNumber: true,
1995
+ downloadTime: downloadDateTime
1996
+ });
1997
+ } else {
1998
+ console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
1999
+ }
2000
+ } finally {
2001
+ Date.prototype.toLocaleDateString = originalToLocaleDateString;
2002
+ }
2003
+ return Promise.resolve();
2004
+ } catch (e) {
2005
+ return Promise.reject(e);
2006
+ }
2007
+ };
1707
2008
  const downloadVendorPDF = function (_ref3) {
1708
2009
  let rows = _ref3.rows,
1709
2010
  vendorName = _ref3.vendorName,
@@ -1929,6 +2230,10 @@ const VendorDetailsCard = () => {
1929
2230
  }
1930
2231
  return "N/A";
1931
2232
  }, [vendor]);
2233
+ const zoneIds = useMemo(() => {
2234
+ var _vendor$zoneIds;
2235
+ 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";
2236
+ }, [vendor]);
1932
2237
  const cards = useMemo(() => {
1933
2238
  const hasRealData = vendorSupervisors.some(s => s.totalKnos > 0);
1934
2239
  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;
@@ -1986,7 +2291,7 @@ const VendorDetailsCard = () => {
1986
2291
  alert(t("NO_EKYC_DATA_FOUND") || "No eKYC data found to download.");
1987
2292
  return;
1988
2293
  }
1989
- 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"];
2294
+ 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"];
1990
2295
  const headerMapping = {
1991
2296
  kno: t("KNO") || "KNO",
1992
2297
  firstName: t("FIRST_NAME") || "First Name",
@@ -2311,9 +2616,9 @@ const VendorDetailsCard = () => {
2311
2616
  className: "detail-item"
2312
2617
  }, /*#__PURE__*/React.createElement("span", {
2313
2618
  className: "label"
2314
- }, t("JURISDICTIONS") || "Jurisdictions"), /*#__PURE__*/React.createElement("span", {
2619
+ }, t("ASSIGNED_ZONES") || "Assigned Zones"), /*#__PURE__*/React.createElement("span", {
2315
2620
  className: "value"
2316
- }, jurisdictions)))), /*#__PURE__*/React.createElement("div", {
2621
+ }, zoneIds)))), /*#__PURE__*/React.createElement("div", {
2317
2622
  className: "details-right"
2318
2623
  }, /*#__PURE__*/React.createElement("div", {
2319
2624
  className: "download-card"
@@ -2391,6 +2696,10 @@ const useInboxTableConfig = _ref => {
2391
2696
  tableStyle = _ref$tableStyle === void 0 ? {} : _ref$tableStyle;
2392
2697
  const _useTranslation = useTranslation(),
2393
2698
  t = _useTranslation.t;
2699
+ const toTitleCase = str => {
2700
+ if (!str) return "";
2701
+ return String(str).toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
2702
+ };
2394
2703
  const history = useHistory();
2395
2704
  const _useState = useState(""),
2396
2705
  selectedKno = _useState[0],
@@ -2434,18 +2743,18 @@ const useInboxTableConfig = _ref => {
2434
2743
  Cell: _ref3 => {
2435
2744
  var _row$original3;
2436
2745
  let row = _ref3.row;
2437
- return /*#__PURE__*/React.createElement("span", null, ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
2746
+ return /*#__PURE__*/React.createElement("span", null, toTitleCase((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.citizenName) || "NA");
2438
2747
  }
2439
2748
  }, {
2440
2749
  Header: t("EKYC_STATUS"),
2441
2750
  accessor: "actionStatus",
2442
2751
  Cell: _ref4 => {
2443
- var _row$original4;
2752
+ var _row$original4, _row$original5;
2444
2753
  let row = _ref4.row;
2445
2754
  const status = (((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.status) || "DEFAULT").toUpperCase();
2446
2755
  return /*#__PURE__*/React.createElement("span", {
2447
2756
  className: "ekyc-status-tag " + status
2448
- }, t("" + status));
2757
+ }, toTitleCase(((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status) || "DEFAULT"));
2449
2758
  }
2450
2759
  }, {
2451
2760
  Header: t("SUBMITTED_AT") || "Submitted At",
@@ -2465,12 +2774,13 @@ const useInboxTableConfig = _ref => {
2465
2774
  Header: t("EKYC_EKYC_STATUS"),
2466
2775
  accessor: "ekycStatus",
2467
2776
  Cell: _ref7 => {
2468
- var _row$original5, _row$original6;
2777
+ var _row$original6, _row$original7;
2469
2778
  let row = _ref7.row;
2470
- const ekycStatus = (((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.ekycStatus) || ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.ekycstatus) || "NA").toUpperCase();
2779
+ 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";
2780
+ const ekycStatus = raw.toUpperCase();
2471
2781
  return /*#__PURE__*/React.createElement("span", {
2472
2782
  className: "ekyc-status-tag " + ekycStatus
2473
- }, t("" + ekycStatus));
2783
+ }, toTitleCase(raw));
2474
2784
  }
2475
2785
  }];
2476
2786
  return {
@@ -2819,7 +3129,9 @@ const SearchFormFieldsComponents = _ref => {
2819
3129
  const useInboxMobileCardsData = _ref => {
2820
3130
  var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
2821
3131
  let table = _ref.table,
2822
- tenantId = _ref.tenantId;
3132
+ tenantId = _ref.tenantId,
3133
+ _ref$isSupervisor = _ref.isSupervisor,
3134
+ isSupervisor = _ref$isSupervisor === void 0 ? false : _ref$isSupervisor;
2823
3135
  const _useTranslation = useTranslation(),
2824
3136
  t = _useTranslation.t;
2825
3137
  const history = useHistory();
@@ -2831,38 +3143,58 @@ const useInboxMobileCardsData = _ref => {
2831
3143
  getReview = _Digit$Hooks$ekyc$use.getReview;
2832
3144
  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";
2833
3145
  React.useEffect(() => {
2834
- if (reviewData) {
3146
+ if (!isSupervisor && reviewData) {
2835
3147
  history.push("/digit-ui/" + userType + "/ekyc/review/" + selectedKno, {
2836
3148
  aadhaarData: reviewData === null || reviewData === void 0 ? void 0 : reviewData.aadhaarData,
2837
3149
  reviewData
2838
3150
  });
2839
3151
  }
2840
- }, [reviewData]);
3152
+ }, [reviewData, isSupervisor]);
2841
3153
  const handleReview = kno => {
2842
3154
  setSelectedKno(kno);
2843
3155
  getReview({
2844
3156
  kno
2845
3157
  });
2846
3158
  };
3159
+ const handleSupervisorReview = id => {
3160
+ history.push("/digit-ui/" + userType + "/ekyc/assign/surveyor-details/" + id);
3161
+ };
2847
3162
  const dataForMobileInboxCards = table === null || table === void 0 ? void 0 : table.map(item => {
2848
- const kno = item.kno || item.applicationNumber || "NA";
2849
- const status = (item.status || "DEFAULT").toUpperCase();
2850
- const ekycStatus = (item.ekycStatus || item.ekycstatus || "NA").toUpperCase();
2851
- return {
2852
- [t("EKYC_APPLICATION_NO")]: /*#__PURE__*/React.createElement("span", {
2853
- className: "link",
2854
- onClick: () => handleReview(kno)
2855
- }, kno),
2856
- [t("EKYC_CITIZEN_NAME")]: item.citizenName || "NA",
2857
- [t("EKYC_STATUS")]: /*#__PURE__*/React.createElement("span", {
2858
- className: "ekyc-status-tag " + status
2859
- }, t("" + status)),
2860
- [t("SUBMITTED_AT")]: item.submittedAt ? Digit.DateUtils.ConvertEpochToDate(item.submittedAt) : "-",
2861
- [t("ASSIGNED_AT")]: item.assignedAt ? Digit.DateUtils.ConvertEpochToDate(item.assignedAt) : "-",
2862
- [t("EKYC_EKYC_STATUS")]: /*#__PURE__*/React.createElement("span", {
2863
- className: "ekyc-status-tag " + ekycStatus
2864
- }, t("" + ekycStatus))
2865
- };
3163
+ if (isSupervisor) {
3164
+ var _item$owner;
3165
+ const id = item.id;
3166
+ const status = item.status || "DEFAULT";
3167
+ return {
3168
+ [t("SURVEYOR_NAME")]: /*#__PURE__*/React.createElement("span", {
3169
+ className: "link",
3170
+ onClick: () => handleSupervisorReview(id)
3171
+ }, item.surveyorName || item.name || "NA"),
3172
+ [t("MOBILE_NUMBER")]: item.mobileNo || ((_item$owner = item.owner) === null || _item$owner === void 0 ? void 0 : _item$owner.mobileNumber) || "NA",
3173
+ [t("STATUS")]: /*#__PURE__*/React.createElement("span", {
3174
+ className: "ekyc-status-tag " + status
3175
+ }, t(status)),
3176
+ [t("SERVICE_TYPE")]: item.serviceType || "NA"
3177
+ };
3178
+ } else {
3179
+ const kno = item.kno || item.applicationNumber || "NA";
3180
+ const status = (item.status || "DEFAULT").toUpperCase();
3181
+ const ekycStatus = (item.ekycStatus || item.ekycstatus || "NA").toUpperCase();
3182
+ return {
3183
+ [t("EKYC_APPLICATION_NO")]: /*#__PURE__*/React.createElement("span", {
3184
+ className: "link",
3185
+ onClick: () => handleReview(kno)
3186
+ }, kno),
3187
+ [t("EKYC_CITIZEN_NAME")]: item.citizenName || "NA",
3188
+ [t("EKYC_STATUS")]: /*#__PURE__*/React.createElement("span", {
3189
+ className: "ekyc-status-tag " + status
3190
+ }, t("" + status)),
3191
+ [t("SUBMITTED_AT")]: item.submittedAt ? Digit.DateUtils.ConvertEpochToDate(item.submittedAt) : "-",
3192
+ [t("ASSIGNED_AT")]: item.assignedAt ? Digit.DateUtils.ConvertEpochToDate(item.assignedAt) : "-",
3193
+ [t("EKYC_EKYC_STATUS")]: /*#__PURE__*/React.createElement("span", {
3194
+ className: "ekyc-status-tag " + ekycStatus
3195
+ }, t("" + ekycStatus))
3196
+ };
3197
+ }
2866
3198
  });
2867
3199
  const MobileSortFormValues = () => {
2868
3200
  const sortOrderOptions = [{
@@ -2897,7 +3229,7 @@ const useInboxMobileCardsData = _ref => {
2897
3229
  isTwoDynamicPrefix: true,
2898
3230
  getRedirectionLink: () => {},
2899
3231
  handleClickEnabled: false,
2900
- serviceRequestIdKey: "applicationNo",
3232
+ serviceRequestIdKey: isSupervisor ? "id" : "applicationNo",
2901
3233
  MobileSortFormValues
2902
3234
  };
2903
3235
  };
@@ -3159,7 +3491,9 @@ const Inbox = _ref => {
3159
3491
  propsForInboxTable,
3160
3492
  propsForInboxMobileCards,
3161
3493
  formState,
3162
- countData: listData
3494
+ countData: listData,
3495
+ forceTable: true,
3496
+ showSearchOnMobile: true
3163
3497
  })));
3164
3498
  };
3165
3499
 
@@ -5648,70 +5982,6 @@ const SupervisorInboxTableConfig = _ref => {
5648
5982
  };
5649
5983
  };
5650
5984
 
5651
- const useSupervisorInboxMobileCardsData = _ref => {
5652
- var _Digit$SessionStorage, _Digit$SessionStorage2, _Digit$SessionStorage3;
5653
- let table = _ref.table;
5654
- const _useTranslation = useTranslation(),
5655
- t = _useTranslation.t;
5656
- const history = useHistory();
5657
- 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";
5658
- const handleReview = id => {
5659
- history.push("/digit-ui/" + userType + "/ekyc/assign/surveyor-details/" + id);
5660
- };
5661
- const dataForMobileInboxCards = table === null || table === void 0 ? void 0 : table.map(item => {
5662
- var _item$owner;
5663
- const id = item.id;
5664
- const status = item.status || "DEFAULT";
5665
- return {
5666
- [t("SURVEYOR_NAME")]: /*#__PURE__*/React.createElement("span", {
5667
- className: "link",
5668
- onClick: () => handleReview(id)
5669
- }, item.surveyorName || item.name || "NA"),
5670
- [t("MOBILE_NUMBER")]: item.mobileNo || ((_item$owner = item.owner) === null || _item$owner === void 0 ? void 0 : _item$owner.mobileNumber) || "NA",
5671
- [t("STATUS")]: /*#__PURE__*/React.createElement("span", {
5672
- className: "ekyc-status-tag " + status
5673
- }, t(status)),
5674
- [t("SERVICE_TYPE")]: item.serviceType || "NA"
5675
- };
5676
- });
5677
- const MobileSortFormValues = () => {
5678
- const sortOrderOptions = [{
5679
- code: "DESC",
5680
- i18nKey: "ES_INBOX_DATE_LATEST_FIRST"
5681
- }, {
5682
- code: "ASC",
5683
- i18nKey: "ES_INBOX_DATE_LATEST_LAST"
5684
- }];
5685
- const _useFormContext = useFormContext(),
5686
- controlSortForm = _useFormContext.control;
5687
- return /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement(Controller, {
5688
- name: "sortOrder",
5689
- control: controlSortForm,
5690
- render: _ref2 => {
5691
- let onChange = _ref2.onChange,
5692
- value = _ref2.value;
5693
- return /*#__PURE__*/React.createElement(RadioButtons, {
5694
- onSelect: e => {
5695
- onChange(e.code);
5696
- },
5697
- selectedOption: sortOrderOptions.filter(option => option.code === value)[0],
5698
- optionsKey: "i18nKey",
5699
- name: "sortOrder",
5700
- options: sortOrderOptions
5701
- });
5702
- }
5703
- }));
5704
- };
5705
- return {
5706
- data: dataForMobileInboxCards,
5707
- isTwoDynamicPrefix: true,
5708
- getRedirectionLink: () => {},
5709
- handleClickEnabled: false,
5710
- serviceRequestIdKey: "id",
5711
- MobileSortFormValues
5712
- };
5713
- };
5714
-
5715
5985
  const AssignEkyc = () => {
5716
5986
  var _formState$tableForm, _formState$tableForm2, _formState$tableForm3, _formState$tableForm4, _formState$searchForm, _dashboardData$dashbo;
5717
5987
  let tenantId = Digit.ULBService.getCurrentTenantId();
@@ -5890,8 +6160,9 @@ const AssignEkyc = () => {
5890
6160
  sortFormDefaultValues: formState === null || formState === void 0 ? void 0 : formState.tableForm,
5891
6161
  onSortFormReset
5892
6162
  };
5893
- const propsForInboxMobileCards = useSupervisorInboxMobileCardsData({
5894
- table: filteredData
6163
+ const propsForInboxMobileCards = useInboxMobileCardsData({
6164
+ table: filteredData,
6165
+ isSupervisor: true
5895
6166
  });
5896
6167
  return /*#__PURE__*/React.createElement("div", {
5897
6168
  className: "app-container"
@@ -5902,12 +6173,14 @@ const AssignEkyc = () => {
5902
6173
  propsForInboxMobileCards,
5903
6174
  formState,
5904
6175
  countData: dashboardData === null || dashboardData === void 0 ? void 0 : dashboardData.dashboardInfo,
5905
- isCardLoading: isDataSearchLoading
6176
+ isCardLoading: isDataSearchLoading,
6177
+ showSearchOnMobile: true,
6178
+ forceTable: true
5906
6179
  })));
5907
6180
  };
5908
6181
 
5909
6182
  const AdminDashboard = () => {
5910
- var _Digit$SessionStorage, _loggedInUser$roles, _fullName$charAt;
6183
+ var _Digit$SessionStorage;
5911
6184
  const _useTranslation = useTranslation(),
5912
6185
  t = _useTranslation.t;
5913
6186
  const history = useHistory();
@@ -5916,177 +6189,55 @@ const AdminDashboard = () => {
5916
6189
  tenantId = "dl.djb";
5917
6190
  }
5918
6191
  const loggedInUser = (_Digit$SessionStorage = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage === void 0 ? void 0 : _Digit$SessionStorage.info;
5919
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
5920
- status: "ACTIVE"
5921
- }, {
5922
- enabled: !!tenantId
5923
- }),
5924
- vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
5925
- isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
5926
- const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
5927
- enabled: !!tenantId,
5928
- keepPreviousData: true
5929
- }),
5930
- progressData = _Digit$Hooks$ekyc$use.data,
5931
- isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
5932
- const vendorsList = useMemo(() => {
5933
- if (vendorSearchResponse && vendorSearchResponse.length > 0) {
5934
- return vendorSearchResponse.map(v => {
5935
- var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
5936
- const dso = v.dsoDetails || v;
5937
- const supervisorsList = dso.supervisors || [];
5938
- const surveyorsList = dso.surveyors || [];
5939
- const supervisorIds = supervisorsList.map(s => {
5940
- var _s$owner;
5941
- return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
5942
- }).filter(Boolean);
5943
- 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))) || [];
5944
- const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
5945
- const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
5946
- const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
5947
- const progress = total > 0 ? Math.round(completed / total * 100) : 0;
5948
- const rejected = 0;
5949
- return {
5950
- id: dso.id || dso.vendorId || v.id || v.vendorId,
5951
- name: dso.name || dso.displayName || v.name || "N/A",
5952
- 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",
5953
- mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
5954
- supervisors: supervisorsList.length,
5955
- surveyors: surveyorsList.length,
5956
- completed: completed,
5957
- progress: progress,
5958
- pending: pending,
5959
- rejected: rejected
5960
- };
5961
- });
5962
- }
5963
- return [];
5964
- }, [vendorSearchResponse, progressData]);
5965
- const _useState = useState(false),
5966
- ekycDownloadLoading = _useState[0],
5967
- setEkycDownloadLoading = _useState[1];
5968
- const _useState2 = useState(0),
5969
- currentPage = _useState2[0];
5970
- const _useState3 = useState(20),
5971
- pageSize = _useState3[0];
5972
- const _Digit$Hooks$ekyc$use2 = Digit.Hooks.ekyc.useEkycApplicationList({}, {
5973
- tenantId,
5974
- offset: currentPage * pageSize,
5975
- limit: pageSize
5976
- }, {
5977
- keepPreviousData: true
5978
- });
5979
- const fullName = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || "Admin";
5980
- const mobileNumber = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || "N/A";
5981
- 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";
5982
- const handleDownloadEkycData = function () {
5983
- try {
5984
- setEkycDownloadLoading(true);
5985
- return Promise.resolve(_finallyRethrows(function () {
5986
- return _catch(function () {
5987
- return Promise.resolve(Digit.EkycService.application_list({
5988
- tenantId: tenantId,
5989
- offset: 0,
5990
- limit: 10000,
5991
- reportDownload: true
5992
- })).then(function (response) {
5993
- const consumerList = (response === null || response === void 0 ? void 0 : response.consumerList) || [];
5994
- if (consumerList.length === 0) {
5995
- alert(t("NO_DATA_FOUND") || "No data found for download.");
5996
- return;
5997
- }
5998
- 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"];
5999
- const headerMapping = {
6000
- kno: t("KNO") || "KNO",
6001
- firstName: t("FIRST_NAME") || "First Name",
6002
- middleName: t("MIDDLE_NAME") || "Middle Name",
6003
- lastName: t("LAST_NAME") || "Last Name",
6004
- gender: t("GENDER") || "Gender",
6005
- mobileNumber: t("MOBILE_NUMBER") || "Mobile Number",
6006
- emailId: t("EMAIL_ID") || "Email ID",
6007
- fatherOrHusbandName: t("FATHER_HUSBUND_NAME") || "Father/Husband Name",
6008
- relationship: t("RELATIONSHIP") || "Relationship",
6009
- dob: t("DOB") || "Date of Birth",
6010
- ekycStatus: t("EKYC_STATUS") || "eKYC Status",
6011
- zoneName: t("ZONE") || "Zone",
6012
- assembly: t("ASSEMBLY") || "Assembly",
6013
- ward: t("WARD") || "Ward",
6014
- pincode: t("PINCODE") || "Pincode",
6015
- mrkey: t("MR_KEY") || "MR Key",
6016
- createdTime: t("CREATED_TIME") || "Created Time",
6017
- lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
6018
- };
6019
- const excelData = consumerList.map(item => {
6020
- const cleanObj = {};
6021
- const name = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6022
- if (name) {
6023
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = name;
6024
- }
6025
- Object.keys(item).forEach(key => {
6026
- if (excludedKeys.includes(key)) return;
6027
- const val = item[key];
6028
- if (typeof val === "object" && val !== null) {
6029
- return;
6030
- }
6031
- const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6032
- cleanObj[friendlyHeader] = val;
6033
- });
6034
- return cleanObj;
6035
- });
6036
- const cleanFileName = "eKYC_All_Data_Admin_" + fullName.replace(/[^a-zA-Z0-9]/g, "_");
6037
- Digit.Download.Excel(excelData, cleanFileName);
6038
- });
6039
- }, function (error) {
6040
- console.error("Error downloading eKYC Excel:", error);
6041
- });
6042
- }, function (_wasThrown, _result) {
6043
- setEkycDownloadLoading(false);
6044
- if (_wasThrown) throw _result;
6045
- return _result;
6046
- }));
6047
- } catch (e) {
6048
- return Promise.reject(e);
6192
+ const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
6193
+ status: "ACTIVE"
6194
+ }, {
6195
+ enabled: !!tenantId
6196
+ }),
6197
+ vendorSearchResponse = _Digit$Hooks$fsm$useD.data,
6198
+ isVendorSearchLoading = _Digit$Hooks$fsm$useD.isLoading;
6199
+ const _Digit$Hooks$ekyc$use = Digit.Hooks.ekyc.useEkycAssignmentProgress({
6200
+ enabled: !!tenantId,
6201
+ keepPreviousData: true
6202
+ }),
6203
+ progressData = _Digit$Hooks$ekyc$use.data,
6204
+ isProgressLoading = _Digit$Hooks$ekyc$use.isLoading;
6205
+ const vendorsList = useMemo(() => {
6206
+ if (vendorSearchResponse && vendorSearchResponse.length > 0) {
6207
+ return vendorSearchResponse.map(v => {
6208
+ var _progressData$supervi, _dso$owner, _v$owner, _dso$owner2;
6209
+ const dso = v.dsoDetails || v;
6210
+ const supervisorsList = dso.supervisors || [];
6211
+ const surveyorsList = dso.surveyors || [];
6212
+ const supervisorIds = supervisorsList.map(s => {
6213
+ var _s$owner;
6214
+ return s.id || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : _s$owner.uuid);
6215
+ }).filter(Boolean);
6216
+ 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))) || [];
6217
+ const completed = matchedReports.reduce((acc, r) => acc + (r.submittedKnos || 0), 0);
6218
+ const pending = matchedReports.reduce((acc, r) => acc + (r.pendingKnos || 0), 0);
6219
+ const total = matchedReports.reduce((acc, r) => acc + (r.totalKnos || 0), 0);
6220
+ const progress = total > 0 ? Math.round(completed / total * 100) : 0;
6221
+ const rejected = 0;
6222
+ return {
6223
+ id: dso.id || dso.vendorId || v.id || v.vendorId,
6224
+ name: dso.name || dso.displayName || v.name || "N/A",
6225
+ 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",
6226
+ mobileNumber: dso.mobileNumber || ((_dso$owner2 = dso.owner) === null || _dso$owner2 === void 0 ? void 0 : _dso$owner2.mobileNumber) || v.mobileNumber || "N/A",
6227
+ supervisors: supervisorsList.length,
6228
+ surveyors: surveyorsList.length,
6229
+ completed: completed,
6230
+ progress: progress,
6231
+ pending: pending,
6232
+ rejected: rejected
6233
+ };
6234
+ });
6049
6235
  }
6050
- };
6236
+ return [];
6237
+ }, [vendorSearchResponse, progressData]);
6051
6238
  return /*#__PURE__*/React.createElement(Card, {
6052
6239
  className: "surveyor-dashboard"
6053
- }, /*#__PURE__*/React.createElement("div", {
6054
- className: "ekyc-dashboard-section"
6055
- }, /*#__PURE__*/React.createElement("div", {
6056
- className: "ekyc-dashboard-header"
6057
- }, /*#__PURE__*/React.createElement("div", {
6058
- className: "avatar"
6059
- }, fullName === null || fullName === void 0 ? void 0 : (_fullName$charAt = fullName.charAt(0)) === null || _fullName$charAt === void 0 ? void 0 : _fullName$charAt.toUpperCase()), /*#__PURE__*/React.createElement("div", {
6060
- className: "header-content"
6061
- }, /*#__PURE__*/React.createElement("h2", {
6062
- className: "name"
6063
- }, fullName), /*#__PURE__*/React.createElement("div", {
6064
- className: "designation"
6065
- }, t("EKYC_ADMIN") || "eKYC Admin / Manager"), /*#__PURE__*/React.createElement("div", {
6066
- className: "mobile-number"
6067
- }, mobileNumber))), /*#__PURE__*/React.createElement("button", {
6068
- className: "download-excel-btn",
6069
- disabled: ekycDownloadLoading,
6070
- onClick: handleDownloadEkycData
6071
- }, /*#__PURE__*/React.createElement("svg", {
6072
- width: "16",
6073
- height: "16",
6074
- viewBox: "0 0 24 24",
6075
- fill: "none",
6076
- stroke: "currentColor",
6077
- strokeWidth: "2.5",
6078
- strokeLinecap: "round",
6079
- strokeLinejoin: "round"
6080
- }, /*#__PURE__*/React.createElement("path", {
6081
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
6082
- }), /*#__PURE__*/React.createElement("polyline", {
6083
- points: "7 10 12 15 17 10"
6084
- }), /*#__PURE__*/React.createElement("line", {
6085
- x1: "12",
6086
- y1: "15",
6087
- x2: "12",
6088
- y2: "3"
6089
- })), ekycDownloadLoading ? t("DOWNLOADING") || "Downloading..." : t("DOWNLOAD_EXCEL") || "Download Excel")), /*#__PURE__*/React.createElement("div", {
6240
+ }, /*#__PURE__*/React.createElement(Dashboard, null), /*#__PURE__*/React.createElement("div", {
6090
6241
  className: "admin-performance-section"
6091
6242
  }, /*#__PURE__*/React.createElement("h3", {
6092
6243
  className: "section-title"
@@ -6374,7 +6525,8 @@ const SupervisorDetailsCard = () => {
6374
6525
  showCustomPicker = _useState6[0],
6375
6526
  setShowCustomPicker = _useState6[1];
6376
6527
  const _useState7 = useState(false),
6377
- reportLoading = _useState7[0];
6528
+ reportLoading = _useState7[0],
6529
+ setReportLoading = _useState7[1];
6378
6530
  const reportMenuRef = useRef(null);
6379
6531
  useEffect(() => {
6380
6532
  const handler = e => {
@@ -6386,6 +6538,42 @@ const SupervisorDetailsCard = () => {
6386
6538
  document.addEventListener("mousedown", handler);
6387
6539
  return () => document.removeEventListener("mousedown", handler);
6388
6540
  }, []);
6541
+ const handleDownload = () => {
6542
+ setReportLoading(true);
6543
+ try {
6544
+ const rowsWithStats = surveyors.map(s => ({
6545
+ name: s.surveyorName,
6546
+ mobileNo: s.mobileNo,
6547
+ status: s.status,
6548
+ total: s.totalKnos,
6549
+ completed: s.submittedKnos,
6550
+ pending: s.pendingKnos,
6551
+ progress: s.progressPercent + "%"
6552
+ }));
6553
+ const totalKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.totalKnos) || 0;
6554
+ const completedKnos = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.submittedKnos) || 0;
6555
+ downloadSupervisorPDF({
6556
+ rows: rowsWithStats,
6557
+ supervisorName: fullName,
6558
+ vendorName,
6559
+ mobileNumber,
6560
+ email,
6561
+ dashboardInfo: {
6562
+ total: totalKnos,
6563
+ completed: completedKnos,
6564
+ pending: totalKnos - completedKnos,
6565
+ submittedCount: completedKnos
6566
+ },
6567
+ t
6568
+ });
6569
+ } catch (err) {
6570
+ console.error("Failed to generate supervisor report:", err);
6571
+ } finally {
6572
+ setReportLoading(false);
6573
+ setShowReportMenu(false);
6574
+ setShowCustomPicker(false);
6575
+ }
6576
+ };
6389
6577
  const handlePresetDownload = filter => {
6390
6578
  handleDownload();
6391
6579
  };
@@ -6441,14 +6629,21 @@ const SupervisorDetailsCard = () => {
6441
6629
  ward: t("WARD") || "Ward",
6442
6630
  pincode: t("PINCODE") || "Pincode",
6443
6631
  mrkey: t("MR_KEY") || "MR Key",
6632
+ consumerType: t("CONSUMER_TYPE") || "Consumer Type",
6444
6633
  createdTime: t("CREATED_TIME") || "Created Time",
6445
6634
  lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
6446
6635
  };
6636
+ const toTitleCase = str => {
6637
+ if (!str) return "";
6638
+ const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
6639
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
6640
+ };
6641
+ const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
6447
6642
  const excelData = consumerList.map(item => {
6448
6643
  const cleanObj = {};
6449
6644
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
6450
6645
  if (fullName) {
6451
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
6646
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
6452
6647
  }
6453
6648
  Object.keys(item).forEach(key => {
6454
6649
  if (excludedKeys.includes(key)) return;
@@ -6457,7 +6652,11 @@ const SupervisorDetailsCard = () => {
6457
6652
  return;
6458
6653
  }
6459
6654
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
6460
- cleanObj[friendlyHeader] = val;
6655
+ if (typeof val === "string" && titleCaseFields.includes(key)) {
6656
+ cleanObj[friendlyHeader] = toTitleCase(val);
6657
+ } else {
6658
+ cleanObj[friendlyHeader] = val;
6659
+ }
6461
6660
  });
6462
6661
  return cleanObj;
6463
6662
  });
@@ -7079,10 +7278,16 @@ const AssignEkycModal = _ref => {
7079
7278
  onChange: e => handleFilterChange("ward", e.target.value)
7080
7279
  }, /*#__PURE__*/React.createElement("option", {
7081
7280
  value: ""
7082
- }, "Select Ward"), wardOptions.map(ward => /*#__PURE__*/React.createElement("option", {
7083
- key: ward.code,
7084
- value: ward.name
7085
- }, ward.name))), /*#__PURE__*/React.createElement("select", {
7281
+ }, "Select Ward"), wardOptions.filter(ward => {
7282
+ const stripped = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
7283
+ return stripped.trim().length > 0;
7284
+ }).map(ward => {
7285
+ const displayName = ward.name.replace(/[0-9]/g, "").replace(/^[-\s]+|[-\s]+$/g, "");
7286
+ return /*#__PURE__*/React.createElement("option", {
7287
+ key: ward.code,
7288
+ value: ward.name
7289
+ }, displayName);
7290
+ })), /*#__PURE__*/React.createElement("select", {
7086
7291
  className: "form-control",
7087
7292
  value: filters.assembly,
7088
7293
  onChange: e => handleFilterChange("assembly", e.target.value)
@@ -7139,7 +7344,7 @@ const AssignEkycModal = _ref => {
7139
7344
  };
7140
7345
 
7141
7346
  const SurveyorDetailsDashboard = () => {
7142
- 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, _surveyor$additionalD, _dashboardData$dashbo5, _dashboardData$dashbo6;
7347
+ 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;
7143
7348
  const tenantId = Digit.ULBService.getCurrentTenantId();
7144
7349
  const _useState = useState(false),
7145
7350
  showModal = _useState[0],
@@ -7243,16 +7448,22 @@ const SurveyorDetailsDashboard = () => {
7243
7448
  _Digit$Hooks$ekyc$use2 = _Digit$Hooks$ekyc$use.data,
7244
7449
  dashboardData = _Digit$Hooks$ekyc$use2 === void 0 ? {} : _Digit$Hooks$ekyc$use2,
7245
7450
  refetchDashboard = _Digit$Hooks$ekyc$use.refetch;
7451
+ const toTitleCase = str => {
7452
+ if (!str) return "";
7453
+ const cleanStr = String(str).includes(".") ? String(str).split(".").pop() : String(str);
7454
+ return cleanStr.toLowerCase().replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
7455
+ };
7246
7456
  const knoColumns = useMemo(() => [{
7247
7457
  Header: t("KNO") || "KNO",
7248
7458
  accessor: "kno"
7249
7459
  }, {
7250
7460
  Header: t("CONSUMER_NAME") || "Consumer Name",
7251
- accessor: row => ((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim(),
7461
+ accessor: row => toTitleCase(((row.firstName || "") + " " + (row.middleName || "") + " " + (row.lastName || "")).trim()),
7252
7462
  id: "consumerName"
7253
7463
  }, {
7254
7464
  Header: t("ZONE") || "Zone",
7255
- accessor: "zoneName"
7465
+ accessor: row => toTitleCase(row.zoneName),
7466
+ id: "zoneName"
7256
7467
  }, {
7257
7468
  Header: t("EKYC_STATUS") || "eKYC Status",
7258
7469
  accessor: "ekycStatus",
@@ -7261,7 +7472,7 @@ const SurveyorDetailsDashboard = () => {
7261
7472
  const status = (value || "NA").toUpperCase();
7262
7473
  return value ? /*#__PURE__*/React.createElement("span", {
7263
7474
  className: "ekyc-status-tag " + status
7264
- }, t(status)) : "-";
7475
+ }, toTitleCase(value)) : "-";
7265
7476
  }
7266
7477
  }, {
7267
7478
  Header: t("SUBMITTED_AT") || "Submitted At",
@@ -7500,6 +7711,7 @@ const SurveyorDetailsDashboard = () => {
7500
7711
  ward: t("WARD") || "Ward",
7501
7712
  pincode: t("PINCODE") || "Pincode",
7502
7713
  mrkey: t("MR_KEY") || "MR Key",
7714
+ consumerType: t("CONSUMER_TYPE") || "Consumer Type",
7503
7715
  createdTime: t("CREATED_TIME") || "Created Time",
7504
7716
  lastModifiedTime: t("LAST_MODIFIED_TIME") || "Last Modified Time"
7505
7717
  };
@@ -7507,8 +7719,9 @@ const SurveyorDetailsDashboard = () => {
7507
7719
  const cleanObj = {};
7508
7720
  const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
7509
7721
  if (fullName) {
7510
- cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = fullName;
7722
+ cleanObj[t("CONSUMER_NAME") || "Consumer Name"] = toTitleCase(fullName);
7511
7723
  }
7724
+ const titleCaseFields = ["ekycStatus", "zoneName", "gender", "relationship", "assembly", "ward", "consumerType"];
7512
7725
  Object.keys(item).forEach(key => {
7513
7726
  if (excludedKeys.includes(key)) return;
7514
7727
  const val = item[key];
@@ -7516,7 +7729,11 @@ const SurveyorDetailsDashboard = () => {
7516
7729
  return;
7517
7730
  }
7518
7731
  const friendlyHeader = headerMapping[key] || t(key.toUpperCase()) || key;
7519
- cleanObj[friendlyHeader] = val;
7732
+ if (typeof val === "string" && titleCaseFields.includes(key)) {
7733
+ cleanObj[friendlyHeader] = toTitleCase(val);
7734
+ } else {
7735
+ cleanObj[friendlyHeader] = val;
7736
+ }
7520
7737
  });
7521
7738
  return cleanObj;
7522
7739
  });
@@ -7680,12 +7897,6 @@ const SurveyorDetailsDashboard = () => {
7680
7897
  className: "detail-item"
7681
7898
  }, /*#__PURE__*/React.createElement("span", {
7682
7899
  className: "label"
7683
- }, t("SERVICE_TYPE")), /*#__PURE__*/React.createElement("span", {
7684
- className: "value"
7685
- }, (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.createElement("div", {
7686
- className: "detail-item"
7687
- }, /*#__PURE__*/React.createElement("span", {
7688
- className: "label"
7689
7900
  }, t("VENDOR_NAME") || "Vendor Name"), /*#__PURE__*/React.createElement("span", {
7690
7901
  className: "value"
7691
7902
  }, vendorName)), /*#__PURE__*/React.createElement("div", {
@@ -9161,74 +9372,6 @@ const MeterDetails = _ref => {
9161
9372
  }));
9162
9373
  };
9163
9374
 
9164
- const Home = () => {
9165
- var _Digit$SessionStorage, _Digit$SessionStorage2;
9166
- const _useTranslation = useTranslation(),
9167
- t = _useTranslation.t;
9168
- const propsForModuleCard = {
9169
- moduleName: t("ACTION_TEST_EKYC"),
9170
- kpis: [{
9171
- count: "-",
9172
- label: t("TOTAL_EKYC"),
9173
- link: "/digit-ui/citizen/ekyc/dashboard"
9174
- }],
9175
- links: []
9176
- };
9177
- 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;
9178
- const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
9179
- if (roles.includes("EKYC_SURVEYOR")) {
9180
- propsForModuleCard.links.push({
9181
- label: t("SURVEYOR_DASHBOARD"),
9182
- link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
9183
- });
9184
- }
9185
- if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
9186
- propsForModuleCard.links.push({
9187
- label: t("EKYC_INBOX"),
9188
- link: "/digit-ui/citizen/ekyc/inbox"
9189
- });
9190
- }
9191
- if (roles.includes("EKYC_SUPERVISOR")) {
9192
- propsForModuleCard.links.push({
9193
- label: t("EKYC_SUPERVISOR_DASHBOARD"),
9194
- link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
9195
- }, {
9196
- label: t("EKYC_ASSIGN"),
9197
- link: "/digit-ui/citizen/ekyc/assign"
9198
- });
9199
- }
9200
- if (roles.includes("EKYC_VENDOR")) {
9201
- propsForModuleCard.links.push({
9202
- label: t("EKYC_VENDOR_DASHBOARD"),
9203
- link: "/digit-ui/citizen/ekyc/vendor-dashboard"
9204
- });
9205
- }
9206
- if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
9207
- propsForModuleCard.links.push({
9208
- label: t("TITLE_VENDOR_MANAGEMENT"),
9209
- link: "/digit-ui/citizen/vendor/search-vendor"
9210
- });
9211
- }
9212
- if (roles.length === 1 && roles.includes("CITIZEN")) {
9213
- propsForModuleCard.links.push({
9214
- label: t("EKYC_STATUS"),
9215
- link: "/digit-ui/citizen/ekyc/:id"
9216
- });
9217
- }
9218
- const formattedLinks = propsForModuleCard.links.map(l => ({
9219
- i18nKey: l.label,
9220
- link: l.link,
9221
- count: l.count
9222
- }));
9223
- return /*#__PURE__*/React.createElement(CitizenHomeCard, {
9224
- header: t("EKYC_MODULE_NAME"),
9225
- links: formattedLinks,
9226
- Icon: () => /*#__PURE__*/React.createElement(DocumentIcon, {
9227
- className: "fill-path-primary-main"
9228
- })
9229
- });
9230
- };
9231
-
9232
9375
  const Inbox$1 = _ref => {
9233
9376
  var _formState$tableForm3, _formState$tableForm4, _formState$searchForm3, _formState$searchForm4, _dashboardData$dashbo;
9234
9377
  let parentRoute = _ref.parentRoute;
@@ -9489,7 +9632,9 @@ const Inbox$1 = _ref => {
9489
9632
  }, propsForSearchForm, propsForMobileSortForm, {
9490
9633
  propsForInboxTable,
9491
9634
  propsForInboxMobileCards,
9492
- formState
9635
+ formState,
9636
+ forceTable: true,
9637
+ showSearchOnMobile: true
9493
9638
  })));
9494
9639
  };
9495
9640
 
@@ -9702,7 +9847,8 @@ const EkycStatus = () => {
9702
9847
  }, propsForSearchForm, {
9703
9848
  propsForInboxTable,
9704
9849
  propsForInboxMobileCards,
9705
- formState
9850
+ formState,
9851
+ showSearchOnMobile: true
9706
9852
  })))), errorMsg && /*#__PURE__*/React.createElement("div", {
9707
9853
  className: "ekyc-status-error-msg"
9708
9854
  }, errorMsg), isLoading && /*#__PURE__*/React.createElement(Loader, null), !isLoading && details && /*#__PURE__*/React.createElement(Card, {
@@ -9750,10 +9896,7 @@ const CitizenApp = () => {
9750
9896
  const location = useLocation();
9751
9897
  const _useRouteMatch = useRouteMatch(),
9752
9898
  path = _useRouteMatch.path;
9753
- const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
9754
- _Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
9755
- _Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
9756
- stateInfo = _Digit$Hooks$useStore3.stateInfo;
9899
+ const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData();
9757
9900
  sessionStorage.removeItem("revalidateddone");
9758
9901
  const getDynamicBreadcrumbs = () => {
9759
9902
  const pathname = location.pathname;
@@ -9832,44 +9975,23 @@ const CitizenApp = () => {
9832
9975
  }
9833
9976
  return crumbs;
9834
9977
  };
9835
- const isEkycHome = location.pathname === "/digit-ui/citizen/ekyc" || location.pathname === "/digit-ui/citizen/ekyc/";
9836
- if (isEkycHome) {
9837
- const isMobile = window.Digit.Utils.browser.isMobile();
9838
- return (
9839
- /*#__PURE__*/
9840
- React.createElement("div", {
9841
- className: "moduleLinkHomePage"
9842
- }, /*#__PURE__*/React.createElement("div", {
9843
- style: {
9844
- position: "relative"
9845
- }
9846
- }, /*#__PURE__*/React.createElement("img", {
9847
- src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
9848
- alt: "noimagefound"
9849
- }), /*#__PURE__*/React.createElement(BackButton, {
9850
- className: "moduleLinkHomePageBackButton"
9851
- }), /*#__PURE__*/React.createElement("div", {
9852
- className: "moduleTitle"
9853
- }, isMobile ? /*#__PURE__*/React.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React.createElement("div", {
9854
- className: "moduleLinkHomePageModuleLinks"
9855
- }, /*#__PURE__*/React.createElement(Home, null)))
9856
- );
9857
- }
9858
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9859
- className: "ground-container form-container"
9978
+ return /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement("div", {
9979
+ className: "ground-container form-container",
9980
+ style: {
9981
+ flex: 1
9982
+ }
9860
9983
  }, /*#__PURE__*/React.createElement(ModuleHeader, {
9861
9984
  leftContent: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ArrowLeft, {
9862
9985
  className: "icon"
9863
9986
  }), t("CS_COMMON_BACK")),
9864
9987
  onLeftClick: () => window.history.back(),
9865
9988
  breadcrumbs: getDynamicBreadcrumbs()
9866
- }), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
9989
+ }), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
9867
9990
  exact: true,
9868
- path: "" + path,
9869
- component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
9870
- layoutClass: "normal"
9871
- }, /*#__PURE__*/React.createElement(Home, null))
9872
- }), /*#__PURE__*/React.createElement(PrivateRoute, {
9991
+ path: "" + path
9992
+ }, /*#__PURE__*/React.createElement(Redirect, {
9993
+ to: "/digit-ui/citizen/ekyc-home"
9994
+ })), /*#__PURE__*/React.createElement(PrivateRoute, {
9873
9995
  path: [path + "/vendor-dashboard/:vendorId", path + "/vendor-dashboard"],
9874
9996
  component: () => /*#__PURE__*/React.createElement(LayoutWrapper, {
9875
9997
  layoutClass: "normal"
@@ -9975,19 +10097,61 @@ const EkycModule = _ref => {
9975
10097
  } else return /*#__PURE__*/React.createElement(CitizenApp, null);
9976
10098
  };
9977
10099
  const EkycLinks = _ref2 => {
9978
- let matchPath = _ref2.matchPath;
10100
+ var _Digit$SessionStorage, _Digit$SessionStorage2;
9979
10101
  const _useTranslation = useTranslation(),
9980
10102
  t = _useTranslation.t;
9981
- const links = [{
9982
- link: matchPath + "/create-kyc",
9983
- i18nKey: t("EKYC_CREATE_KYC")
9984
- }, {
9985
- link: matchPath + "/update-kyc",
9986
- i18nKey: t("EKYC_UPDATE_KYC")
9987
- }];
10103
+ const propsForModuleCard = {
10104
+ links: []
10105
+ };
10106
+ 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;
10107
+ const roles = Array.isArray(citizenInfo) ? citizenInfo.map(ele => ele.code) : [];
10108
+ if (roles.includes("EKYC_SURVEYOR")) {
10109
+ propsForModuleCard.links.push({
10110
+ label: t("SURVEYOR_DASHBOARD"),
10111
+ link: "/digit-ui/citizen/ekyc/surveyor-dashboard"
10112
+ });
10113
+ }
10114
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
10115
+ propsForModuleCard.links.push({
10116
+ label: t("EKYC_INBOX"),
10117
+ link: "/digit-ui/citizen/ekyc/inbox"
10118
+ });
10119
+ }
10120
+ if (roles.includes("EKYC_SUPERVISOR")) {
10121
+ propsForModuleCard.links.push({
10122
+ label: t("EKYC_SUPERVISOR_DASHBOARD"),
10123
+ link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
10124
+ }, {
10125
+ label: t("EKYC_ASSIGN"),
10126
+ link: "/digit-ui/citizen/ekyc/assign"
10127
+ });
10128
+ }
10129
+ if (roles.includes("EKYC_VENDOR")) {
10130
+ propsForModuleCard.links.push({
10131
+ label: t("EKYC_VENDOR_DASHBOARD"),
10132
+ link: "/digit-ui/citizen/ekyc/vendor-dashboard"
10133
+ });
10134
+ }
10135
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
10136
+ propsForModuleCard.links.push({
10137
+ label: t("TITLE_VENDOR_MANAGEMENT"),
10138
+ link: "/digit-ui/citizen/vendor/search-vendor"
10139
+ });
10140
+ }
10141
+ if (roles.length === 1 && roles.includes("CITIZEN")) {
10142
+ propsForModuleCard.links.push({
10143
+ label: t("EKYC_STATUS"),
10144
+ link: "/digit-ui/citizen/ekyc/:id"
10145
+ });
10146
+ }
10147
+ const formattedLinks = propsForModuleCard.links.map(l => ({
10148
+ i18nKey: l.label,
10149
+ link: l.link,
10150
+ count: l.count
10151
+ }));
9988
10152
  return /*#__PURE__*/React.createElement(CitizenHomeCard, {
9989
10153
  header: t("EKYC_MODULE_NAME"),
9990
- links: links,
10154
+ links: formattedLinks,
9991
10155
  Icon: () => /*#__PURE__*/React.createElement(DocumentIcon, {
9992
10156
  className: "fill-path-primary-main"
9993
10157
  })