@djb25/digit-ui-module-ekyc 1.0.13 → 1.0.15
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.css +54 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +3334 -3345
- package/dist/index.modern.js.map +1 -1
- package/package.json +34 -29
- package/src/Module.js +2 -5
- package/src/components/AssignEkyc.js +317 -0
- package/src/components/AssignEkycModal.js +362 -0
- package/src/components/CeoDashboard.js +255 -192
- package/src/components/CeoDashboard.jsx +334 -0
- package/src/components/DesktopInbox.js +8 -0
- package/src/components/EKYCCard.js +9 -3
- package/src/components/Review.js +155 -88
- package/src/components/StatusCards.js +6 -17
- package/src/components/SurveyorDetailsCard.js +282 -0
- package/src/components/VendorDetails.jsx +231 -0
- package/src/components/analytics/charts/ExecutiveBarChart.jsx +30 -0
- package/src/components/analytics/charts/ExecutiveLineChart.jsx +159 -0
- package/src/components/analytics/charts/ExecutivePieChart.jsx +24 -0
- package/src/components/analytics/charts/TaskStatusChart.js +1 -3
- package/src/components/analytics/components/DashboardLayout.js +26 -46
- package/src/components/mockData.js +772 -0
- package/src/hook/SupervisorInboxTableConfig.js +138 -0
- package/src/hook/useInboxTableConfig.js +12 -3
- package/src/pages/citizen/Home.js +27 -14
- package/src/pages/citizen/index.js +48 -1
- package/src/pages/employee/Mapping.js +162 -449
- package/src/pages/employee/index.js +96 -70
- package/src/components/analytics/styles/Dashboard.css +0 -54
package/package.json
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
"name": "@djb25/digit-ui-module-ekyc",
|
|
3
|
+
"version": "1.0.15",
|
|
4
|
+
"description": "Digit UI Module for Ekyc",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.modern.js",
|
|
7
|
+
"source": "src/Module.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
10
|
+
"build": "microbundle-crl --compress --no-sourcemap --format cjs",
|
|
11
|
+
"prepublish": "yarn build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"digit-ui",
|
|
15
|
+
"module",
|
|
16
|
+
"ekyc"
|
|
17
|
+
],
|
|
18
|
+
"author": "Shivam Nishad",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@djb25/digit-ui-react-components": "1.0.0",
|
|
22
|
+
"chart.js": "^4.4.1",
|
|
23
|
+
"microbundle-crl": "^0.13.11",
|
|
24
|
+
"react": "17.0.2",
|
|
25
|
+
"react-dom": "17.0.2",
|
|
26
|
+
"react-i18next": "11.16.2",
|
|
27
|
+
"react-icons": "^5.6.0",
|
|
28
|
+
"react-router-dom": "5.3.0",
|
|
29
|
+
"recharts": "^2.1.13",
|
|
30
|
+
"react-smooth": "2.0.1"
|
|
31
|
+
},
|
|
32
|
+
"resolutions": {
|
|
33
|
+
"fast-equals": "2.0.4"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/Module.js
CHANGED
|
@@ -13,13 +13,12 @@ import PropertyInfo from "./components/PropertyInfo";
|
|
|
13
13
|
import MeterDetails from "./components/MeterDetails";
|
|
14
14
|
import AadhaarVerification from "./components/AadhaarVerification";
|
|
15
15
|
import AddressDetails from "./components/AddressDetails";
|
|
16
|
-
import CeoDashboard from "./components/CeoDashboard";
|
|
17
|
-
export const EkycModule = ({ stateCode, userType, tenants }) => {
|
|
18
16
|
|
|
17
|
+
export const EkycModule = ({ stateCode, userType, tenants }) => {
|
|
19
18
|
const { path, url } = useRouteMatch();
|
|
20
19
|
const moduleCode = "EKYC";
|
|
21
20
|
const language = Digit.StoreData.getCurrentLanguage();
|
|
22
|
-
const { isLoading
|
|
21
|
+
const { isLoading } = Digit.Services.useStore({ stateCode, moduleCode, language });
|
|
23
22
|
|
|
24
23
|
Digit.SessionStorage.set("EKYC_TENANTS", tenants);
|
|
25
24
|
|
|
@@ -70,8 +69,6 @@ const componentsToRegister = {
|
|
|
70
69
|
AddressDetails,
|
|
71
70
|
PropertyInfo,
|
|
72
71
|
MeterDetails,
|
|
73
|
-
CeoDashboard,
|
|
74
|
-
|
|
75
72
|
};
|
|
76
73
|
|
|
77
74
|
export const initEkycComponents = () => {
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import React, { useMemo, useCallback, useReducer, useState } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
import { InboxComposer } from "@djb25/digit-ui-react-components";
|
|
4
|
+
import SupervisorInboxTableConfig from "../hook/SupervisorInboxTableConfig";
|
|
5
|
+
import SearchFormFieldsComponents from "./SearchFormFieldsComponent";
|
|
6
|
+
|
|
7
|
+
// Mock data removed in favor of API integration
|
|
8
|
+
|
|
9
|
+
const AssignEkyc = () => {
|
|
10
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
11
|
+
const location = useLocation();
|
|
12
|
+
const [sortParams, setSortParams] = useState([{ id: "", desc: true }]);
|
|
13
|
+
const [pageOffset, setPageOffset] = useState(0);
|
|
14
|
+
const [pageSize, setPageSize] = useState(10);
|
|
15
|
+
let paginationParms = { limit: pageSize, offset: pageOffset, sortBy: sortParams?.[0]?.id, sortOrder: sortParams?.[0]?.desc ? "DESC" : "ASC" };
|
|
16
|
+
|
|
17
|
+
const formInitValue = {
|
|
18
|
+
filterForm: {},
|
|
19
|
+
searchForm: {},
|
|
20
|
+
tableForm: {
|
|
21
|
+
limit: 10,
|
|
22
|
+
offset: 0,
|
|
23
|
+
sortBy: "createdTime",
|
|
24
|
+
sortOrder: "DESC",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const [formState, dispatch] = useReducer(formReducer, formInitValue);
|
|
29
|
+
|
|
30
|
+
const { data: dashboardData, isLoading } = Digit.Hooks.fsm.useSurveyorSearch(
|
|
31
|
+
tenantId,
|
|
32
|
+
{ ...paginationParms, status: "ACTIVE,DISABLED" },
|
|
33
|
+
{ enabled: !!tenantId, keepPreviousData: true }
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const handleSort = useCallback((args) => {
|
|
37
|
+
if (args?.length === 0) return;
|
|
38
|
+
setSortParams(args);
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
const fetchNextPage = () => {
|
|
42
|
+
setPageOffset((prevState) => prevState + pageSize);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const fetchPrevPage = () => {
|
|
46
|
+
setPageOffset((prevState) => prevState - pageSize);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handlePageSizeChange = (e) => {
|
|
50
|
+
setPageSize(Number(e.target.value));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const searchDetails = useMemo(
|
|
54
|
+
() => ({
|
|
55
|
+
kno: formState?.searchForm?.kNumber || "",
|
|
56
|
+
name: formState?.searchForm?.kName || "",
|
|
57
|
+
}),
|
|
58
|
+
[formState?.searchForm?.kNumber, formState?.searchForm?.kName]
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const isSearchActive = !!(searchDetails.kno || searchDetails.name);
|
|
62
|
+
|
|
63
|
+
const { isLoading: isSearchLoading, data: searchData } = Digit.Hooks.ekyc.useSearchConnection(
|
|
64
|
+
{
|
|
65
|
+
tenantId,
|
|
66
|
+
details: searchDetails,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
enabled: !!tenantId && !!searchDetails.kno, // 🔥 important
|
|
70
|
+
keepPreviousData: true,
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const sourceData = useMemo(() => {
|
|
75
|
+
if (isSearchActive) {
|
|
76
|
+
if (!searchData) return [];
|
|
77
|
+
return [searchData];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return dashboardData?.surveyors || [];
|
|
81
|
+
}, [isSearchActive, searchData, dashboardData]);
|
|
82
|
+
|
|
83
|
+
const filteredData = useMemo(() => {
|
|
84
|
+
return (sourceData || []).map((item) => {
|
|
85
|
+
const owner = item?.owner || {};
|
|
86
|
+
|
|
87
|
+
const roleCodes = owner?.roles?.map((role) => role.code)?.join(", ") || "";
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
...item,
|
|
91
|
+
|
|
92
|
+
id: item?.id || "",
|
|
93
|
+
|
|
94
|
+
surveyorName: item?.name || owner?.name || "",
|
|
95
|
+
|
|
96
|
+
mobileNo: item?.mobileNo || owner?.mobileNumber || "",
|
|
97
|
+
|
|
98
|
+
email: owner?.emailId || "",
|
|
99
|
+
|
|
100
|
+
vendorId: item?.vendorId || "",
|
|
101
|
+
|
|
102
|
+
tenantId: item?.tenantId || "",
|
|
103
|
+
|
|
104
|
+
supervisorId: item?.supervisorId || "",
|
|
105
|
+
|
|
106
|
+
status: item?.status || "",
|
|
107
|
+
|
|
108
|
+
roleCodes,
|
|
109
|
+
|
|
110
|
+
userName: owner?.userName || "",
|
|
111
|
+
|
|
112
|
+
gender: owner?.gender || "",
|
|
113
|
+
|
|
114
|
+
serviceType: item?.additionalDetails?.serviceType || "",
|
|
115
|
+
|
|
116
|
+
createdTime: item?.auditDetails?.createdTime || 0,
|
|
117
|
+
|
|
118
|
+
lastModifiedTime: item?.auditDetails?.lastModifiedTime || 0,
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
}, [sourceData]);
|
|
122
|
+
|
|
123
|
+
const totalRecords = dashboardData?.dashboardInfo?.totalRecords || dashboardData?.totalCount || 0;
|
|
124
|
+
|
|
125
|
+
const checkPathName = location.pathname.includes("ekyc/inbox");
|
|
126
|
+
const PropsForInboxLinks = {
|
|
127
|
+
headerText: checkPathName ? "EKYC_MODULE" : "MODULE_SW",
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const SearchFormFields = useCallback(
|
|
131
|
+
({ registerRef, searchFormState, controlSearchForm }) => (
|
|
132
|
+
<SearchFormFieldsComponents {...{ registerRef, searchFormState, controlSearchForm }} className="search" />
|
|
133
|
+
),
|
|
134
|
+
[]
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
const tableOrderFormDefaultValues = {
|
|
138
|
+
sortBy: "createdTime",
|
|
139
|
+
limit: window.Digit.Utils.browser.isMobile() ? 50 : 10,
|
|
140
|
+
offset: 0,
|
|
141
|
+
sortOrder: "DESC",
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const onSearchFormSubmit = (data) => {
|
|
145
|
+
data.hasOwnProperty("") && delete data?.[""];
|
|
146
|
+
dispatch({ action: "mutateTableForm", data: { ...tableOrderFormDefaultValues }, checkPathName });
|
|
147
|
+
dispatch({ action: "mutateSearchForm", data, checkPathName });
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const searchFormDefaultValues = {
|
|
151
|
+
mobileNumber: "",
|
|
152
|
+
applicationNumber: "",
|
|
153
|
+
consumerNo: "",
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const onSearchFormReset = (setSearchFormValue) => {
|
|
157
|
+
setSearchFormValue("mobileNumber", null);
|
|
158
|
+
setSearchFormValue("applicationNumber", null);
|
|
159
|
+
setSearchFormValue("consumerNo", null);
|
|
160
|
+
dispatch({ action: "mutateSearchForm", data: searchFormDefaultValues });
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const propsForSearchForm = {
|
|
164
|
+
SearchFormFields,
|
|
165
|
+
onSearchFormSubmit,
|
|
166
|
+
searchFormDefaultValues: formState?.searchForm,
|
|
167
|
+
resetSearchFormDefaultValues: searchFormDefaultValues,
|
|
168
|
+
onSearchFormReset,
|
|
169
|
+
className: "search-form-wns-inbox",
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const FilterFormFields = useCallback(
|
|
173
|
+
({ registerRef, controlFilterForm, setFilterFormValue, getFilterFormValue }) => <React.Fragment></React.Fragment>,
|
|
174
|
+
[]
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const propsForFilterForm = {
|
|
178
|
+
FilterFormFields,
|
|
179
|
+
onFilterFormSubmit: () => {},
|
|
180
|
+
filterFormDefaultValues: "",
|
|
181
|
+
resetFilterFormDefaultValues: "",
|
|
182
|
+
onFilterFormReset: () => {},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
function formReducer(state, payload) {
|
|
186
|
+
const storageKey = payload.checkPathName ? "EKYC.INBOX" : "EKYC.SW.INBOX";
|
|
187
|
+
|
|
188
|
+
// ✅ safety for SLA
|
|
189
|
+
switch (payload.action) {
|
|
190
|
+
case "mutateSearchForm":
|
|
191
|
+
Digit.SessionStorage.set(storageKey, { ...state, searchForm: payload.data });
|
|
192
|
+
return { ...state, searchForm: payload.data };
|
|
193
|
+
|
|
194
|
+
case "mutateFilterForm":
|
|
195
|
+
Digit.SessionStorage.set(storageKey, { ...state, filterForm: payload.data });
|
|
196
|
+
return { ...state, filterForm: payload.data };
|
|
197
|
+
|
|
198
|
+
case "mutateTableForm":
|
|
199
|
+
Digit.SessionStorage.set(storageKey, { ...state, tableForm: payload.data });
|
|
200
|
+
return { ...state, tableForm: payload.data };
|
|
201
|
+
|
|
202
|
+
default:
|
|
203
|
+
return state; // ✅ IMPORTANT
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const onPageSizeChange = (e) => {
|
|
208
|
+
const newLimit = Number(e.target.value);
|
|
209
|
+
|
|
210
|
+
dispatch({
|
|
211
|
+
action: "mutateTableForm",
|
|
212
|
+
data: {
|
|
213
|
+
...formState.tableForm,
|
|
214
|
+
limit: newLimit,
|
|
215
|
+
offset: 0, // reset page
|
|
216
|
+
},
|
|
217
|
+
checkPathName,
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const onSortingByData = (e) => {
|
|
222
|
+
if (e.length > 0) {
|
|
223
|
+
const [{ id, desc }] = e;
|
|
224
|
+
const sortOrder = desc ? "DESC" : "ASC";
|
|
225
|
+
const sortBy = id;
|
|
226
|
+
|
|
227
|
+
if (!(formState.tableForm.sortBy === sortBy && formState.tableForm.sortOrder === sortOrder)) {
|
|
228
|
+
dispatch({
|
|
229
|
+
action: "mutateTableForm",
|
|
230
|
+
data: {
|
|
231
|
+
...formState.tableForm,
|
|
232
|
+
sortBy: id,
|
|
233
|
+
sortOrder: desc ? "DESC" : "ASC",
|
|
234
|
+
},
|
|
235
|
+
checkPathName,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const propsForInboxTable = SupervisorInboxTableConfig({
|
|
242
|
+
...{
|
|
243
|
+
onPageSizeChange,
|
|
244
|
+
formState,
|
|
245
|
+
totalCount: totalRecords,
|
|
246
|
+
table: filteredData,
|
|
247
|
+
dispatch,
|
|
248
|
+
onSortingByData,
|
|
249
|
+
tenantId,
|
|
250
|
+
checkPathName,
|
|
251
|
+
inboxStyles: { overflowX: "scroll", overflowY: "hidden" },
|
|
252
|
+
tableStyle: { width: "70%" },
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
const isInboxLoading = isLoading || isSearchLoading;
|
|
257
|
+
|
|
258
|
+
const cards = [
|
|
259
|
+
{
|
|
260
|
+
label: "TOTAL_EKYC_APPLICATIONS",
|
|
261
|
+
count: 364,
|
|
262
|
+
color: "#0B2559",
|
|
263
|
+
filter: null,
|
|
264
|
+
active: true,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
label: "UNASSIGNED_APPLICATIONS",
|
|
268
|
+
count: 28,
|
|
269
|
+
color: "#F59E0B",
|
|
270
|
+
filter: ["UNASSIGNED"],
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
label: "ASSIGNED_TO_SURVEYOR",
|
|
274
|
+
count: 120,
|
|
275
|
+
color: "#3B82F6",
|
|
276
|
+
filter: ["ASSIGNED"],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
label: "IN_PROGRESS",
|
|
280
|
+
count: 54,
|
|
281
|
+
color: "#A855F7",
|
|
282
|
+
filter: ["IN_PROGRESS"],
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
label: "EKYC_COMPLETED",
|
|
286
|
+
count: 140,
|
|
287
|
+
color: "#10B981",
|
|
288
|
+
filter: ["COMPLETED"],
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
label: "REJECTED_APPLICATIONS",
|
|
292
|
+
count: 22,
|
|
293
|
+
color: "#EF4444",
|
|
294
|
+
filter: ["REJECTED"],
|
|
295
|
+
},
|
|
296
|
+
];
|
|
297
|
+
return (
|
|
298
|
+
<div className="app-container">
|
|
299
|
+
<InboxComposer
|
|
300
|
+
{...{
|
|
301
|
+
isInboxLoading,
|
|
302
|
+
PropsForInboxLinks,
|
|
303
|
+
...propsForSearchForm,
|
|
304
|
+
...propsForFilterForm,
|
|
305
|
+
// ...propsForMobileSortForm,
|
|
306
|
+
propsForInboxTable,
|
|
307
|
+
// propsForInboxMobileCards,
|
|
308
|
+
formState,
|
|
309
|
+
countData: dashboardData?.dashboardInfo,
|
|
310
|
+
cards,
|
|
311
|
+
}}
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export default AssignEkyc;
|