@djb25/digit-ui-module-ekyc 1.0.24 → 1.0.26
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2011 -1164
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -1
- package/src/Module.js +0 -2
- package/src/components/AadhaarVerification.js +239 -339
- package/src/components/AssignEkyc.js +10 -67
- package/src/components/AssignEkycModal.js +21 -4
- package/src/components/DesktopInbox.js +1 -1
- package/src/components/EKYCCard.js +6 -8
- package/src/components/MeterDetails.js +227 -263
- package/src/components/PropertyInfo.js +176 -215
- package/src/components/Review.js +70 -13
- package/src/components/SearchFormFieldsComponent.js +4 -4
- package/src/components/SurveyorDetailsCard.js +220 -27
- package/src/config/AadhaarVerificationConfig.js +367 -0
- package/src/config/MeterDetailsConfig.js +297 -0
- package/src/config/PropertyInfoConfig.js +145 -0
- package/src/config/config.js +1 -0
- package/src/hook/SupervisorInboxTableConfig.js +2 -53
- package/src/hook/useInboxTableConfig.js +5 -5
- package/src/pages/citizen/Inbox.js +19 -9
- package/src/pages/citizen/index.js +44 -17
- package/src/pages/employee/ConsumerDetails.js +82 -24
- package/src/pages/employee/EKYCForm.js +21 -20
- package/src/pages/employee/Inbox.js +13 -7
- package/src/pages/employee/index.js +42 -13
- package/src/utils/reportDownloader.js +75 -0
- package/src/components/AddressDetails.js +0 -207
|
@@ -7,9 +7,7 @@ import PropertyInfo from "../../components/PropertyInfo";
|
|
|
7
7
|
import MeterDetails from "../../components/MeterDetails";
|
|
8
8
|
import Review from "../../components/Review";
|
|
9
9
|
import Home from "./Home";
|
|
10
|
-
import Dashboard from "../../components/Dashboard";
|
|
11
10
|
import Inbox from "./Inbox";
|
|
12
|
-
import AddressDetails from "../../components/AddressDetails";
|
|
13
11
|
import AssignEkyc from "../../components/AssignEkyc";
|
|
14
12
|
import SurveyorDetailsCard from "../../components/SurveyorDetailsCard";
|
|
15
13
|
import VendorDetails from "../../components/VendorDetails";
|
|
@@ -21,21 +19,50 @@ const CitizenApp = () => {
|
|
|
21
19
|
|
|
22
20
|
sessionStorage.removeItem("revalidateddone");
|
|
23
21
|
|
|
24
|
-
const
|
|
22
|
+
const getDynamicBreadcrumbs = () => {
|
|
25
23
|
const pathname = location.pathname;
|
|
26
|
-
if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
|
|
27
|
-
if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
|
|
28
|
-
if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
|
|
29
|
-
if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
|
|
30
|
-
if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
|
|
31
|
-
if (pathname.includes("/review")) return "EKYC_REVIEW";
|
|
32
|
-
return "EKYC_HOME";
|
|
33
|
-
};
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
// Parent crumb — always present and clickable → redirects to eKYC citizen home
|
|
26
|
+
const crumbs = [
|
|
27
|
+
{ icon: HomeIcon, path: "/digit-ui/citizen" },
|
|
28
|
+
{ label: t("EKYC_MODULE_NAME"), path: `/digit-ui/citizen/ekyc` },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
// Child crumb — only appended when on a sub-page
|
|
32
|
+
if (pathname.includes("/create-kyc")) {
|
|
33
|
+
crumbs.push({ label: t("EKYC_CREATE_KYC") });
|
|
34
|
+
} else if (pathname.includes("/aadhaar-verification")) {
|
|
35
|
+
crumbs.push({ label: t("EKYC_AADHAAR_VERIFICATION") });
|
|
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/citizen/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/citizen/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("/surveyor-dashboard")) {
|
|
51
|
+
crumbs.push({ label: t("EKYC_SURVEYOR_DASHBOARD") });
|
|
52
|
+
} else if (pathname.includes("/dashboard")) {
|
|
53
|
+
crumbs.push({ label: t("EKYC_DASHBOARD") });
|
|
54
|
+
} else if (pathname.includes("/inbox")) {
|
|
55
|
+
crumbs.push({ label: t("EKYC_INBOX") });
|
|
56
|
+
} else if (pathname.includes("/status/")) {
|
|
57
|
+
crumbs.push({ label: t("EKYC_STATUS") });
|
|
58
|
+
}
|
|
59
|
+
// home (exact path) → no child crumb
|
|
60
|
+
|
|
61
|
+
return crumbs;
|
|
62
|
+
};
|
|
36
63
|
|
|
37
|
-
const roles = Digit.SessionStorage.get("User")?.info?.roles.map((ele) => ele.code);
|
|
38
|
-
const isEkyAction = (!roles?.includes("EKYC_SURVEYOR") || roles?.includes("EMPLOYEE"))
|
|
64
|
+
// const roles = Digit.SessionStorage.get("User")?.info?.roles.map((ele) => ele.code);
|
|
65
|
+
// const isEkyAction = (!roles?.includes("EKYC_SURVEYOR") || roles?.includes("EMPLOYEE"))
|
|
39
66
|
return (
|
|
40
67
|
<React.Fragment>
|
|
41
68
|
<div className="ground-container form-container">
|
|
@@ -47,7 +74,7 @@ const CitizenApp = () => {
|
|
|
47
74
|
</React.Fragment>
|
|
48
75
|
}
|
|
49
76
|
onLeftClick={() => window.history.back()}
|
|
50
|
-
breadcrumbs={
|
|
77
|
+
breadcrumbs={getDynamicBreadcrumbs()}
|
|
51
78
|
/>
|
|
52
79
|
|
|
53
80
|
<Switch>
|
|
@@ -86,14 +113,14 @@ const CitizenApp = () => {
|
|
|
86
113
|
)}
|
|
87
114
|
/>
|
|
88
115
|
|
|
89
|
-
<PrivateRoute
|
|
116
|
+
{/* <PrivateRoute
|
|
90
117
|
path={`${path}/address-details`}
|
|
91
118
|
component={() => (
|
|
92
119
|
<LayoutWrapper layoutClass="normal">
|
|
93
120
|
<AddressDetails />
|
|
94
121
|
</LayoutWrapper>
|
|
95
122
|
)}
|
|
96
|
-
/>
|
|
123
|
+
/> */}
|
|
97
124
|
|
|
98
125
|
<PrivateRoute
|
|
99
126
|
path={`${path}/property-info`}
|
|
@@ -1,38 +1,63 @@
|
|
|
1
|
-
import React, { useState, Fragment } from "react";
|
|
2
|
-
import { CardLabel, TextInput, Dropdown, UploadFile, Toast, FormStep } from "@djb25/digit-ui-react-components";
|
|
1
|
+
import React, { useState, Fragment, useEffect } from "react";
|
|
2
|
+
import { CardLabel, TextInput, Dropdown, UploadFile, Toast, FormStep, Loader } from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { useLocation } from "react-router-dom";
|
|
4
|
+
|
|
5
|
+
const ConsumerDetails = ({ config, onSelect, formData }) => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const flowState = location.state || {};
|
|
8
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
9
|
+
|
|
10
|
+
const queryParams = new URLSearchParams(location.search);
|
|
11
|
+
const urlKno = queryParams.get("kno");
|
|
12
|
+
|
|
13
|
+
const searchKno = urlKno || flowState?.kNumber || flowState?.kno || formData?.kNumber || formData?.kno || sessionStorage.getItem("EKYC_K_NUMBER") || "";
|
|
14
|
+
|
|
15
|
+
const { isLoading, data: searchData } = Digit.Hooks.ekyc.useSearchConnection(
|
|
16
|
+
{ tenantId, details: { kno: searchKno } },
|
|
17
|
+
{ enabled: !!searchKno, cacheTime: 0 }
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const savedData = formData?.consumerDetails || {};
|
|
3
21
|
|
|
4
|
-
const ConsumerDetails = ({ config, onSelect }) => {
|
|
5
22
|
// 🔹 STATES
|
|
6
|
-
const [kno, setKno] = useState("");
|
|
7
|
-
const [consumerType, setConsumerType] = useState(
|
|
8
|
-
|
|
9
|
-
|
|
23
|
+
const [kno, setKno] = useState(savedData.kno || "");
|
|
24
|
+
const [consumerType, setConsumerType] = useState(
|
|
25
|
+
savedData.consumerType ? { name: savedData.consumerType } : null
|
|
26
|
+
);
|
|
27
|
+
const [occupantType, setOccupantType] = useState(
|
|
28
|
+
savedData.occupantType ? { name: savedData.occupantType } : null
|
|
29
|
+
);
|
|
30
|
+
const [categoryType, setCategoryType] = useState(
|
|
31
|
+
savedData.categoryType ? { name: savedData.categoryType } : null
|
|
32
|
+
);
|
|
10
33
|
|
|
11
|
-
const [firstName, setFirstName] = useState("");
|
|
12
|
-
const [middleName, setMiddleName] = useState("");
|
|
13
|
-
const [lastName, setLastName] = useState("");
|
|
34
|
+
const [firstName, setFirstName] = useState(savedData.firstName || "");
|
|
35
|
+
const [middleName, setMiddleName] = useState(savedData.middleName || "");
|
|
36
|
+
const [lastName, setLastName] = useState(savedData.lastName || "");
|
|
14
37
|
|
|
15
|
-
const [gender, setGender] = useState(
|
|
38
|
+
const [gender, setGender] = useState(
|
|
39
|
+
savedData.gender ? { name: savedData.gender } : null
|
|
40
|
+
);
|
|
16
41
|
|
|
17
|
-
const [mobile, setMobile] = useState("");
|
|
18
|
-
const [whatsapp, setWhatsapp] = useState("");
|
|
19
|
-
const [email, setEmail] = useState("");
|
|
20
|
-
const [residents, setResidents] = useState("");
|
|
42
|
+
const [mobile, setMobile] = useState(savedData.mobile || "");
|
|
43
|
+
const [whatsapp, setWhatsapp] = useState(savedData.whatsapp || "");
|
|
44
|
+
const [email, setEmail] = useState(savedData.email || "");
|
|
45
|
+
const [residents, setResidents] = useState(savedData.residents || "");
|
|
21
46
|
|
|
22
47
|
// Tenant
|
|
23
48
|
const [, setDocumentProof] = useState(null);
|
|
24
|
-
const [documentId, setDocumentId] = useState(null);
|
|
25
|
-
const [ownerMobile, setOwnerMobile] = useState("");
|
|
26
|
-
const [tenantVerification, setTenantVerification] = useState("");
|
|
49
|
+
const [documentId, setDocumentId] = useState(savedData.documentId || null);
|
|
50
|
+
const [ownerMobile, setOwnerMobile] = useState(savedData.ownerMobile || "");
|
|
51
|
+
const [tenantVerification, setTenantVerification] = useState(savedData.tenantVerification || "");
|
|
27
52
|
|
|
28
53
|
// Govt
|
|
29
|
-
const [designation, setDesignation] = useState("");
|
|
30
|
-
const [department, setDepartment] = useState("");
|
|
31
|
-
const [employeeId, setEmployeeId] = useState("");
|
|
54
|
+
const [designation, setDesignation] = useState(savedData.designation || "");
|
|
55
|
+
const [department, setDepartment] = useState(savedData.department || "");
|
|
56
|
+
const [employeeId, setEmployeeId] = useState(savedData.employeeId || "");
|
|
32
57
|
|
|
33
58
|
// Other Entity
|
|
34
|
-
const [contactPerson, setContactPerson] = useState("");
|
|
35
|
-
const [entityName, setEntityName] = useState("");
|
|
59
|
+
const [contactPerson, setContactPerson] = useState(savedData.contactPerson || "");
|
|
60
|
+
const [entityName, setEntityName] = useState(savedData.entityName || "");
|
|
36
61
|
|
|
37
62
|
// Identity
|
|
38
63
|
|
|
@@ -45,6 +70,35 @@ const ConsumerDetails = ({ config, onSelect }) => {
|
|
|
45
70
|
|
|
46
71
|
const genderOptions = [{ name: "Male" }, { name: "Female" }, { name: "Others" }, { name: "Not prefer to say" }];
|
|
47
72
|
|
|
73
|
+
// 🔹 PREFILL FROM SEARCH DATA
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const rawData = searchData || formData?.connectionDetails;
|
|
76
|
+
const details = rawData?.connectionDetails || rawData || {};
|
|
77
|
+
|
|
78
|
+
if (searchKno && !kno) {
|
|
79
|
+
setKno(searchKno);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (details && Object.keys(details).length > 0 && !savedData.firstName) {
|
|
83
|
+
if (details.consumerName) {
|
|
84
|
+
const nameParts = details.consumerName.trim().split(/\s+/);
|
|
85
|
+
if (nameParts.length > 0) setFirstName(nameParts[0]);
|
|
86
|
+
if (nameParts.length > 2) {
|
|
87
|
+
setMiddleName(nameParts.slice(1, -1).join(" "));
|
|
88
|
+
setLastName(nameParts[nameParts.length - 1]);
|
|
89
|
+
} else if (nameParts.length === 2) {
|
|
90
|
+
setLastName(nameParts[1]);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (details.phoneNumber) {
|
|
94
|
+
setMobile(details.phoneNumber);
|
|
95
|
+
}
|
|
96
|
+
if (details.email) {
|
|
97
|
+
setEmail(details.email);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [searchData, formData?.connectionDetails, searchKno]);
|
|
101
|
+
|
|
48
102
|
// 🔹 FILE UPLOAD
|
|
49
103
|
const uploadFile = async (e, setter, idSetter) => {
|
|
50
104
|
const file = e.target.files[0];
|
|
@@ -74,7 +128,7 @@ const ConsumerDetails = ({ config, onSelect }) => {
|
|
|
74
128
|
|
|
75
129
|
if (occupantType?.name === "Tenanted" && !documentId && !ownerMobile) return false;
|
|
76
130
|
|
|
77
|
-
return
|
|
131
|
+
return true;
|
|
78
132
|
};
|
|
79
133
|
|
|
80
134
|
// 🔹 SUBMIT
|
|
@@ -110,6 +164,10 @@ const ConsumerDetails = ({ config, onSelect }) => {
|
|
|
110
164
|
onSelect(config.key, data);
|
|
111
165
|
};
|
|
112
166
|
|
|
167
|
+
if (isLoading) {
|
|
168
|
+
return <Loader />;
|
|
169
|
+
}
|
|
170
|
+
|
|
113
171
|
return (
|
|
114
172
|
<Fragment>
|
|
115
173
|
<FormStep onSelect={onStepSelect} config={config}>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { useQueryClient } from "react-query";
|
|
3
|
+
// import { useQueryClient } from "react-query";
|
|
4
4
|
import { Redirect, Route, Switch, useHistory, useLocation, useRouteMatch } from "react-router-dom";
|
|
5
|
-
import {
|
|
5
|
+
import { VerticalTimeline } from "@djb25/digit-ui-react-components";
|
|
6
6
|
import { ekycConfig } from "../../config/config";
|
|
7
7
|
|
|
8
8
|
const EKYCForm = ({ path: passedPath }) => {
|
|
9
|
-
const queryClient = useQueryClient();
|
|
9
|
+
// const queryClient = useQueryClient();
|
|
10
10
|
const match = useRouteMatch();
|
|
11
11
|
const { t } = useTranslation();
|
|
12
12
|
const location = useLocation();
|
|
@@ -14,9 +14,7 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
14
14
|
const history = useHistory();
|
|
15
15
|
|
|
16
16
|
let config = [];
|
|
17
|
-
const [params, setParams
|
|
18
|
-
const userInfo = Digit.UserService.getUser();
|
|
19
|
-
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
17
|
+
const [params, setParams] = Digit.Hooks.useSessionStorage("EKYC_CREATE", {});
|
|
20
18
|
|
|
21
19
|
useEffect(() => {
|
|
22
20
|
if (location.state && Object.keys(location.state).length > 0) {
|
|
@@ -31,7 +29,7 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
31
29
|
if (!routeObj) routeObj = config.find((routeObj) => routeObj.route === currentPath);
|
|
32
30
|
|
|
33
31
|
let nextStep = null;
|
|
34
|
-
const currentIndex = config.findIndex(c => c.route === routeObj.route);
|
|
32
|
+
const currentIndex = config.findIndex((c) => c.route === routeObj.route);
|
|
35
33
|
if (currentIndex > -1 && currentIndex < config.length - 1) {
|
|
36
34
|
nextStep = config[currentIndex + 1].route;
|
|
37
35
|
}
|
|
@@ -41,7 +39,7 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
41
39
|
redirectWithHistory = history.replace;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
const base = passedPath || match.path.split(
|
|
42
|
+
const base = passedPath || match.path.split("/").slice(0, -1).join("/");
|
|
45
43
|
if (nextStep === null) {
|
|
46
44
|
return redirectWithHistory(`${base}/review`, { ...params, edits: params });
|
|
47
45
|
}
|
|
@@ -49,15 +47,17 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
49
47
|
redirectWithHistory(`${base}/${nextStep}`, { ...params });
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
function handleSelect(key, data, skipStep, index, isAddMultiple = false) {
|
|
53
|
-
setParams({ ...
|
|
54
|
-
|
|
50
|
+
function handleSelect(key, data, skipStep, index, isAddMultiple = false, silent = false) {
|
|
51
|
+
setParams((prev) => ({ ...prev, [key]: { ...params[key], ...data } }));
|
|
52
|
+
if (!silent) {
|
|
53
|
+
goNext(skipStep, index, isAddMultiple, key);
|
|
54
|
+
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const onSuccess = () => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
57
|
+
// const onSuccess = () => {
|
|
58
|
+
// clearParams();
|
|
59
|
+
// queryClient.invalidateQueries("EKYC_CREATE");
|
|
60
|
+
// };
|
|
61
61
|
|
|
62
62
|
ekycConfig.forEach((obj) => {
|
|
63
63
|
config = config.concat(obj.body);
|
|
@@ -65,7 +65,7 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
65
65
|
|
|
66
66
|
config.indexRoute = "consumer-details";
|
|
67
67
|
|
|
68
|
-
const formStepRoutes = config.map(c => c.route);
|
|
68
|
+
const formStepRoutes = config.map((c) => c.route);
|
|
69
69
|
const isFormStep = formStepRoutes.some((route) => pathname.includes(route));
|
|
70
70
|
|
|
71
71
|
const sectionRefs = useRef({});
|
|
@@ -85,10 +85,10 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
85
85
|
<VerticalTimeline config={config} showFinalStep={true} />
|
|
86
86
|
<div className="employee-form-section">
|
|
87
87
|
<Switch>
|
|
88
|
-
<Route path={formStepRoutes.map((route) => `${
|
|
88
|
+
<Route path={formStepRoutes.map((route) => `${passedPath || match.path.split("/").slice(0, -1).join("/")}/${route}`)}>
|
|
89
89
|
<div className="single-page-form-container">
|
|
90
90
|
{config.map((routeObj, index) => {
|
|
91
|
-
const { component
|
|
91
|
+
const { component } = routeObj;
|
|
92
92
|
const Component = typeof component === "string" ? Digit.ComponentRegistryService.getComponent(component) : component;
|
|
93
93
|
|
|
94
94
|
return (
|
|
@@ -98,6 +98,7 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
98
98
|
onSelect={handleSelect}
|
|
99
99
|
t={t}
|
|
100
100
|
formData={params}
|
|
101
|
+
// formData={{ ...params, address: params.addressDetails }}
|
|
101
102
|
/>
|
|
102
103
|
</div>
|
|
103
104
|
);
|
|
@@ -105,7 +106,7 @@ const EKYCForm = ({ path: passedPath }) => {
|
|
|
105
106
|
</div>
|
|
106
107
|
</Route>
|
|
107
108
|
<Route>
|
|
108
|
-
<Redirect to={`${
|
|
109
|
+
<Redirect to={`${passedPath || match.path.split("/").slice(0, -1).join("/")}/${config.indexRoute}`} />
|
|
109
110
|
</Route>
|
|
110
111
|
</Switch>
|
|
111
112
|
</div>
|
|
@@ -24,7 +24,11 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
|
|
|
24
24
|
const [formState, dispatch] = useReducer(formReducer, formInitValue);
|
|
25
25
|
|
|
26
26
|
const filters = useMemo(() => {
|
|
27
|
-
|
|
27
|
+
const searchForm = formState?.searchForm || {};
|
|
28
|
+
return {
|
|
29
|
+
...searchForm,
|
|
30
|
+
...(searchForm.kNumber && { kno: searchForm.kNumber }),
|
|
31
|
+
};
|
|
28
32
|
}, [formState?.searchForm]);
|
|
29
33
|
|
|
30
34
|
const queryParams = useMemo(() => {
|
|
@@ -83,6 +87,7 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
|
|
|
83
87
|
applicationNumber: item.propertyInfo?.kno || "",
|
|
84
88
|
citizenName: item.connectionDetails?.consumerName || "",
|
|
85
89
|
status: item.connectionDetails?.statusflag || "",
|
|
90
|
+
ekycStatus: item.connectionDetails?.ekycStatus || item.connectionDetails?.ekycstatus || item.ekycStatus || item.ekycstatus || "NA",
|
|
86
91
|
sla: 0,
|
|
87
92
|
};
|
|
88
93
|
}
|
|
@@ -97,6 +102,7 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
|
|
|
97
102
|
applicationNumber: item.kno || item.applicationNumber || "",
|
|
98
103
|
citizenName: fullName || item.consumerName || item.citizenName || "",
|
|
99
104
|
status: item.status || "",
|
|
105
|
+
ekycStatus: item.ekycStatus || item.ekycstatus || "NA",
|
|
100
106
|
sla: item.sla ?? 0,
|
|
101
107
|
};
|
|
102
108
|
});
|
|
@@ -130,13 +136,13 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
|
|
|
130
136
|
};
|
|
131
137
|
|
|
132
138
|
const searchFormDefaultValues = {
|
|
133
|
-
|
|
139
|
+
kNumber: "",
|
|
134
140
|
applicationNumber: "",
|
|
135
141
|
consumerNo: "",
|
|
136
142
|
};
|
|
137
143
|
|
|
138
144
|
const onSearchFormReset = (setSearchFormValue) => {
|
|
139
|
-
setSearchFormValue("
|
|
145
|
+
setSearchFormValue("kNumber", null);
|
|
140
146
|
setSearchFormValue("applicationNumber", null);
|
|
141
147
|
setSearchFormValue("consumerNo", null);
|
|
142
148
|
dispatch({ action: "mutateSearchForm", data: searchFormDefaultValues });
|
|
@@ -158,10 +164,10 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
|
|
|
158
164
|
|
|
159
165
|
const propsForFilterForm = {
|
|
160
166
|
FilterFormFields,
|
|
161
|
-
onFilterFormSubmit: () => {},
|
|
167
|
+
onFilterFormSubmit: () => { },
|
|
162
168
|
filterFormDefaultValues: "",
|
|
163
169
|
resetFilterFormDefaultValues: "",
|
|
164
|
-
onFilterFormReset: () => {},
|
|
170
|
+
onFilterFormReset: () => { },
|
|
165
171
|
};
|
|
166
172
|
|
|
167
173
|
function formReducer(state, payload) {
|
|
@@ -243,9 +249,9 @@ const Inbox = ({ parentRoute, businessService = "EKYC", initialStates = {}, filt
|
|
|
243
249
|
<InboxComposer
|
|
244
250
|
{...{
|
|
245
251
|
isInboxLoading,
|
|
246
|
-
PropsForInboxLinks,
|
|
252
|
+
// PropsForInboxLinks,
|
|
247
253
|
...propsForSearchForm,
|
|
248
|
-
...propsForFilterForm,
|
|
254
|
+
// ...propsForFilterForm,
|
|
249
255
|
// ...propsForMobileSortForm,
|
|
250
256
|
propsForInboxTable,
|
|
251
257
|
// propsForInboxMobileCards,
|
|
@@ -19,20 +19,49 @@ const EmployeeApp = ({ path }) => {
|
|
|
19
19
|
|
|
20
20
|
sessionStorage.removeItem("revalidateddone");
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const getDynamicBreadcrumbs = () => {
|
|
23
23
|
const pathname = location.pathname;
|
|
24
|
-
if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
|
|
25
|
-
if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
|
|
26
|
-
if (pathname.includes("/k-details")) return "EKYC_K_DETAILS";
|
|
27
|
-
if (pathname.includes("/consumer-details")) return "EKYC_CONSUMER_DETAILS";
|
|
28
|
-
if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
|
|
29
|
-
if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
|
|
30
|
-
if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
|
|
31
|
-
if (pathname.includes("/review")) return "EKYC_REVIEW";
|
|
32
|
-
return "ES_COMMON_INBOX";
|
|
33
|
-
};
|
|
34
24
|
|
|
35
|
-
|
|
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
|
+
};
|
|
36
65
|
|
|
37
66
|
const formStepRoutes = ["consumer-details", "address-details", "property-info", "meter-details"];
|
|
38
67
|
|
|
@@ -47,7 +76,7 @@ const EmployeeApp = ({ path }) => {
|
|
|
47
76
|
</React.Fragment>
|
|
48
77
|
}
|
|
49
78
|
onLeftClick={() => window.history.back()}
|
|
50
|
-
breadcrumbs={
|
|
79
|
+
breadcrumbs={getDynamicBreadcrumbs()}
|
|
51
80
|
/>
|
|
52
81
|
|
|
53
82
|
<div className="employee-form">
|
|
@@ -0,0 +1,75 @@
|
|
|
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 details = [
|
|
31
|
+
{
|
|
32
|
+
title: t("SURVEYOR_DETAILS"),
|
|
33
|
+
asSectionHeader: true,
|
|
34
|
+
values: [
|
|
35
|
+
{ title: t("SURVEYOR_NAME"), value: surveyorName },
|
|
36
|
+
{ title: t("EMPLOYEE_ID"), value: employeeId },
|
|
37
|
+
{ title: t("MOBILE_NUMBER"), value: mobileNumber },
|
|
38
|
+
{ title: t("VENDOR_NAME"), value: vendorName },
|
|
39
|
+
{ title: t("SUPERVISOR_NAME"), value: supervisorName }
|
|
40
|
+
].filter((item) => item.value),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: t("SUMMARY_STATISTICS"),
|
|
44
|
+
asSectionHeader: true,
|
|
45
|
+
values: [
|
|
46
|
+
{ title: t("TOTAL_ASSIGNED"), value: dashboardInfo?.total || 0 },
|
|
47
|
+
{ title: t("COMPLETED"), value: dashboardInfo?.completed || 0 },
|
|
48
|
+
{ title: t("PENDING"), value: dashboardInfo?.pending || 0 },
|
|
49
|
+
{ title: t("SUBMITTED"), value: dashboardInfo?.submittedCount || 0 },
|
|
50
|
+
].filter((item) => item.value),
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
if (
|
|
55
|
+
window.Digit &&
|
|
56
|
+
window.Digit.Utils &&
|
|
57
|
+
window.Digit.Utils.pdf &&
|
|
58
|
+
window.Digit.Utils.pdf.generateSurveyorReport
|
|
59
|
+
) {
|
|
60
|
+
window.Digit.Utils.pdf.generateSurveyorReport({
|
|
61
|
+
tenantId,
|
|
62
|
+
logo: null,
|
|
63
|
+
name,
|
|
64
|
+
email,
|
|
65
|
+
phoneNumber,
|
|
66
|
+
heading: t("EKYC_SURVEYOR_REPORT"),
|
|
67
|
+
details,
|
|
68
|
+
applicationNumber: employeeId,
|
|
69
|
+
rows,
|
|
70
|
+
t,
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
console.error("Digit.Utils.pdf.generateSurveyorReport is not available");
|
|
74
|
+
}
|
|
75
|
+
};
|