@djb25/digit-ui-module-ekyc 1.0.11 → 1.0.13

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.
Files changed (40) hide show
  1. package/dist/index.css +1 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.modern.js +2884 -682
  5. package/dist/index.modern.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/Module.js +28 -7
  8. package/src/components/AadhaarVerification.js +415 -0
  9. package/src/components/AddressDetails.js +207 -0
  10. package/src/components/CeoDashboard.js +201 -0
  11. package/src/components/DesktopInbox.js +1 -1
  12. package/src/components/EKYCCard.js +4 -0
  13. package/src/components/MeterDetails.js +372 -0
  14. package/src/components/PropertyInfo.js +303 -0
  15. package/src/components/Review.js +572 -0
  16. package/src/components/analytics/charts/ClusterHeatmap.js +88 -0
  17. package/src/components/analytics/charts/TaskStatusChart.js +92 -0
  18. package/src/components/analytics/components/AnalyticsTable.js +106 -0
  19. package/src/components/analytics/components/DashboardLayout.js +72 -0
  20. package/src/components/analytics/components/EmptyState.js +27 -0
  21. package/src/components/analytics/components/ErrorBoundary.js +27 -0
  22. package/src/components/analytics/components/FilterBar.js +73 -0
  23. package/src/components/analytics/components/NotificationPanel.js +77 -0
  24. package/src/components/analytics/components/SLAWidget.js +56 -0
  25. package/src/components/analytics/components/SkeletonLoader.js +53 -0
  26. package/src/components/analytics/components/SummaryCard.js +74 -0
  27. package/src/components/analytics/components/WorkflowTimeline.js +55 -0
  28. package/src/components/analytics/styles/Dashboard.css +54 -0
  29. package/src/components/analytics/utils/exportUtils.js +64 -0
  30. package/src/components/analytics/utils/filterSerializer.js +50 -0
  31. package/src/config/config.js +1 -1
  32. package/src/pages/citizen/index.js +74 -18
  33. package/src/pages/employee/ConsumerDetails.js +10 -281
  34. package/src/pages/employee/Inbox.js +6 -4
  35. package/src/pages/employee/index.js +55 -8
  36. package/src/pages/employee/AadhaarVerification.js +0 -512
  37. package/src/pages/employee/AddressDetails.js +0 -548
  38. package/src/pages/employee/MeterDetails.js +0 -496
  39. package/src/pages/employee/PropertyInfo.js +0 -489
  40. package/src/pages/employee/Review.js +0 -314
@@ -1,255 +1,18 @@
1
- // import React, { useState, Fragment, useEffect, useRef } from "react";
2
- // import {
3
- // Card,
4
- // CardLabel,
5
- // TextInput,
6
- // SubmitBar,
7
- // CardHeader,
8
- // RadioButtons,
9
- // ActionBar,
10
- // Loader,
11
- // FormStep,
12
- // } from "@djb25/digit-ui-react-components";
13
- // import { useTranslation } from "react-i18next";
14
- // import { useLocation, useHistory } from "react-router-dom";
15
- // import { getSavedData } from "../../utils";
16
- // import AddressDetails from "./AddressDetails";
17
-
18
- // const AadhaarVerification = ({ config, onSelect, formData, t: tProps }) => {
19
- // const { t } = useTranslation();
20
- // const location = useLocation();
21
- // const history = useHistory();
22
- // const addressSectionRef = useRef(null);
23
-
24
- // const flowState = location.state || {};
25
- // const { isEditing, kNumber } = flowState;
26
-
27
- // // Robust data extraction from formData
28
- // const activeEdits = formData || {};
29
- // const rawReviewData = formData?.reviewData || formData?.connectionDetails || {};
30
- // const reviewWrapper = rawReviewData?.applicationReview || rawReviewData;
31
- // const applicationData = (Array.isArray(reviewWrapper) ? reviewWrapper[0] : reviewWrapper) || {};
32
- // const apiData = applicationData?.newData || applicationData;
33
- // const apiConn = apiData?.connectionDetails || apiData || {};
34
-
35
- // const initialData = {
36
- // userName: apiConn.consumerName || "",
37
- // mobileNumber: apiConn.phoneNumber || apiConn.mobileNo || "",
38
- // whatsappNumber: apiConn.phoneNumber || apiConn.mobileNo || "",
39
- // email: apiConn.email || "",
40
- // noOfPersons: apiConn.noOfPerson || apiConn.noOfPersons || "",
41
- // };
42
-
43
- // const aadhaarData = activeEdits?.aadhaarData || {};
44
-
45
- // const [aadhaarNumber, setAadhaarNumber] = useState(aadhaarData.aadhaarNumber || "");
46
- // const [isAadhaarVerified, setIsAadhaarVerified] = useState(aadhaarData.isAadhaarVerified === true || isEditing); // Auto-verify if editing
47
- // const [showOtpField, setShowOtpField] = useState(false);
48
- // const [otp, setOtp] = useState("");
49
- // const [otpError, setOtpError] = useState(false);
50
- // const [nameCorrect, setNameCorrect] = useState(aadhaarData.nameCorrect || { code: "YES", name: "CORE_COMMON_YES" });
51
- // const [userName, setUserName] = useState(aadhaarData.name || initialData.userName);
52
- // const [mobileChange, setMobileChange] = useState(aadhaarData.mobileChange || { code: "YES", name: "CORE_COMMON_YES" });
53
- // const [mobileNumber, setMobileNumber] = useState(aadhaarData.mobileNumber || initialData.mobileNumber);
54
- // const [whatsappNumber, setWhatsappNumber] = useState(aadhaarData.whatsappNumber || initialData.whatsappNumber);
55
- // const [email, setEmail] = useState(aadhaarData.email || initialData.email);
56
- // const [noOfPersons, setNoOfPersons] = useState(aadhaarData.noOfPersons || initialData.noOfPersons);
57
- // const [showAddressSection, setShowAddressSection] = useState(false);
58
-
59
- // const getUpdatedData = () => ({
60
- // aadhaarNumber,
61
- // isAadhaarVerified,
62
- // name: userName,
63
- // nameCorrect,
64
- // mobileChange,
65
- // mobileNumber,
66
- // whatsappNumber,
67
- // email,
68
- // noOfPersons,
69
- // gender: "Male",
70
- // dob: "01/01/1990",
71
- // });
72
-
73
- // const handleVerifyAadhaar = () => {
74
- // if (aadhaarNumber.length === 12) setShowOtpField(true);
75
- // };
76
-
77
- // const handleVerifyOtp = () => {
78
- // if (otp === "123456") {
79
- // setIsAadhaarVerified(true);
80
- // setShowOtpField(false);
81
- // setShowAddressSection(true);
82
- // if (onSelect) {
83
- // onSelect(config.key, { ...getUpdatedData(), isAadhaarVerified: true });
84
- // }
85
- // } else {
86
- // setOtpError(true);
87
- // }
88
- // };
89
-
90
- // const onStepSelect = () => {
91
- // const updatedData = getUpdatedData();
92
- // if (onSelect) {
93
- // onSelect(config.key, updatedData);
94
- // } else {
95
- // if (isEditing) {
96
- // history.push("/digit-ui/employee/ekyc/review", { ...location.state, edits: { ...edits, aadhaarData: updatedData } });
97
- // } else {
98
- // history.push("/digit-ui/employee/ekyc/address-details", {
99
- // ...location.state,
100
- // edits: { ...edits, aadhaarData: updatedData }
101
- // });
102
- // }
103
- // }
104
- // };
105
-
106
- // const handleUpdateAndReturn = () => {
107
- // history.push("/digit-ui/employee/ekyc/review", { ...location.state, edits: { ...edits, aadhaarData: getUpdatedData() } });
108
- // };
109
-
110
- // const yesNoOptions = [
111
- // { code: "YES", name: "CORE_COMMON_YES" },
112
- // { code: "NO", name: "CORE_COMMON_NO" },
113
- // ];
114
-
115
- // return (
116
- // <Fragment>
117
- // <FormStep
118
- // t={t}
119
- // config={config || {}}
120
- // onSelect={onStepSelect}
121
- // isDisabled={!isAadhaarVerified || !userName || !mobileNumber}
122
- // label={t(config?.texts?.submitBarLabel) || (isEditing ? t("EKYC_UPDATE_AND_RETURN") : t("ES_COMMON_CONTINUE"))}
123
- // >
124
- // <CardLabel>{t("EKYC_AADHAAR_NUMBER")} <span className="astericColor">*</span></CardLabel>
125
- // <TextInput
126
- // id="aadhaarNumber"
127
- // name="aadhaarNumber"
128
- // value={aadhaarNumber}
129
- // onChange={(e) => setAadhaarNumber(e.target.value)}
130
- // placeholder={t("EKYC_ENTER_AADHAAR_NUMBER")}
131
- // maxLength={12}
132
- // disabled={isAadhaarVerified}
133
- // />
134
- // {!isAadhaarVerified && !showOtpField && (
135
- // <SubmitBar label={t("EKYC_VERIFY")} onSubmit={handleVerifyAadhaar} disabled={aadhaarNumber.length !== 12} />
136
- // )}
137
-
138
- // {showOtpField && (
139
- // <Fragment>
140
- // <CardLabel>{t("EKYC_ENTER_OTP")} <span className="astericColor">*</span></CardLabel>
141
- // <TextInput
142
- // id="otp"
143
- // name="otp"
144
- // value={otp}
145
- // onChange={(e) => setOtp(e.target.value)}
146
- // placeholder="123456"
147
- // maxLength={6}
148
- // />
149
- // {otpError && <div style={{ color: "red", fontSize: "12px" }}>{t("EKYC_INVALID_OTP")}</div>}
150
- // <SubmitBar label={t("EKYC_VERIFY_OTP")} onSubmit={handleVerifyOtp} disabled={otp.length !== 6} />
151
- // </Fragment>
152
- // )}
153
-
154
- // {isAadhaarVerified && (
155
- // <Fragment>
156
- // <CardLabel>{t("EKYC_IS_NAME_CORRECT")}</CardLabel>
157
- // <RadioButtons
158
- // options={yesNoOptions}
159
- // optionsKey="name"
160
- // selectedOption={nameCorrect}
161
- // onSelect={setNameCorrect}
162
- // />
163
- // <CardLabel>{t("EKYC_USER_NAME")} <span className="astericColor">*</span></CardLabel>
164
- // <TextInput
165
- // id="userName"
166
- // name="userName"
167
- // value={userName}
168
- // onChange={(e) => setUserName(e.target.value)}
169
- // disabled={nameCorrect.code === "NO"}
170
- // />
171
-
172
- // <CardLabel>{t("EKYC_CHANGE_MOBILE")}</CardLabel>
173
- // <RadioButtons
174
- // options={yesNoOptions}
175
- // optionsKey="name"
176
- // selectedOption={mobileChange}
177
- // onSelect={setMobileChange}
178
- // />
179
- // <CardLabel>{t("EKYC_MOBILE_NUMBER")} <span className="astericColor">*</span></CardLabel>
180
- // <TextInput
181
- // id="mobileNumber"
182
- // name="mobileNumber"
183
- // value={mobileNumber}
184
- // onChange={(e) => setMobileNumber(e.target.value)}
185
- // disabled={mobileChange.code === "NO"}
186
- // />
187
-
188
- // <CardLabel>{t("EKYC_WHATSAPP_NUMBER")}</CardLabel>
189
- // <TextInput
190
- // id="whatsappNumber"
191
- // name="whatsappNumber"
192
- // value={whatsappNumber}
193
- // onChange={(e) => setWhatsappNumber(e.target.value)}
194
- // />
195
-
196
- // <CardLabel>{t("EKYC_EMAIL_ID")}</CardLabel>
197
- // <TextInput
198
- // id="email"
199
- // name="email"
200
- // value={email}
201
- // onChange={(e) => setEmail(e.target.value)}
202
- // />
203
-
204
- // <CardLabel>{t("EKYC_NO_OF_PERSONS")}</CardLabel>
205
- // <TextInput
206
- // id="noOfPersons"
207
- // name="noOfPersons"
208
- // value={noOfPersons}
209
- // onChange={(e) => setNoOfPersons(e.target.value)}
210
- // />
211
- // </Fragment>
212
- // )}
213
- // </FormStep>
214
- // {isEditing && !onSelect && (
215
- // <ActionBar style={{ position: "static", marginTop: "20px" }}>
216
- // <SubmitBar label={t("EKYC_UPDATE_AND_RETURN")} onSubmit={handleUpdateAndReturn} />
217
- // </ActionBar>
218
- // )}
219
- // </Fragment>
220
- // );
221
- // };
222
-
223
- // export default AadhaarVerification;
224
-
225
-
226
-
227
1
  import React, { useState, Fragment } from "react";
228
- import {
229
- CardLabel,
230
- TextInput,
231
- Dropdown,
232
- UploadFile,
233
- RadioButtons,
234
- Toast,
235
- FormStep,
236
- } from "@djb25/digit-ui-react-components";
2
+ import { CardLabel, TextInput, Dropdown, UploadFile, Toast, FormStep } from "@djb25/digit-ui-react-components";
237
3
 
238
4
  const ConsumerDetails = ({ config, onSelect }) => {
239
-
240
5
  // 🔹 STATES
241
6
  const [kno, setKno] = useState("");
242
7
  const [consumerType, setConsumerType] = useState(null);
243
8
  const [occupantType, setOccupantType] = useState(null);
244
9
  const [categoryType, setCategoryType] = useState(null);
245
10
 
246
- const [consumerName, setConsumerName] = useState("");
247
11
  const [firstName, setFirstName] = useState("");
248
12
  const [middleName, setMiddleName] = useState("");
249
13
  const [lastName, setLastName] = useState("");
250
14
 
251
15
  const [gender, setGender] = useState(null);
252
- const [relation, setRelation] = useState("");
253
16
 
254
17
  const [mobile, setMobile] = useState("");
255
18
  const [whatsapp, setWhatsapp] = useState("");
@@ -257,7 +20,7 @@ const ConsumerDetails = ({ config, onSelect }) => {
257
20
  const [residents, setResidents] = useState("");
258
21
 
259
22
  // Tenant
260
- const [documentProof, setDocumentProof] = useState(null);
23
+ const [, setDocumentProof] = useState(null);
261
24
  const [documentId, setDocumentId] = useState(null);
262
25
  const [ownerMobile, setOwnerMobile] = useState("");
263
26
  const [tenantVerification, setTenantVerification] = useState("");
@@ -266,41 +29,21 @@ const ConsumerDetails = ({ config, onSelect }) => {
266
29
  const [designation, setDesignation] = useState("");
267
30
  const [department, setDepartment] = useState("");
268
31
  const [employeeId, setEmployeeId] = useState("");
269
- const [landline, setLandline] = useState("");
270
32
 
271
33
  // Other Entity
272
- const [entityRelation, setEntityRelation] = useState("");
273
34
  const [contactPerson, setContactPerson] = useState("");
274
35
  const [entityName, setEntityName] = useState("");
275
36
 
276
37
  // Identity
277
- const [idProof, setIdProof] = useState(null);
278
- const [idNumber, setIdNumber] = useState("");
279
- const [idFile, setIdFile] = useState(null);
280
-
281
38
 
282
39
  const [toast, setToast] = useState(null);
283
40
 
284
41
  // 🔹 OPTIONS
285
- const consumerTypeOptions = [
286
- { name: "Individual" },
287
- { name: "Govt" },
288
- { name: "Company_Society_Org" },
289
- ];
290
-
291
- const occupantOptions = [
292
- { name: "Self" },
293
- { name: "Tenanted" },
294
- ];
295
-
296
- const genderOptions = [
297
- { name: "Male" },
298
- { name: "Female" },
299
- { name: "Others" },
300
- { name: "Not prefer to say" },
301
- ];
302
-
303
- const yesNo = [{ name: "Yes" }, { name: "No" }];
42
+ const consumerTypeOptions = [{ name: "Individual" }, { name: "Govt" }, { name: "Company_Society_Org" }];
43
+
44
+ const occupantOptions = [{ name: "Self" }, { name: "Tenanted" }];
45
+
46
+ const genderOptions = [{ name: "Male" }, { name: "Female" }, { name: "Others" }, { name: "Not prefer to say" }];
304
47
 
305
48
  // 🔹 FILE UPLOAD
306
49
  const uploadFile = async (e, setter, idSetter) => {
@@ -329,10 +72,9 @@ const ConsumerDetails = ({ config, onSelect }) => {
329
72
  if (!mobile) return false;
330
73
  if (!residents || Number(residents) <= 0) return false;
331
74
 
332
- if (occupantType?.name === "Tenanted" && !documentId && !ownerMobile)
333
- return false;
75
+ if (occupantType?.name === "Tenanted" && !documentId && !ownerMobile) return false;
334
76
 
335
- return consent;
77
+ return false;
336
78
  };
337
79
 
338
80
  // 🔹 SUBMIT
@@ -347,12 +89,10 @@ const ConsumerDetails = ({ config, onSelect }) => {
347
89
  consumerType: consumerType?.name,
348
90
  occupantType: occupantType?.name,
349
91
  categoryType: categoryType?.name,
350
- consumerName,
351
92
  firstName,
352
93
  middleName,
353
94
  lastName,
354
95
  gender: gender?.name,
355
- relation,
356
96
  mobile,
357
97
  whatsapp,
358
98
  email,
@@ -363,16 +103,8 @@ const ConsumerDetails = ({ config, onSelect }) => {
363
103
  designation,
364
104
  department,
365
105
  employeeId,
366
- landline,
367
- entityRelation,
368
106
  contactPerson,
369
107
  entityName,
370
- idProof: idProof?.name,
371
- idNumber,
372
- consent,
373
- informantIsConsumer,
374
- informantName,
375
- informantRelation,
376
108
  };
377
109
 
378
110
  onSelect(config.key, data);
@@ -500,13 +232,10 @@ const ConsumerDetails = ({ config, onSelect }) => {
500
232
  </Fragment>
501
233
  )}
502
234
 
503
-
504
-
505
235
  {toast && <Toast label={toast.message} error={toast.type === "error"} onClose={() => setToast(null)} />}
506
-
507
236
  </FormStep>
508
237
  </Fragment>
509
238
  );
510
239
  };
511
240
 
512
- export default ConsumerDetails;
241
+ export default ConsumerDetails;
@@ -85,13 +85,14 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
85
85
  }
86
86
 
87
87
  // ✅ dashboard mapping
88
+ const fullName = [item.firstName, item.middleName, item.lastName].filter(Boolean).join(" ");
88
89
  return {
89
90
  ...item,
90
91
  applicationNo: item.kno || item.applicationNumber || "",
91
- connectionNo: item.connectionNo || "",
92
- owner: item.consumerName || item.citizenName || "",
92
+ connectionNo: item.kno || "",
93
+ owner: fullName || item.consumerName || item.citizenName || "",
93
94
  applicationNumber: item.kno || item.applicationNumber || "",
94
- citizenName: item.consumerName || item.citizenName || "",
95
+ citizenName: fullName || item.consumerName || item.citizenName || "",
95
96
  status: item.status || "",
96
97
  sla: item.sla ?? 0,
97
98
  };
@@ -102,7 +103,7 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
102
103
 
103
104
  const checkPathName = location.pathname.includes("ekyc/inbox");
104
105
  const PropsForInboxLinks = {
105
- headerText: checkPathName ? "MODULE_WATER" : "MODULE_SW",
106
+ headerText: checkPathName ? "EKYC_MODULE" : "MODULE_SW",
106
107
  };
107
108
 
108
109
  const SearchFormFields = useCallback(
@@ -246,6 +247,7 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
246
247
  propsForInboxTable,
247
248
  // propsForInboxMobileCards,
248
249
  formState,
250
+ countData: dashboardData?.dashboardInfo,
249
251
  }}
250
252
  />
251
253
  </div>
@@ -1,4 +1,4 @@
1
- import { AppContainer, PrivateRoute, ModuleHeader, ArrowLeft, HomeIcon } from "@djb25/digit-ui-react-components";
1
+ import { AppContainer, PrivateRoute, ModuleHeader, ArrowLeft, HomeIcon, LayoutWrapper } from "@djb25/digit-ui-react-components";
2
2
  import React from "react";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { Switch, useLocation } from "react-router-dom";
@@ -7,7 +7,7 @@ import Inbox from "./Inbox";
7
7
  import Mapping from "./Mapping";
8
8
  import Create from "./Create";
9
9
 
10
- import Review from "./Review";
10
+ import Review from "../../components/Review";
11
11
  import EKYCForm from "./EKYCForm";
12
12
 
13
13
  const EmployeeApp = ({ path }) => {
@@ -16,6 +16,8 @@ const EmployeeApp = ({ path }) => {
16
16
 
17
17
  sessionStorage.removeItem("revalidateddone");
18
18
 
19
+ const CeoDashboard = Digit.ComponentRegistryService.getComponent("CeoDashboard");
20
+
19
21
  const getBreadcrumbLabel = () => {
20
22
  const pathname = location.pathname;
21
23
  if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
@@ -52,20 +54,65 @@ const EmployeeApp = ({ path }) => {
52
54
  <Switch>
53
55
  <PrivateRoute
54
56
  path={`${path}/dashboard`}
55
- component={() => <Dashboard parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />}
57
+ component={() => (
58
+ <LayoutWrapper layoutClass="normal">
59
+ <Dashboard parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />
60
+ </LayoutWrapper>
61
+ )}
56
62
  />
57
63
  <PrivateRoute
58
64
  path={`${path}/inbox`}
59
- component={() => <Inbox parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />}
65
+ component={() => (
66
+ <LayoutWrapper layoutClass="normal">
67
+ <Inbox parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />
68
+ </LayoutWrapper>
69
+ )}
60
70
  />
61
71
 
62
- <PrivateRoute path={`${path}/create-kyc`} component={() => <Create />} />
72
+ <PrivateRoute
73
+ path={`${path}/create-kyc`}
74
+ component={() => (
75
+ <LayoutWrapper layoutClass="normal">
76
+ <Create />
77
+ </LayoutWrapper>
78
+ )}
79
+ />
63
80
 
64
- <PrivateRoute path={`${path}/mapping`} component={() => <Mapping />} />
81
+ <PrivateRoute
82
+ path={`${path}/mapping`}
83
+ component={() => (
84
+ <LayoutWrapper layoutClass="normal">
85
+ <Mapping />
86
+ </LayoutWrapper>
87
+ )}
88
+ />
65
89
 
66
- <PrivateRoute path={formStepRoutes.map((route) => `${path}/${route}`)} component={(props) => <EKYCForm {...props} path={path} />} />
90
+ <PrivateRoute
91
+ path={formStepRoutes.map((route) => `${path}/${route}`)}
92
+ component={(props) => (
93
+ <LayoutWrapper layoutClass="normal">
94
+ <EKYCForm {...props} path={path} />
95
+ </LayoutWrapper>
96
+ )}
97
+ />
98
+
99
+ <PrivateRoute
100
+ path={`${path}/review`}
101
+ component={() => (
102
+ <LayoutWrapper layoutClass="normal">
103
+ <Review />
104
+ </LayoutWrapper>
105
+ )}
106
+ />
67
107
 
68
- <PrivateRoute path={`${path}/review`} component={() => <Review />} />
108
+ <PrivateRoute
109
+ path={`${path}/ceo-dashboard`}
110
+ component={() => (
111
+ <LayoutWrapper layoutClass="normal">
112
+ <CeoDashboard />
113
+ </LayoutWrapper>
114
+ )}
115
+ />
69
116
 
70
117
  {/* <PrivateRoute
71
118
  path={`${path}/`}