@djb25/digit-ui-module-ekyc 1.0.8 → 1.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djb25/digit-ui-module-ekyc",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Digit UI Module for Ekyc",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
package/src/Module.js CHANGED
@@ -3,54 +3,65 @@ import { useTranslation } from "react-i18next";
3
3
  import { useRouteMatch } from "react-router-dom";
4
4
  import { CitizenHomeCard, DocumentIcon } from "@djb25/digit-ui-react-components";
5
5
  import EKYCCard from "./components/EKYCCard";
6
- import Inbox from "./pages/employee/Inbox";
6
+ import Inbox from "./pages/employee/Dashboard";
7
7
  import DesktopInbox from "./components/DesktopInbox";
8
8
  import MobileInbox from "./components/MobileInbox";
9
9
  import Filter from "./components/Filter";
10
10
  import EmployeeApp from "./pages/employee";
11
11
  import CitizenApp from "./pages/citizen";
12
-
12
+ import AadhaarVerification from "./pages/employee/AadhaarVerification";
13
+ import AddressDetails from "./pages/employee/AddressDetails";
14
+ import PropertyInfo from "./pages/employee/PropertyInfo";
15
+ import MeterDetails from "./pages/employee/MeterDetails";
13
16
  export const EkycModule = ({ stateCode, userType, tenants }) => {
14
- const { path, url } = useRouteMatch();
15
- const moduleCode = "EKYC";
16
- const language = Digit.StoreData.getCurrentLanguage();
17
- const { isLoading, data: store } = Digit.Services.useStore({ stateCode, moduleCode, language });
18
- Digit.SessionStorage.set("EKYC_TENANTS", tenants);
17
+ const { path, url } = useRouteMatch();
18
+ const moduleCode = "EKYC";
19
+ const language = Digit.StoreData.getCurrentLanguage();
20
+ const { isLoading, data: store } = Digit.Services.useStore({ stateCode, moduleCode, language });
21
+ Digit.SessionStorage.set("EKYC_TENANTS", tenants);
19
22
 
20
- if (isLoading) {
21
- return null;
22
- }
23
- if (userType === "employee") {
24
- return <EmployeeApp path={path} url={url} userType={userType} tenants={tenants} />;
25
- } else return <CitizenApp />;
23
+ if (isLoading) {
24
+ return null;
25
+ }
26
+ if (userType === "employee") {
27
+ return <EmployeeApp path={path} url={url} userType={userType} tenants={tenants} />;
28
+ } else return <CitizenApp />;
26
29
  };
27
30
 
28
31
  export const EkycLinks = ({ matchPath, userType }) => {
29
- const { t } = useTranslation();
30
- const links = [
31
- {
32
- link: `${matchPath}/create-kyc`,
33
- i18nKey: t("EKYC_CREATE_KYC"),
34
- },
35
- ];
32
+ const { t } = useTranslation();
33
+ const links = [
34
+ {
35
+ link: `${matchPath}/create-kyc`,
36
+ i18nKey: t("EKYC_CREATE_KYC"),
37
+ },
38
+ {
39
+ link: `${matchPath}/update-kyc`,
40
+ i18nKey: t("EKYC_UPDATE_KYC"),
41
+ },
42
+ ];
36
43
 
37
- return <CitizenHomeCard header={t("EKYC_MODULE_NAME")} links={links} Icon={() => <DocumentIcon className="fill-path-primary-main" />} />;
44
+ return <CitizenHomeCard header={t("EKYC_MODULE_NAME")} links={links} Icon={() => <DocumentIcon className="fill-path-primary-main" />} />;
38
45
  };
39
46
 
40
47
  const componentsToRegister = {
41
- EKYCModule: EkycModule,
42
- EKYCCard,
43
- EKYCInbox: Inbox,
44
- EKYCDesktopInbox: DesktopInbox,
45
- EKYCMobileInbox: MobileInbox,
46
- EKYC_INBOX_FILTER: (props) => <Filter {...props} />,
47
- EkycLinks,
48
+ EKYCModule: EkycModule,
49
+ EKYCCard,
50
+ EKYCInbox: Inbox,
51
+ EKYCDesktopInbox: DesktopInbox,
52
+ EKYCMobileInbox: MobileInbox,
53
+ EKYC_INBOX_FILTER: (props) => <Filter {...props} />,
54
+ EkycLinks,
55
+ AadhaarVerification,
56
+ AddressDetails,
57
+ PropertyInfo,
58
+ MeterDetails,
48
59
  };
49
60
 
50
61
  export const initEkycComponents = () => {
51
- Object.entries(componentsToRegister).forEach(([key, value]) => {
52
- Digit.ComponentRegistryService.setComponent(key, value);
53
- });
62
+ Object.entries(componentsToRegister).forEach(([key, value]) => {
63
+ Digit.ComponentRegistryService.setComponent(key, value);
64
+ });
54
65
  };
55
66
 
56
67
  export default EkycModule;
@@ -22,7 +22,7 @@ const ConnectionDetailsView = ({ kNumber, kName, connectionDetails, isLoading })
22
22
  const parentPath = path.includes("/create-kyc")
23
23
  ? path.replace("/create-kyc", "")
24
24
  : path.replace("/k-details", "");
25
- history.push(`${parentPath}/aadhaar-verification`, { kNumber, selectedOption, connectionDetails });
25
+ history.push(`${parentPath}/consumer-details`, { kNumber, selectedOption, connectionDetails });
26
26
  setShowModal(false);
27
27
  };
28
28
 
@@ -189,12 +189,13 @@ const ConnectionDetailsView = ({ kNumber, kName, connectionDetails, isLoading })
189
189
  </div>
190
190
 
191
191
  {/* Action Buttons */}
192
- <div className="action-btns-container">
192
+ <div className="action-btns-container" style={{ fontSize: "12px" }}>
193
193
  <button
194
194
  onClick={handleStartVerification}
195
195
  className="primary-action-btn"
196
+ style={{ fontSize: "12px" }}
196
197
  >
197
- {t("EKYC_START_VERIFICATION") || "Start Verification"}
198
+ {t("EKYC_START_REVIEW") || "Start Review"}
198
199
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
199
200
  <line x1="5" y1="12" x2="19" y2="12" />
200
201
  <polyline points="12 5 19 12 12 19" />
@@ -222,6 +223,7 @@ const ConnectionDetailsView = ({ kNumber, kName, connectionDetails, isLoading })
222
223
  >
223
224
  <div style={{ padding: "24px" }}>
224
225
  <RadioButtons
226
+ name="verificationType"
225
227
  options={options}
226
228
  optionsKey="name"
227
229
  selectedOption={selectedOption}
@@ -1,7 +1,7 @@
1
1
  import React, { useMemo, useState } from "react";
2
2
  import { useTranslation } from "react-i18next";
3
- import { Table, SubmitBar, Header, Card, HomeIcon, PersonIcon, Modal, Loader } from "@djb25/digit-ui-react-components";
4
- import { Link } from "react-router-dom";
3
+ import { Table, Card, Loader, InboxLinks } from "@djb25/digit-ui-react-components";
4
+ import { useHistory } from "react-router-dom";
5
5
  import StatusCards from "./StatusCards";
6
6
 
7
7
  const DesktopInbox = ({ tableConfig, filterComponent, ...props }) => {
@@ -19,137 +19,27 @@ const DesktopInbox = ({ tableConfig, filterComponent, ...props }) => {
19
19
  sortParams,
20
20
  totalRecords,
21
21
  countData,
22
- onSearch,
23
- searchFields,
24
22
  } = props;
25
23
  const { t } = useTranslation();
24
+ const history = useHistory();
26
25
  const tenantId = Digit.ULBService.getCurrentTenantId();
27
- const [FilterComponent, setComp] = React.useState(() => Digit.ComponentRegistryService?.getComponent(filterComponent));
26
+ const FilterComponent = Digit.ComponentRegistryService?.getComponent(filterComponent);
28
27
 
29
28
  // State for Review Modal
30
- const [showReviewModal, setShowReviewModal] = useState(false);
31
- const [reviewHtml, setReviewHtml] = useState("");
32
29
  const [selectedKno, setSelectedKno] = useState("");
33
-
34
- const generateReviewHtml = (info) => {
35
- if (!info) return "<h3>No data found</h3>";
36
-
37
- // Helper to format labels
38
- const formatLabel = (str) => str.replace(/([A-Z])/g, ' $1').replace(/^./, (s) => s.toUpperCase());
39
-
40
- return `
41
- <!DOCTYPE html>
42
- <html>
43
- <head>
44
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
45
- <style>
46
- body { font-family: 'Inter', sans-serif; padding: 30px; color: #101828; line-height: 1.5; background: #fff; }
47
- .header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #185FA5; padding-bottom: 20px; margin-bottom: 30px; }
48
- .title { margin: 0; color: #185FA5; font-size: 24px; font-weight: 700; }
49
- .subtitle { margin: 5px 0 0; color: #667085; font-size: 14px; }
50
- .section { margin-bottom: 30px; border: 1px solid #EAECF0; border-radius: 12px; overflow: hidden; }
51
- .section-header { background: #F9FAFB; padding: 12px 20px; border-bottom: 1px solid #EAECF0; font-weight: 700; font-size: 14px; color: #344054; text-transform: uppercase; letter-spacing: 0.05em; }
52
- .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
53
- .item { padding: 16px 20px; border-bottom: 1px solid #F2F4F7; }
54
- .item:nth-last-child(-n+2) { border-bottom: none; }
55
- .label { font-size: 11px; color: #667085; text-transform: uppercase; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 4px; }
56
- .value { font-size: 14px; font-weight: 500; color: #1D2939; }
57
- .badge { display: inline-block; padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 600; }
58
- .badge-success { background: #ECFDF3; color: #027A48; }
59
- .badge-warning { background: #FFFAEB; color: #B54708; }
60
- .print-btn { background: #185FA5; color: #fff; padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; display: block; margin: 20px auto; }
61
- @media print { .print-btn { display: none; } body { padding: 0; } }
62
- </style>
63
- </head>
64
- <body>
65
- <div class="header">
66
- <div>
67
- <h1 class="title">Delhi Jal Board</h1>
68
- <p class="subtitle">EKYC Application Review Summary</p>
69
- </div>
70
- <div style="text-align: right">
71
- <span class="badge ${info.statusFlag === 'ACTIVE' ? 'badge-success' : 'badge-warning'}">${info.statusFlag || 'N/A'}</span>
72
- <p class="subtitle" style="margin-top: 8px">Generated on: ${new Date().toLocaleDateString()}</p>
73
- </div>
74
- </div>
75
-
76
- <div class="section">
77
- <div class="section-header">Basic Details</div>
78
- <div class="grid">
79
- <div class="item"><div class="label">KNO Number</div><div class="value">${info.kno || 'N/A'}</div></div>
80
- <div class="item"><div class="label">Consumer Name</div><div class="value">${info.consumerName || 'N/A'}</div></div>
81
- <div class="item"><div class="label">Mobile Number</div><div class="value">${info.mobileNo || 'N/A'}</div></div>
82
- <div class="item"><div class="label">Email Address</div><div class="value">${info.email || 'N/A'}</div></div>
83
- <div class="item"><div class="label">Connection Type</div><div class="value">${info.typeOfConnection || 'N/A'}</div></div>
84
- <div class="item"><div class="label">Category</div><div class="value">${info.connectionCategory || 'N/A'}</div></div>
85
- </div>
86
- </div>
87
-
88
- <div class="section">
89
- <div class="section-header">Location & Property Information</div>
90
- <div class="grid">
91
- <div class="item"><div class="label">Address</div><div class="value">${info.addressRaw || 'N/A'}</div></div>
92
- <div class="item"><div class="label">Locality</div><div class="value">${info.locality || 'N/A'}</div></div>
93
- <div class="item"><div class="label">City - Pincode</div><div class="value">${info.city || 'N/A'} - ${info.pincode || 'N/A'}</div></div>
94
- <div class="item"><div class="label">PID Number</div><div class="value">${info.pidNumber || 'N/A'}</div></div>
95
- <div class="item"><div class="label">No. of Floors</div><div class="value">${info.noOfFloor || 'N/A'}</div></div>
96
- <div class="item"><div class="label">Verification Status</div><div class="value"><span class="badge ${info.verificationStatus === 'SUCCESSFUL' ? 'badge-success' : 'badge-warning'}">${info.verificationStatus || 'PENDING'}</span></div></div>
97
- </div>
98
- </div>
99
-
100
- <div class="section">
101
- <div class="section-header">Meter Information</div>
102
- <div class="grid">
103
- <div class="item"><div class="label">Meter Number</div><div class="value">${info.meterNumber || 'N/A'}</div></div>
104
- <div class="item"><div class="label">Meter Make</div><div class="value">${info.meterMake || 'N/A'}</div></div>
105
- <div class="item"><div class="label">Meter Location</div><div class="value">${info.meterLocationAddress || 'N/A'}</div></div>
106
- <div class="item"><div class="label">Working Status</div><div class="value">${info.workingStatus ? 'Working' : 'Not Working'}</div></div>
107
- </div>
108
- </div>
109
-
110
- <button class="print-btn" onclick="window.print()">Print This Review</button>
111
- </body>
112
- </html>
113
- `;
114
- };
115
-
116
- // Use the library hook if available, otherwise fallback to local definition
117
- // This is a safety measure to handle stale library builds in dev environment
118
- const useReviewHook = Digit.Hooks.ekyc?.useEkycApplicationReview || ((p, config) => {
119
- return Digit.Hooks.useMutation((data) => Digit.EkycService.application_review(data, p), config);
120
- });
121
-
122
- const { mutate: getReview, isLoading: isReviewLoading } = useReviewHook(
123
- { tenantId },
124
- {
125
- onSuccess: (res) => {
126
- if (res?.applicationReviewInfo) {
127
- const html = generateReviewHtml(res.applicationReviewInfo);
128
- setReviewHtml(html);
129
- setShowReviewModal(true);
130
- } else {
131
- // Fallback to URL method if the API is updated later to return a URL
132
- const url = res?.acknowledgementURL || res?.reviewUrl || res?.url;
133
- if (url) {
134
- setReviewHtml(""); // Clear HTML so iframe uses URL
135
- setReviewUrl(url);
136
- setShowReviewModal(true);
137
- } else {
138
- alert(t("EKYC_REVIEW_INFO_NOT_FOUND"));
139
- }
140
- }
141
- },
142
- onError: (err) => {
143
- alert(err?.message || t("ERR_FAILED_TO_FETCH_REVIEW"));
144
- }
145
- }
146
- );
147
-
30
+ const { data: reviewData, getReview } = Digit.Hooks.ekyc.useEkycAPI("review", tenantId);
148
31
  const handleReview = (kno) => {
149
32
  setSelectedKno(kno);
150
33
  getReview({ kno });
151
34
  };
152
35
 
36
+ React.useEffect(() => {
37
+ if (reviewData) {
38
+ history.push("/digit-ui/employee/ekyc/review", { kNumber: selectedKno, aadhaarData: reviewData?.aadhaarData, reviewData });
39
+ }
40
+ // eslint-disable-next-line react-hooks/exhaustive-deps
41
+ }, [reviewData]);
42
+
153
43
  const columns = useMemo(
154
44
  () => [
155
45
  {
@@ -180,13 +70,30 @@ const DesktopInbox = ({ tableConfig, filterComponent, ...props }) => {
180
70
  // },
181
71
  {
182
72
  Header: t("EKYC_STATUS"),
183
- accessor: "status",
73
+ accessor: "actionStatus",
184
74
  Cell: ({ row }) => {
185
75
  const status = row.original?.status || "DEFAULT";
186
76
  return <span className={`ekyc-status-tag ${status}`}>{t(`${status}`)}</span>;
187
77
  },
188
78
  },
79
+ {
80
+ Header: t("EKYC_ACTION"),
81
+ accessor: "status",
82
+ Cell: ({ row }) => {
83
+ const kno = row.original?.kno || row.original?.applicationNumber || "NA";
84
+ return (
85
+ <span
86
+ className="ekyc-application-link"
87
+ style={{ color: "#add8f7", cursor: "pointer", fontWeight: "bold" }}
88
+ onClick={() => handleReview(kno)}
89
+ >
90
+ {t("EKYC_REVIEW")}
91
+ </span>
92
+ );
93
+ },
94
+ },
189
95
  ],
96
+ // eslint-disable-next-line react-hooks/exhaustive-deps
190
97
  [t, parentRoute]
191
98
  );
192
99
 
@@ -195,37 +102,14 @@ const DesktopInbox = ({ tableConfig, filterComponent, ...props }) => {
195
102
  }, [data]);
196
103
 
197
104
  return (
198
- <div className="inbox-container">
199
- {showReviewModal && (
200
- <Modal
201
- headerBarMain={t("EKYC_APPLICATION_REVIEW") + (selectedKno ? ` - ${selectedKno}` : "")}
202
- headerBarEnd={<div style={{ cursor: "pointer", padding: "5px 10px", background: "#F2F4F7", borderRadius: "4px" }} onClick={() => setShowReviewModal(false)}>{t("CLOSE")}</div>}
203
- hideSubmit={true}
204
- popupStyles={{ width: "90%", height: "90%", maxWidth: "1000px" }}
205
- popupModuleMianStyles={{ height: "calc(100% - 60px)", padding: 0 }}
206
- >
207
- <iframe
208
- srcDoc={reviewHtml}
209
- src={!reviewHtml ? reviewUrl : undefined}
210
- title="Application Review"
211
- style={{ width: "100%", height: "100%", border: "none" }}
212
- />
213
- </Modal>
214
- )}
215
- {(isLoading || isReviewLoading) && <Loader />}
216
- <div className="filters-container">
217
- {/* Sidebar Title Card */}
218
- <Card
219
- className="sidebar-title-card"
220
- style={{ display: "flex", alignItems: "center", padding: "16px", marginBottom: "16px", borderRadius: "4px" }}
221
- >
222
- <div className="icon-container" style={{ color: "#3A8DCC", marginRight: "12px" }}>
223
- <HomeIcon style={{ width: "24px", height: "24px" }} />
224
- </div>
225
- <div style={{ fontWeight: "700", fontSize: "18px", color: "#0B0C0C" }}>{t("ACTION_TEST_EKYC")}</div>
226
- </Card>
105
+ <div className="app-container">
106
+ <div className="inbox-container">
107
+ {isLoading && <Loader />}
108
+ <div className="side-panel-item">
109
+ {/* Sidebar Title Card */}
110
+
111
+ <InboxLinks headerText={props.moduleCode} />
227
112
 
228
- <div>
229
113
  {FilterComponent && (
230
114
  <FilterComponent
231
115
  defaultSearchParams={props.defaultSearchParams}
@@ -236,45 +120,45 @@ const DesktopInbox = ({ tableConfig, filterComponent, ...props }) => {
236
120
  />
237
121
  )}
238
122
  </div>
239
- </div>
240
123
 
241
- <div style={{ flex: 1, marginLeft: "16px" }}>
242
- {/* Header Section (retaining for context/actions) */}
243
- {/* <div className="ekyc-header-container module-header" style={{ marginBottom: "16px", display: "flex", justifyContent: "space-between", alignItems: "center" }}>
124
+ <div className="employee-form-content" style={{ flex: 1 }}>
125
+ {/* Header Section (retaining for context/actions) */}
126
+ {/* <div className="ekyc-header-container module-header" style={{ marginBottom: "16px", display: "flex", justifyContent: "space-between", alignItems: "center" }}>
244
127
  <Header className="title" style={{ margin: 0 }}>{t("EKYC_INBOX_HEADER")}</Header>
245
128
  <Link to={`${parentRoute}/create-kyc`}>
246
129
  <SubmitBar label={t("EKYC_CREATE_KYC")} style={{ borderRadius: "8px" }} />
247
130
  </Link>
248
131
  </div> */}
249
132
 
250
- {/* Metrics Section (The Card) */}
251
- <Card className="ekyc-metrics-card" style={{ marginBottom: "16px", padding: "16px" }}>
252
- <StatusCards countData={countData} />
253
- </Card>
254
-
255
- {/* Table Section */}
256
- <div className="result" style={{ flex: 1 }}>
257
- <Card className="ekyc-table-card" style={{ padding: 0 }}>
258
- <Table
259
- t={t}
260
- data={tableData}
261
- columns={columns}
262
- isLoading={isLoading}
263
- onSort={onSort}
264
- sortParams={sortParams}
265
- totalRecords={totalRecords}
266
- onNextPage={onNextPage}
267
- onPrevPage={onPrevPage}
268
- currentPage={currentPage}
269
- pageSizeLimit={pageSizeLimit}
270
- onPageSizeChange={onPageSizeChange}
271
- getCellProps={(cellInfo) => {
272
- return {
273
- className: "ekyc-table-cell",
274
- };
275
- }}
276
- />
133
+ {/* Metrics Section (The Card) */}
134
+ <Card className="ekyc-metrics-card">
135
+ <StatusCards countData={countData} />
277
136
  </Card>
137
+
138
+ {/* Table Section */}
139
+ <div className="result" style={{ flex: 1 }}>
140
+ <Card className="ekyc-table-card" style={{ padding: 0 }}>
141
+ <Table
142
+ t={t}
143
+ data={tableData}
144
+ columns={columns}
145
+ isLoading={isLoading}
146
+ onSort={onSort}
147
+ sortParams={sortParams}
148
+ totalRecords={totalRecords}
149
+ onNextPage={onNextPage}
150
+ onPrevPage={onPrevPage}
151
+ currentPage={currentPage}
152
+ pageSizeLimit={pageSizeLimit}
153
+ onPageSizeChange={onPageSizeChange}
154
+ getCellProps={(cellInfo) => {
155
+ return {
156
+ className: "ekyc-table-cell",
157
+ };
158
+ }}
159
+ />
160
+ </Card>
161
+ </div>
278
162
  </div>
279
163
  </div>
280
164
  </div>
@@ -3,35 +3,43 @@ import React from "react";
3
3
  import { useTranslation } from "react-i18next";
4
4
 
5
5
  const EKYCCard = () => {
6
- const { t } = useTranslation();
6
+ const { t } = useTranslation();
7
7
 
8
- const propsForModuleCard = {
9
- Icon: <PersonIcon />,
10
- moduleName: t("ACTION_TEST_EKYC"),
11
- kpis: [
12
- {
13
- count: "-",
14
- label: t("TOTAL_EKYC"),
15
- link: `/digit-ui/employee/ekyc/dashboard`
16
- }
17
- ],
18
- links: [
19
- {
20
- label: t("EKYC_DASHBOARD"),
21
- link: `/digit-ui/employee/ekyc/dashboard`
22
- },
23
- {
24
- label: t("EKYC_CREATE_KYC"),
25
- link: `/digit-ui/employee/ekyc/create-kyc`
26
- },
27
- // {
28
- // label: t("EKYC_MAPPING"),
29
- // link: `/digit-ui/employee/ekyc/mapping`
30
- // }
31
- ]
32
- }
8
+ const propsForModuleCard = {
9
+ Icon: <PersonIcon />,
10
+ moduleName: t("ACTION_TEST_EKYC"),
11
+ kpis: [
12
+ {
13
+ count: "-",
14
+ label: t("TOTAL_EKYC"),
15
+ link: `/digit-ui/employee/ekyc/dashboard`,
16
+ },
17
+ ],
18
+ links: [
19
+ {
20
+ label: t("EKYC_DASHBOARD"),
21
+ link: `/digit-ui/employee/ekyc/dashboard`,
22
+ },
23
+ {
24
+ label: t("EKYC_INBOX"),
25
+ link: `/digit-ui/employee/ekyc/inbox`,
26
+ },
27
+ // {
28
+ // label: t("EKYC_CREATE_KYC"),
29
+ // link: `/digit-ui/employee/ekyc/create-kyc`
30
+ // },
31
+ // {
32
+ // label: t("EKYC_UPDATE_KYC"),
33
+ // link: `/digit-ui/employee/ekyc/update-kyc`
34
+ // },
35
+ {
36
+ label: t("EKYC_MAPPING"),
37
+ link: `/digit-ui/employee/ekyc/mapping`,
38
+ },
39
+ ],
40
+ };
33
41
 
34
- return <EmployeeModuleCard {...propsForModuleCard} />
42
+ return <EmployeeModuleCard {...propsForModuleCard} />;
35
43
  };
36
44
 
37
45
  export default EKYCCard;
@@ -1,60 +1,55 @@
1
- import React, { useEffect, useState } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Dropdown, FilterForm, FilterFormField } from "@djb25/digit-ui-react-components";
3
3
  import { useTranslation } from "react-i18next";
4
4
 
5
5
  const Filter = ({ searchParams, onFilterChange, defaultSearchParams, statusMap, moduleCode, ...props }) => {
6
- const { t } = useTranslation();
7
-
8
- const [_searchParams, setSearchParams] = useState(() => ({ ...searchParams }));
9
-
10
- const localParamChange = (filterParam) => {
11
- let keys_to_delete = filterParam.delete;
12
- let _new = { ..._searchParams, ...filterParam };
13
- if (keys_to_delete) keys_to_delete.forEach((key) => delete _new[key]);
14
- delete filterParam.delete;
15
- setSearchParams({ ..._new });
16
- };
17
-
18
- const applyLocalFilters = () => {
19
- onFilterChange(_searchParams);
20
- };
21
-
22
- const clearAll = () => {
23
- setSearchParams({ ...defaultSearchParams });
24
- onFilterChange({ ...defaultSearchParams });
25
- };
26
-
27
- const onStatusChange = (value) => {
28
- const newParams = { ..._searchParams, status: value };
29
- setSearchParams(newParams);
30
- onFilterChange(newParams);
31
- };
32
-
33
- return (
34
- <FilterForm
35
- onSubmit={applyLocalFilters}
36
- handleSubmit={(fn) => (e) => { e && e.preventDefault(); fn(); }}
37
- onResetFilterForm={clearAll}
38
- id="ekyc-filter-form"
39
- onMobileExclusiveFilterPopupFormClose={props.onClose}
40
- >
41
- <FilterFormField>
42
- <div className="filter-label" style={{ fontWeight: "normal" }}>
43
- {t("EKYC_STATUS")}:
44
- </div>
45
- <Dropdown
46
- option={[
47
- { label: t("EKYC_STATUS_ALL"), value: "" },
48
- { label: t("EKYC_STATUS_ACTIVE"), value: "ACTIVE" },
49
- { label: t("EKYC_STATUS_PENDING"), value: "PENDING START" },
50
- ]}
51
- optionKey="label"
52
- select={onStatusChange}
53
- selected={_searchParams?.status || { label: t("EKYC_STATUS_ALL"), value: "" }}
54
- />
55
- </FilterFormField>
56
- </FilterForm>
57
- );
6
+ const { t } = useTranslation();
7
+
8
+ const [_searchParams, setSearchParams] = useState(() => ({ ...searchParams }));
9
+
10
+ const applyLocalFilters = () => {
11
+ onFilterChange(_searchParams);
12
+ };
13
+
14
+ const clearAll = () => {
15
+ setSearchParams({ ...defaultSearchParams });
16
+ onFilterChange({ ...defaultSearchParams });
17
+ };
18
+
19
+ const onStatusChange = (value) => {
20
+ const newParams = { ..._searchParams, status: value };
21
+ setSearchParams(newParams);
22
+ onFilterChange(newParams);
23
+ };
24
+
25
+ return (
26
+ <FilterForm
27
+ onSubmit={applyLocalFilters}
28
+ handleSubmit={(fn) => (e) => {
29
+ e && e.preventDefault();
30
+ fn();
31
+ }}
32
+ onResetFilterForm={clearAll}
33
+ id="ekyc-filter-form"
34
+ onMobileExclusiveFilterPopupFormClose={props.onClose}
35
+ >
36
+ <FilterFormField>
37
+ <div className="filter-label" style={{ fontWeight: "normal" }}>
38
+ {t("EKYC_STATUS")}:
39
+ </div>
40
+ <Dropdown
41
+ option={[
42
+ { label: t("EKYC_STATUS_ALL"), value: "" },
43
+ { label: t("EKYC_STATUS_ACTIVE"), value: "ACTIVE" },
44
+ { label: t("EKYC_STATUS_PENDING"), value: "PENDING START" },
45
+ ]}
46
+ optionKey="label"
47
+ select={onStatusChange}
48
+ selected={_searchParams?.status || { label: t("EKYC_STATUS_ALL"), value: "" }}
49
+ />
50
+ </FilterFormField>
51
+ </FilterForm>
52
+ );
58
53
  };
59
54
 
60
55
  export default Filter;