@djb25/digit-ui-module-ekyc 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8911 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +3295 -2039
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -1
- package/dist/index.css +0 -54
- package/src/Module.js +0 -78
- package/src/components/AadhaarVerification.js +0 -315
- package/src/components/AssignEkyc.js +0 -236
- package/src/components/AssignEkycModal.js +0 -446
- package/src/components/CeoDashboard.js +0 -264
- package/src/components/CeoDashboard.jsx +0 -334
- package/src/components/ConnectionDetailsView.js +0 -241
- package/src/components/Dashboard.js +0 -43
- package/src/components/DesktopInbox.js +0 -176
- package/src/components/EKYCCard.js +0 -53
- package/src/components/Filter.js +0 -55
- package/src/components/MeterDetails.js +0 -336
- package/src/components/MobileInbox.js +0 -73
- package/src/components/PropertyInfo.js +0 -264
- package/src/components/Review.js +0 -696
- package/src/components/SearchConsumer.js +0 -142
- package/src/components/SearchFormFieldsComponent.js +0 -67
- package/src/components/SelectEkycZones.js +0 -71
- package/src/components/StatusCards.js +0 -148
- package/src/components/SurveyorDetailsCard.js +0 -512
- package/src/components/VendorDetails.jsx +0 -230
- package/src/components/analytics/charts/ClusterHeatmap.js +0 -88
- package/src/components/analytics/charts/ExecutiveBarChart.jsx +0 -30
- package/src/components/analytics/charts/ExecutiveLineChart.jsx +0 -159
- package/src/components/analytics/charts/ExecutivePieChart.jsx +0 -24
- package/src/components/analytics/charts/TaskStatusChart.js +0 -90
- package/src/components/analytics/components/AnalyticsTable.js +0 -106
- package/src/components/analytics/components/DashboardLayout.js +0 -52
- package/src/components/analytics/components/EmptyState.js +0 -27
- package/src/components/analytics/components/ErrorBoundary.js +0 -27
- package/src/components/analytics/components/FilterBar.js +0 -73
- package/src/components/analytics/components/NotificationPanel.js +0 -77
- package/src/components/analytics/components/SLAWidget.js +0 -56
- package/src/components/analytics/components/SkeletonLoader.js +0 -53
- package/src/components/analytics/components/SummaryCard.js +0 -74
- package/src/components/analytics/components/WorkflowTimeline.js +0 -55
- package/src/components/analytics/utils/exportUtils.js +0 -64
- package/src/components/analytics/utils/filterSerializer.js +0 -50
- package/src/components/mockData.js +0 -772
- package/src/config/AadhaarVerificationConfig.js +0 -367
- package/src/config/MeterDetailsConfig.js +0 -297
- package/src/config/PropertyInfoConfig.js +0 -145
- package/src/config/config.js +0 -70
- package/src/hook/SupervisorInboxTableConfig.js +0 -80
- package/src/hook/useInboxTableConfig.js +0 -131
- package/src/pages/citizen/Home.js +0 -54
- package/src/pages/citizen/Inbox.js +0 -265
- package/src/pages/citizen/index.js +0 -199
- package/src/pages/employee/ConsumerDetails.js +0 -299
- package/src/pages/employee/Create.js +0 -94
- package/src/pages/employee/EKYCForm.js +0 -118
- package/src/pages/employee/Inbox.js +0 -266
- package/src/pages/employee/Mapping.js +0 -358
- package/src/pages/employee/Update.js +0 -9
- package/src/pages/employee/index.js +0 -184
- package/src/utils/index.js +0 -46
- package/src/utils/reportDownloader.js +0 -90
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { AppContainer, PrivateRoute, ModuleHeader, ArrowLeft, HomeIcon, LayoutWrapper } from "@djb25/digit-ui-react-components";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { Switch, useLocation } from "react-router-dom";
|
|
5
|
-
import Dashboard from "../../components/Dashboard";
|
|
6
|
-
import CeoDashboard from "../../components/CeoDashboard.jsx";
|
|
7
|
-
import VendorDetails from "../../components/VendorDetails.jsx";
|
|
8
|
-
import Inbox from "./Inbox";
|
|
9
|
-
import Mapping from "./Mapping";
|
|
10
|
-
import Create from "./Create";
|
|
11
|
-
import Review from "../../components/Review";
|
|
12
|
-
import EKYCForm from "./EKYCForm";
|
|
13
|
-
import SurveyorDetailsCard from "../../components/SurveyorDetailsCard.js";
|
|
14
|
-
import AssignEkyc from "../../components/AssignEkyc.js";
|
|
15
|
-
|
|
16
|
-
const EmployeeApp = ({ path }) => {
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
const location = useLocation();
|
|
19
|
-
|
|
20
|
-
sessionStorage.removeItem("revalidateddone");
|
|
21
|
-
|
|
22
|
-
const getDynamicBreadcrumbs = () => {
|
|
23
|
-
const pathname = location.pathname;
|
|
24
|
-
|
|
25
|
-
// Parent crumb — always present and clickable → redirects to eKYC inbox
|
|
26
|
-
const crumbs = [
|
|
27
|
-
{ icon: HomeIcon, path: "/digit-ui/employee" },
|
|
28
|
-
{ label: t("ACTION_TEST_EKYC"), path: `/digit-ui/employee/module/details` },
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
// Child crumb — only appended when on a sub-page (not inbox/dashboard itself)
|
|
32
|
-
if (pathname.includes("/create-kyc")) {
|
|
33
|
-
crumbs.push({ label: t("EKYC_CREATE_KYC") });
|
|
34
|
-
} else if (pathname.includes("/consumer-details")) {
|
|
35
|
-
crumbs.push({ label: t("EKYC_CONSUMER_DETAILS") });
|
|
36
|
-
} else if (pathname.includes("/address-details")) {
|
|
37
|
-
crumbs.push({ label: t("EKYC_ADDRESS_DETAILS") });
|
|
38
|
-
} else if (pathname.includes("/property-info")) {
|
|
39
|
-
crumbs.push({ label: t("EKYC_PROPERTY_INFO") });
|
|
40
|
-
} else if (pathname.includes("/meter-details")) {
|
|
41
|
-
crumbs.push({ label: t("EKYC_METER_DETAILS") });
|
|
42
|
-
} else if (pathname.includes("/review")) {
|
|
43
|
-
crumbs.push({ label: t("EKYC_INBOX"), path: `/digit-ui/employee/ekyc/inbox` });
|
|
44
|
-
crumbs.push({ label: t("EKYC_REVIEW") });
|
|
45
|
-
} else if (pathname.includes("/assign/surveyor-details")) {
|
|
46
|
-
crumbs.push({ label: t("EKYC_ASSIGN"), path: `/digit-ui/employee/ekyc/assign` });
|
|
47
|
-
crumbs.push({ label: t("EKYC_SURVEYOR_DETAILS") });
|
|
48
|
-
} else if (pathname.includes("/assign")) {
|
|
49
|
-
crumbs.push({ label: t("EKYC_ASSIGN") });
|
|
50
|
-
} else if (pathname.includes("/ceo-dashboard")) {
|
|
51
|
-
crumbs.push({ label: t("CEO_M.F_DOR_FINANCE_VIEW") });
|
|
52
|
-
} else if (pathname.includes("/vendors/")) {
|
|
53
|
-
crumbs.push({ label: t("EKYC_VENDOR_DETAILS") });
|
|
54
|
-
} else if (pathname.includes("/mapping")) {
|
|
55
|
-
crumbs.push({ label: t("EKYC_MAPPING") });
|
|
56
|
-
} else if (pathname.includes("/dashboard")) {
|
|
57
|
-
crumbs.push({ label: t("EKYC_DASHBOARD") });
|
|
58
|
-
} else if (pathname.includes("/inbox")) {
|
|
59
|
-
crumbs.push({ label: t("EKYC_INBOX") });
|
|
60
|
-
}
|
|
61
|
-
// dashboard & inbox → no child crumb (only "eKYC Admin" shown)
|
|
62
|
-
|
|
63
|
-
return crumbs;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const formStepRoutes = ["consumer-details", "address-details", "property-info", "meter-details"];
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<AppContainer>
|
|
70
|
-
<div className="ground-container employee-app-container form-container">
|
|
71
|
-
<ModuleHeader
|
|
72
|
-
leftContent={
|
|
73
|
-
<React.Fragment>
|
|
74
|
-
<ArrowLeft className="icon" />
|
|
75
|
-
Back
|
|
76
|
-
</React.Fragment>
|
|
77
|
-
}
|
|
78
|
-
onLeftClick={() => window.history.back()}
|
|
79
|
-
breadcrumbs={getDynamicBreadcrumbs()}
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
<div className="employee-form">
|
|
83
|
-
<Switch>
|
|
84
|
-
<PrivateRoute
|
|
85
|
-
path={`${path}/dashboard`}
|
|
86
|
-
component={() => (
|
|
87
|
-
<LayoutWrapper layoutClass="normal">
|
|
88
|
-
<Dashboard parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />
|
|
89
|
-
</LayoutWrapper>
|
|
90
|
-
)}
|
|
91
|
-
/>
|
|
92
|
-
<PrivateRoute
|
|
93
|
-
path={`${path}/inbox`}
|
|
94
|
-
component={() => (
|
|
95
|
-
<LayoutWrapper layoutClass="normal">
|
|
96
|
-
<Inbox parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />
|
|
97
|
-
</LayoutWrapper>
|
|
98
|
-
)}
|
|
99
|
-
/>
|
|
100
|
-
|
|
101
|
-
<PrivateRoute
|
|
102
|
-
path={`${path}/create-kyc`}
|
|
103
|
-
component={() => (
|
|
104
|
-
<LayoutWrapper layoutClass="normal">
|
|
105
|
-
<Create />
|
|
106
|
-
</LayoutWrapper>
|
|
107
|
-
)}
|
|
108
|
-
/>
|
|
109
|
-
|
|
110
|
-
<PrivateRoute
|
|
111
|
-
path={`${path}/mapping`}
|
|
112
|
-
component={() => (
|
|
113
|
-
<LayoutWrapper layoutClass="normal">
|
|
114
|
-
<Mapping />
|
|
115
|
-
</LayoutWrapper>
|
|
116
|
-
)}
|
|
117
|
-
/>
|
|
118
|
-
<PrivateRoute
|
|
119
|
-
path={`${path}/assign`}
|
|
120
|
-
exact
|
|
121
|
-
component={() => (
|
|
122
|
-
<LayoutWrapper layoutClass="normal">
|
|
123
|
-
<AssignEkyc />
|
|
124
|
-
</LayoutWrapper>
|
|
125
|
-
)}
|
|
126
|
-
/>
|
|
127
|
-
<PrivateRoute
|
|
128
|
-
path={`${path}/assign/surveyor-details/:id`}
|
|
129
|
-
exact
|
|
130
|
-
component={() => (
|
|
131
|
-
<LayoutWrapper layoutClass="action">
|
|
132
|
-
<SurveyorDetailsCard />
|
|
133
|
-
</LayoutWrapper>
|
|
134
|
-
)}
|
|
135
|
-
/>
|
|
136
|
-
|
|
137
|
-
<PrivateRoute
|
|
138
|
-
path={formStepRoutes.map((route) => `${path}/${route}`)}
|
|
139
|
-
component={(props) => (
|
|
140
|
-
<LayoutWrapper layoutClass="normal">
|
|
141
|
-
<EKYCForm {...props} path={path} />
|
|
142
|
-
</LayoutWrapper>
|
|
143
|
-
)}
|
|
144
|
-
/>
|
|
145
|
-
|
|
146
|
-
<PrivateRoute
|
|
147
|
-
path={`${path}/review/:kno`}
|
|
148
|
-
component={() => (
|
|
149
|
-
<LayoutWrapper layoutClass="action">
|
|
150
|
-
<Review />
|
|
151
|
-
</LayoutWrapper>
|
|
152
|
-
)}
|
|
153
|
-
/>
|
|
154
|
-
|
|
155
|
-
<PrivateRoute
|
|
156
|
-
path={`${path}/ceo-dashboard`}
|
|
157
|
-
component={() => (
|
|
158
|
-
<LayoutWrapper layoutClass="normal">
|
|
159
|
-
<CeoDashboard />
|
|
160
|
-
</LayoutWrapper>
|
|
161
|
-
)}
|
|
162
|
-
/>
|
|
163
|
-
|
|
164
|
-
<PrivateRoute
|
|
165
|
-
path={`${path}/vendors/:vendorId`}
|
|
166
|
-
component={() => (
|
|
167
|
-
<LayoutWrapper layoutClass="normal">
|
|
168
|
-
<VendorDetails />
|
|
169
|
-
</LayoutWrapper>
|
|
170
|
-
)}
|
|
171
|
-
/>
|
|
172
|
-
|
|
173
|
-
{/* <PrivateRoute
|
|
174
|
-
path={`${path}/`}
|
|
175
|
-
component={() => <Inbox parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />}
|
|
176
|
-
/> */}
|
|
177
|
-
</Switch>
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
</AppContainer>
|
|
181
|
-
);
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
export default EmployeeApp;
|
package/src/utils/index.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compares initial and current objects and returns an object containing only the differences.
|
|
3
|
-
* Highly optimized for partial updates (PATCH-like behavior).
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} initial - The original data from the backend.
|
|
6
|
-
* @param {Object} current - The current form state.
|
|
7
|
-
* @returns {Object} - An object with only the changed fields.
|
|
8
|
-
*/
|
|
9
|
-
export const getPayloadDiff = (initial, current) => {
|
|
10
|
-
const diff = {};
|
|
11
|
-
|
|
12
|
-
Object.keys(current).forEach(key => {
|
|
13
|
-
const initialVal = initial?.[key];
|
|
14
|
-
const currentVal = current[key];
|
|
15
|
-
|
|
16
|
-
// Handle nested objects (like addressDetails or aadhaarDetails)
|
|
17
|
-
if (currentVal && typeof currentVal === 'object' && !Array.isArray(currentVal) && !(currentVal instanceof File)) {
|
|
18
|
-
const nestedDiff = getPayloadDiff(initialVal || {}, currentVal);
|
|
19
|
-
if (Object.keys(nestedDiff).length > 0) {
|
|
20
|
-
diff[key] = nestedDiff;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
// Handle primitive types or arrays/files
|
|
24
|
-
else if (JSON.stringify(initialVal) !== JSON.stringify(currentVal)) {
|
|
25
|
-
diff[key] = currentVal;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return diff;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Safely retrieves and parses JSON data from sessionStorage.
|
|
34
|
-
* @param {string} key - The storage key.
|
|
35
|
-
* @param {*} fallback - Default value if no data is found.
|
|
36
|
-
* @returns {*} The parsed data or fallback.
|
|
37
|
-
*/
|
|
38
|
-
export const getSavedData = (key, fallback) => {
|
|
39
|
-
const saved = sessionStorage.getItem(key);
|
|
40
|
-
try {
|
|
41
|
-
return saved ? JSON.parse(saved) : fallback;
|
|
42
|
-
} catch (e) {
|
|
43
|
-
console.warn(`Error parsing sessionStorage key "${key}":`, e);
|
|
44
|
-
return fallback;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export const downloadSurveyorPDF = async ({
|
|
2
|
-
rows,
|
|
3
|
-
surveyorName,
|
|
4
|
-
employeeId,
|
|
5
|
-
mobileNumber,
|
|
6
|
-
vendorName,
|
|
7
|
-
supervisorName,
|
|
8
|
-
dashboardInfo,
|
|
9
|
-
t,
|
|
10
|
-
}) => {
|
|
11
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
12
|
-
const initData = Digit.SessionStorage.get("initData");
|
|
13
|
-
const tenants = initData?.tenants || [];
|
|
14
|
-
const tenantInfo = tenants.find((tenant) => tenant.code === tenantId);
|
|
15
|
-
|
|
16
|
-
const capitalize = (text) =>
|
|
17
|
-
text && text.substr(0, 1).toUpperCase() + text.substr(1);
|
|
18
|
-
const ulbCamel = (ulb) =>
|
|
19
|
-
ulb &&
|
|
20
|
-
ulb
|
|
21
|
-
.toLowerCase()
|
|
22
|
-
.split(" ")
|
|
23
|
-
.map(capitalize)
|
|
24
|
-
.join(" ");
|
|
25
|
-
|
|
26
|
-
const name = "Delhi Jal Board";
|
|
27
|
-
const email = "contact@delhijalboard.nic.in";
|
|
28
|
-
const phoneNumber = "+91-11-23538416";
|
|
29
|
-
|
|
30
|
-
const currentDate = new Date();
|
|
31
|
-
const formattedDate = currentDate.toLocaleDateString("en-IN", {
|
|
32
|
-
day: "2-digit",
|
|
33
|
-
month: "2-digit",
|
|
34
|
-
year: "numeric"
|
|
35
|
-
});
|
|
36
|
-
const formattedTime = currentDate.toLocaleTimeString("en-IN", {
|
|
37
|
-
hour: "2-digit",
|
|
38
|
-
minute: "2-digit",
|
|
39
|
-
second: "2-digit",
|
|
40
|
-
hour12: false
|
|
41
|
-
});
|
|
42
|
-
const downloadDateTime = `${formattedDate} ${formattedTime}`;
|
|
43
|
-
|
|
44
|
-
const details = [
|
|
45
|
-
{
|
|
46
|
-
title: t("SURVEYOR_DETAILS"),
|
|
47
|
-
asSectionHeader: true,
|
|
48
|
-
values: [
|
|
49
|
-
{ title: t("SURVEYOR_NAME"), value: surveyorName },
|
|
50
|
-
{ title: t("MOBILE_NUMBER"), value: mobileNumber },
|
|
51
|
-
{ title: t("VENDOR_NAME"), value: vendorName },
|
|
52
|
-
{ title: t("SUPERVISOR_NAME"), value: supervisorName }
|
|
53
|
-
].filter((item) => item.value),
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
title: t("SUMMARY_STATISTICS"),
|
|
57
|
-
asSectionHeader: true,
|
|
58
|
-
values: [
|
|
59
|
-
{ title: t("TOTAL_ASSIGNED"), value: dashboardInfo?.total || 0 },
|
|
60
|
-
{ title: t("COMPLETED"), value: dashboardInfo?.completed || 0 },
|
|
61
|
-
{ title: t("PENDING"), value: dashboardInfo?.pending || 0 },
|
|
62
|
-
{ title: t("SUBMITTED"), value: dashboardInfo?.submittedCount || 0 },
|
|
63
|
-
].filter((item) => item.value),
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
window.Digit &&
|
|
69
|
-
window.Digit.Utils &&
|
|
70
|
-
window.Digit.Utils.pdf &&
|
|
71
|
-
window.Digit.Utils.pdf.generateSurveyorReport
|
|
72
|
-
) {
|
|
73
|
-
window.Digit.Utils.pdf.generateSurveyorReport({
|
|
74
|
-
tenantId,
|
|
75
|
-
logo: null,
|
|
76
|
-
name,
|
|
77
|
-
email,
|
|
78
|
-
phoneNumber,
|
|
79
|
-
heading: t("EKYC_SURVEYOR_REPORT"),
|
|
80
|
-
details,
|
|
81
|
-
applicationNumber: employeeId,
|
|
82
|
-
rows,
|
|
83
|
-
t,
|
|
84
|
-
hideApplicationNumber: true,
|
|
85
|
-
downloadTime: downloadDateTime,
|
|
86
|
-
});
|
|
87
|
-
} else {
|
|
88
|
-
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
89
|
-
}
|
|
90
|
-
};
|