@djb25/digit-ui-module-ekyc 1.0.23 → 1.0.25
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 +596 -558
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -1
- package/src/Module.js +0 -2
- package/src/components/AadhaarVerification.js +17 -54
- package/src/components/AssignEkyc.js +30 -100
- package/src/components/AssignEkycModal.js +21 -4
- package/src/components/EKYCCard.js +6 -8
- package/src/components/SearchFormFieldsComponent.js +4 -4
- package/src/components/SelectEkycZones.js +71 -0
- package/src/components/SurveyorDetailsCard.js +232 -30
- package/src/hook/SupervisorInboxTableConfig.js +2 -53
- package/src/hook/useInboxTableConfig.js +4 -4
- package/src/pages/citizen/Inbox.js +5 -5
- package/src/pages/citizen/index.js +44 -17
- package/src/pages/employee/EKYCForm.js +21 -20
- package/src/pages/employee/Inbox.js +11 -7
- package/src/pages/employee/index.js +42 -13
- package/src/utils/reportDownloader.js +75 -0
- package/src/components/AddressDetails.js +0 -207
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djb25/digit-ui-module-ekyc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Digit UI Module for Ekyc",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"microbundle-crl": "^0.13.11",
|
|
24
24
|
"react": "17.0.2",
|
|
25
25
|
"react-dom": "17.0.2",
|
|
26
|
+
"jspdf": "^2.5.1",
|
|
27
|
+
"jspdf-autotable": "^3.8.2",
|
|
26
28
|
"react-i18next": "11.16.2",
|
|
27
29
|
"react-icons": "^5.6.0",
|
|
28
30
|
"react-router-dom": "5.3.0",
|
package/src/Module.js
CHANGED
|
@@ -12,7 +12,6 @@ import CitizenApp from "./pages/citizen";
|
|
|
12
12
|
import PropertyInfo from "./components/PropertyInfo";
|
|
13
13
|
import MeterDetails from "./components/MeterDetails";
|
|
14
14
|
import AadhaarVerification from "./components/AadhaarVerification";
|
|
15
|
-
import AddressDetails from "./components/AddressDetails";
|
|
16
15
|
|
|
17
16
|
export const EkycModule = ({ stateCode, userType, tenants }) => {
|
|
18
17
|
const { path, url } = useRouteMatch();
|
|
@@ -66,7 +65,6 @@ const componentsToRegister = {
|
|
|
66
65
|
EKYC_INBOX_FILTER: (props) => <Filter {...props} />,
|
|
67
66
|
EkycLinks,
|
|
68
67
|
AadhaarVerification,
|
|
69
|
-
AddressDetails,
|
|
70
68
|
PropertyInfo,
|
|
71
69
|
MeterDetails,
|
|
72
70
|
};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
|
|
2
1
|
import React, { useState, Fragment, useEffect } from "react";
|
|
3
2
|
import { useLocation } from "react-router-dom";
|
|
4
|
-
import {
|
|
5
|
-
CardLabel,
|
|
6
|
-
TextInput,
|
|
7
|
-
Dropdown,
|
|
8
|
-
UploadFile,
|
|
9
|
-
RadioButtons,
|
|
10
|
-
Toast,
|
|
11
|
-
FormStep,
|
|
12
|
-
Loader,
|
|
13
|
-
CheckBox
|
|
14
|
-
} from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { CardLabel, TextInput, Dropdown, UploadFile, RadioButtons, Toast, FormStep, Loader, CheckBox } from "@djb25/digit-ui-react-components";
|
|
15
4
|
const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
16
5
|
const location = useLocation();
|
|
17
6
|
const flowState = location.state || {};
|
|
@@ -122,30 +111,13 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
122
111
|
}, [searchData, formData?.connectionDetails, searchKno]);
|
|
123
112
|
|
|
124
113
|
// 🔹 OPTIONS
|
|
125
|
-
const consumerTypeOptions = [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
];
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
{ name: "Self" },
|
|
133
|
-
{ name: "Tenanted" },
|
|
134
|
-
];
|
|
135
|
-
|
|
136
|
-
const genderOptions = [
|
|
137
|
-
{ name: "Male" },
|
|
138
|
-
{ name: "Female" },
|
|
139
|
-
{ name: "Others" },
|
|
140
|
-
{ name: "Not prefer to say" },
|
|
141
|
-
];
|
|
142
|
-
|
|
143
|
-
const identityTypeOptions = [
|
|
144
|
-
{ name: "Aadhaar Card" },
|
|
145
|
-
{ name: "Driving License" },
|
|
146
|
-
{ name: "Passport" },
|
|
147
|
-
{ name: "Voter ID" },
|
|
148
|
-
];
|
|
114
|
+
const consumerTypeOptions = [{ name: "Individual" }, { name: "Govt" }, { name: "Company_Society_Org" }];
|
|
115
|
+
|
|
116
|
+
const occupantOptions = [{ name: "Self" }, { name: "Tenanted" }];
|
|
117
|
+
|
|
118
|
+
const genderOptions = [{ name: "Male" }, { name: "Female" }, { name: "Others" }, { name: "Not prefer to say" }];
|
|
119
|
+
|
|
120
|
+
const identityTypeOptions = [{ name: "Aadhaar Card" }, { name: "Driving License" }, { name: "Passport" }, { name: "Voter ID" }];
|
|
149
121
|
|
|
150
122
|
const yesNo = [{ name: "Yes" }, { name: "No" }];
|
|
151
123
|
|
|
@@ -176,8 +148,7 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
176
148
|
if (!mobile) return false;
|
|
177
149
|
if (!residents || Number(residents) <= 0) return false;
|
|
178
150
|
|
|
179
|
-
if (occupantType?.name === "Tenanted" && !documentId && !ownerMobile)
|
|
180
|
-
return false;
|
|
151
|
+
if (occupantType?.name === "Tenanted" && !documentId && !ownerMobile) return false;
|
|
181
152
|
|
|
182
153
|
return consent; // consent must be true
|
|
183
154
|
};
|
|
@@ -230,7 +201,7 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
230
201
|
await updateMutation.mutateAsync({
|
|
231
202
|
RequestInfo: {},
|
|
232
203
|
updateType: "CONSUMER",
|
|
233
|
-
...data
|
|
204
|
+
...data,
|
|
234
205
|
});
|
|
235
206
|
setToast({ type: "success", message: "Data updated successfully!" });
|
|
236
207
|
onSelect(config.key, data);
|
|
@@ -246,7 +217,6 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
246
217
|
return (
|
|
247
218
|
<Fragment>
|
|
248
219
|
<FormStep onSelect={onStepSelect} config={config} isDisabled={!isValid()}>
|
|
249
|
-
|
|
250
220
|
<div>
|
|
251
221
|
<CardLabel>Consumer Type *</CardLabel>
|
|
252
222
|
<Dropdown option={consumerTypeOptions} selected={consumerType} select={setConsumerType} />
|
|
@@ -306,8 +276,7 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
306
276
|
<CardLabel>No. of Residents *</CardLabel>
|
|
307
277
|
<TextInput value={residents} onChange={(e) => setResidents(e.target.value)} />
|
|
308
278
|
</div>
|
|
309
|
-
<div>
|
|
310
|
-
{console.log("identityType",identityType)}
|
|
279
|
+
<div>
|
|
311
280
|
<CardLabel>Type of Identity *</CardLabel>
|
|
312
281
|
<Dropdown option={identityTypeOptions} selected={identityType} select={setIdentityType} />
|
|
313
282
|
</div>
|
|
@@ -322,10 +291,10 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
322
291
|
|
|
323
292
|
<div>
|
|
324
293
|
<CardLabel>Informant Is Consumer</CardLabel>
|
|
325
|
-
<CheckBox
|
|
326
|
-
label="Yes, the informant is the consumer"
|
|
327
|
-
checked={informantIsConsumer}
|
|
328
|
-
onChange={(e) => setInformantIsConsumer(e.target.checked)}
|
|
294
|
+
<CheckBox
|
|
295
|
+
label="Yes, the informant is the consumer"
|
|
296
|
+
checked={informantIsConsumer}
|
|
297
|
+
onChange={(e) => setInformantIsConsumer(e.target.checked)}
|
|
329
298
|
/>
|
|
330
299
|
</div>
|
|
331
300
|
|
|
@@ -401,15 +370,9 @@ const AadhaarVerification = ({ config, onSelect, formData }) => {
|
|
|
401
370
|
</Fragment>
|
|
402
371
|
)}
|
|
403
372
|
</FormStep>
|
|
404
|
-
{toast && (
|
|
405
|
-
<Toast
|
|
406
|
-
error={toast.type === "error"}
|
|
407
|
-
label={toast.message}
|
|
408
|
-
onClose={() => setToast(null)}
|
|
409
|
-
/>
|
|
410
|
-
)}
|
|
373
|
+
{toast && <Toast error={toast.type === "error"} label={toast.message} onClose={() => setToast(null)} />}
|
|
411
374
|
</Fragment>
|
|
412
375
|
);
|
|
413
376
|
};
|
|
414
377
|
|
|
415
|
-
export default AadhaarVerification;
|
|
378
|
+
export default AadhaarVerification;
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import React, { useMemo, useCallback, useReducer
|
|
2
|
-
import { useLocation } from "react-router-dom";
|
|
1
|
+
import React, { useMemo, useCallback, useReducer } from "react";
|
|
3
2
|
import { InboxComposer } from "@djb25/digit-ui-react-components";
|
|
4
3
|
import SupervisorInboxTableConfig from "../hook/SupervisorInboxTableConfig";
|
|
5
4
|
import SearchFormFieldsComponents from "./SearchFormFieldsComponent";
|
|
5
|
+
import { formInitValue, formReducer } from "../../../vendor/src/config/tableConfig";
|
|
6
6
|
|
|
7
7
|
// Mock data removed in favor of API integration
|
|
8
8
|
|
|
9
9
|
const AssignEkyc = () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
searchForm: {},
|
|
15
|
-
tableForm: {
|
|
16
|
-
limit: 10,
|
|
17
|
-
offset: 0,
|
|
18
|
-
sortBy: "createdTime",
|
|
19
|
-
sortOrder: "DESC",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
10
|
+
let tenantId = Digit.ULBService.getCurrentTenantId();
|
|
11
|
+
if (!tenantId || tenantId === "dl") {
|
|
12
|
+
tenantId = "dl.djb"; // Force tenantId to dl.djb for EKYC APIs in citizen portal
|
|
13
|
+
}
|
|
22
14
|
|
|
23
15
|
const [formState, dispatch] = useReducer(formReducer, formInitValue);
|
|
24
|
-
const userDetails = Digit.SessionStorage.get("User");
|
|
25
16
|
|
|
26
17
|
let paginationParms = {
|
|
27
18
|
limit: formState?.tableForm?.limit || 10,
|
|
@@ -30,84 +21,49 @@ const AssignEkyc = () => {
|
|
|
30
21
|
sortOrder: formState?.tableForm?.sortOrder || "DESC",
|
|
31
22
|
};
|
|
32
23
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
{ ...paginationParms, status: "ACTIVE,DISABLED", vendorId: userDetails?.info?.uuid },
|
|
36
|
-
{ enabled: !!tenantId, keepPreviousData: true }
|
|
37
|
-
);
|
|
24
|
+
const mobileNumber = formState?.searchForm?.mobileNumber || "";
|
|
25
|
+
const isSearchActive = !!mobileNumber;
|
|
38
26
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
[formState?.searchForm?.kNumber, formState?.searchForm?.kName]
|
|
45
|
-
);
|
|
27
|
+
const filters = {
|
|
28
|
+
...paginationParms,
|
|
29
|
+
status: "ACTIVE,DISABLED",
|
|
30
|
+
};
|
|
46
31
|
|
|
47
|
-
|
|
32
|
+
if (isSearchActive) {
|
|
33
|
+
filters.mobileNumber = mobileNumber;
|
|
34
|
+
}
|
|
48
35
|
|
|
49
|
-
const {
|
|
50
|
-
{
|
|
51
|
-
tenantId,
|
|
52
|
-
details: searchDetails,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
enabled: !!tenantId && !!searchDetails.kno, // 🔥 important
|
|
56
|
-
keepPreviousData: true,
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
const { isLoading: isDataSearchLoading, data } = Digit.Hooks.ekyc.useEkycAssignmentProgress(
|
|
60
|
-
{},
|
|
61
|
-
{
|
|
62
|
-
enabled: !!tenantId && !!searchDetails.kno, // 🔥 important
|
|
63
|
-
keepPreviousData: true,
|
|
64
|
-
}
|
|
65
|
-
);
|
|
36
|
+
const { data: dashboardData, isLoading } = Digit.Hooks.fsm.useSurveyorSearch(tenantId, filters, { enabled: !!tenantId, keepPreviousData: true });
|
|
66
37
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
38
|
+
const { isLoading: isDataSearchLoading, data } = Digit.Hooks.ekyc.useEkycAssignmentProgress({
|
|
39
|
+
enabled: !!tenantId,
|
|
40
|
+
keepPreviousData: true,
|
|
41
|
+
});
|
|
72
42
|
|
|
43
|
+
const sourceData = useMemo(() => {
|
|
73
44
|
return dashboardData?.surveyors || [];
|
|
74
|
-
}, [
|
|
45
|
+
}, [dashboardData]);
|
|
75
46
|
|
|
76
47
|
const filteredData = useMemo(() => {
|
|
77
48
|
return (sourceData || []).map((item) => {
|
|
78
49
|
const owner = item?.owner || {};
|
|
79
|
-
|
|
80
50
|
const roleCodes = owner?.roles?.map((role) => role.code)?.join(", ") || "";
|
|
81
51
|
|
|
82
52
|
return {
|
|
83
53
|
...item,
|
|
84
|
-
|
|
85
54
|
id: item?.id || "",
|
|
86
|
-
|
|
87
55
|
surveyorName: item?.name || owner?.name || "",
|
|
88
|
-
|
|
89
56
|
mobileNo: item?.mobileNo || owner?.mobileNumber || "",
|
|
90
|
-
|
|
91
57
|
email: owner?.emailId || "",
|
|
92
|
-
|
|
93
58
|
vendorId: item?.vendorId || "",
|
|
94
|
-
|
|
95
59
|
tenantId: item?.tenantId || "",
|
|
96
|
-
|
|
97
60
|
supervisorId: item?.supervisorId || "",
|
|
98
|
-
|
|
99
61
|
status: item?.status || "",
|
|
100
|
-
|
|
101
62
|
roleCodes,
|
|
102
|
-
|
|
103
63
|
userName: owner?.userName || "",
|
|
104
|
-
|
|
105
64
|
gender: owner?.gender || "",
|
|
106
|
-
|
|
107
65
|
serviceType: item?.additionalDetails?.serviceType || "",
|
|
108
|
-
|
|
109
66
|
createdTime: item?.auditDetails?.createdTime || 0,
|
|
110
|
-
|
|
111
67
|
lastModifiedTime: item?.auditDetails?.lastModifiedTime || 0,
|
|
112
68
|
};
|
|
113
69
|
});
|
|
@@ -115,9 +71,8 @@ const AssignEkyc = () => {
|
|
|
115
71
|
|
|
116
72
|
const totalRecords = dashboardData?.dashboardInfo?.totalRecords || dashboardData?.totalCount || 0;
|
|
117
73
|
|
|
118
|
-
const checkPathName = location.pathname.includes("ekyc/inbox");
|
|
119
74
|
const PropsForInboxLinks = {
|
|
120
|
-
headerText:
|
|
75
|
+
headerText: "EKYC_MODULE",
|
|
121
76
|
};
|
|
122
77
|
|
|
123
78
|
const SearchFormFields = useCallback(
|
|
@@ -136,8 +91,8 @@ const AssignEkyc = () => {
|
|
|
136
91
|
|
|
137
92
|
const onSearchFormSubmit = (data) => {
|
|
138
93
|
data.hasOwnProperty("") && delete data?.[""];
|
|
139
|
-
dispatch({ action: "mutateTableForm", data: { ...tableOrderFormDefaultValues }
|
|
140
|
-
dispatch({ action: "mutateSearchForm", data
|
|
94
|
+
dispatch({ action: "mutateTableForm", data: { ...tableOrderFormDefaultValues } });
|
|
95
|
+
dispatch({ action: "mutateSearchForm", data });
|
|
141
96
|
};
|
|
142
97
|
|
|
143
98
|
const searchFormDefaultValues = {
|
|
@@ -169,34 +124,12 @@ const AssignEkyc = () => {
|
|
|
169
124
|
|
|
170
125
|
const propsForFilterForm = {
|
|
171
126
|
FilterFormFields,
|
|
172
|
-
onFilterFormSubmit: () => {},
|
|
127
|
+
onFilterFormSubmit: () => { },
|
|
173
128
|
filterFormDefaultValues: "",
|
|
174
129
|
resetFilterFormDefaultValues: "",
|
|
175
|
-
onFilterFormReset: () => {},
|
|
130
|
+
onFilterFormReset: () => { },
|
|
176
131
|
};
|
|
177
132
|
|
|
178
|
-
function formReducer(state, payload) {
|
|
179
|
-
const storageKey = payload.checkPathName ? "EKYC.INBOX" : "EKYC.SW.INBOX";
|
|
180
|
-
|
|
181
|
-
// ✅ safety for SLA
|
|
182
|
-
switch (payload.action) {
|
|
183
|
-
case "mutateSearchForm":
|
|
184
|
-
Digit.SessionStorage.set(storageKey, { ...state, searchForm: payload.data });
|
|
185
|
-
return { ...state, searchForm: payload.data };
|
|
186
|
-
|
|
187
|
-
case "mutateFilterForm":
|
|
188
|
-
Digit.SessionStorage.set(storageKey, { ...state, filterForm: payload.data });
|
|
189
|
-
return { ...state, filterForm: payload.data };
|
|
190
|
-
|
|
191
|
-
case "mutateTableForm":
|
|
192
|
-
Digit.SessionStorage.set(storageKey, { ...state, tableForm: payload.data });
|
|
193
|
-
return { ...state, tableForm: payload.data };
|
|
194
|
-
|
|
195
|
-
default:
|
|
196
|
-
return state; // ✅ IMPORTANT
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
133
|
const onPageSizeChange = (e) => {
|
|
201
134
|
const newLimit = Number(e.target.value);
|
|
202
135
|
|
|
@@ -207,7 +140,6 @@ const AssignEkyc = () => {
|
|
|
207
140
|
limit: newLimit,
|
|
208
141
|
offset: 0, // reset page
|
|
209
142
|
},
|
|
210
|
-
checkPathName,
|
|
211
143
|
});
|
|
212
144
|
};
|
|
213
145
|
|
|
@@ -225,7 +157,6 @@ const AssignEkyc = () => {
|
|
|
225
157
|
sortBy: id,
|
|
226
158
|
sortOrder: desc ? "DESC" : "ASC",
|
|
227
159
|
},
|
|
228
|
-
checkPathName,
|
|
229
160
|
});
|
|
230
161
|
}
|
|
231
162
|
}
|
|
@@ -240,13 +171,12 @@ const AssignEkyc = () => {
|
|
|
240
171
|
dispatch,
|
|
241
172
|
onSortingByData,
|
|
242
173
|
tenantId,
|
|
243
|
-
checkPathName,
|
|
244
174
|
inboxStyles: { overflowX: "scroll", overflowY: "hidden" },
|
|
245
175
|
tableStyle: { width: "70%" },
|
|
246
176
|
},
|
|
247
177
|
});
|
|
248
178
|
|
|
249
|
-
const isInboxLoading = isLoading
|
|
179
|
+
const isInboxLoading = isLoading;
|
|
250
180
|
|
|
251
181
|
const cards = [
|
|
252
182
|
{
|
|
@@ -287,9 +217,9 @@ const AssignEkyc = () => {
|
|
|
287
217
|
<InboxComposer
|
|
288
218
|
{...{
|
|
289
219
|
isInboxLoading,
|
|
290
|
-
PropsForInboxLinks,
|
|
220
|
+
// PropsForInboxLinks,
|
|
291
221
|
...propsForSearchForm,
|
|
292
|
-
...propsForFilterForm,
|
|
222
|
+
// ...propsForFilterForm,
|
|
293
223
|
// ...propsForMobileSortForm,
|
|
294
224
|
propsForInboxTable,
|
|
295
225
|
// propsForInboxMobileCards,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect } from "react";
|
|
2
2
|
import { Modal, Close, Table, Toast } from "@djb25/digit-ui-react-components";
|
|
3
3
|
|
|
4
|
-
const AssignEkycModal = ({ surveyor, closeModal }) => {
|
|
4
|
+
const AssignEkycModal = ({ surveyor, closeModal, refetchDashboard }) => {
|
|
5
5
|
const [selectedKnos, setSelectedKnos] = useState([]);
|
|
6
6
|
const [isBulkSelection, setIsBulkSelection] = useState(false);
|
|
7
7
|
const [currentPage, setCurrentPage] = useState(0);
|
|
@@ -95,7 +95,8 @@ const AssignEkycModal = ({ surveyor, closeModal }) => {
|
|
|
95
95
|
setShowToast(true);
|
|
96
96
|
|
|
97
97
|
// optional delay so user can see the success toast
|
|
98
|
-
setTimeout(() => {
|
|
98
|
+
setTimeout(async () => {
|
|
99
|
+
await refetchDashboard();
|
|
99
100
|
closeModal();
|
|
100
101
|
}, 1000);
|
|
101
102
|
},
|
|
@@ -255,7 +256,23 @@ const AssignEkycModal = ({ surveyor, closeModal }) => {
|
|
|
255
256
|
onChange={(e) => handleFilterChange("zoneName", e.target.value)}
|
|
256
257
|
/>
|
|
257
258
|
|
|
258
|
-
|
|
259
|
+
{/* <SelectEkycZones
|
|
260
|
+
t={t}
|
|
261
|
+
isMultiSelect={false}
|
|
262
|
+
config={{
|
|
263
|
+
key: "zoneCode",
|
|
264
|
+
}}
|
|
265
|
+
formData={{
|
|
266
|
+
zoneIds: filters.zoneCode ? [{ code: filters.zoneCode, name: filters.zoneName }] : [],
|
|
267
|
+
}}
|
|
268
|
+
onSelect={(key, value) => {
|
|
269
|
+
console.log(value);
|
|
270
|
+
handleFilterChange("zoneName", value);
|
|
271
|
+
}}
|
|
272
|
+
placeHolder="Zones"
|
|
273
|
+
/> */}
|
|
274
|
+
|
|
275
|
+
{/* <input className="form-control" placeholder="Ward" value={filters.ward} onChange={(e) => handleFilterChange("ward", e.target.value)} />
|
|
259
276
|
|
|
260
277
|
<input
|
|
261
278
|
className="form-control"
|
|
@@ -271,7 +288,7 @@ const AssignEkycModal = ({ surveyor, closeModal }) => {
|
|
|
271
288
|
<option value="PENDING">Pending</option>
|
|
272
289
|
<option value="APPROVED">Approved</option>
|
|
273
290
|
<option value="REJECTED">Rejected</option>
|
|
274
|
-
</select>
|
|
291
|
+
</select> */}
|
|
275
292
|
</div>
|
|
276
293
|
|
|
277
294
|
{/* Table */}
|
|
@@ -17,9 +17,13 @@ const EKYCCard = () => {
|
|
|
17
17
|
],
|
|
18
18
|
links: [
|
|
19
19
|
{
|
|
20
|
-
label: t("
|
|
21
|
-
link: `/digit-ui/employee/ekyc/dashboard`,
|
|
20
|
+
label: t("CEO_M.F_DOR_FINANCE_VIEW"),
|
|
21
|
+
link: `/digit-ui/employee/ekyc/ceo-dashboard`,
|
|
22
22
|
},
|
|
23
|
+
// {
|
|
24
|
+
// label: t("EKYC_DASHBOARD"),
|
|
25
|
+
// link: `/digit-ui/employee/ekyc/dashboard`,
|
|
26
|
+
// },
|
|
23
27
|
{
|
|
24
28
|
label: t("EKYC_INBOX"),
|
|
25
29
|
link: `/digit-ui/employee/ekyc/inbox`,
|
|
@@ -32,16 +36,10 @@ const EKYCCard = () => {
|
|
|
32
36
|
// label: t("EKYC_UPDATE_KYC"),
|
|
33
37
|
// link: `/digit-ui/employee/ekyc/update-kyc`
|
|
34
38
|
// },
|
|
35
|
-
{
|
|
36
|
-
label: t("CEO_M.F_DOR_FINANCE_VIEW"),
|
|
37
|
-
link: `/digit-ui/employee/ekyc/ceo-dashboard`,
|
|
38
|
-
},
|
|
39
|
-
|
|
40
39
|
// {
|
|
41
40
|
// label: t("EKYC_MAPPING"),
|
|
42
41
|
// link: `/digit-ui/employee/ekyc/mapping`,
|
|
43
42
|
// },
|
|
44
|
-
|
|
45
43
|
{
|
|
46
44
|
label: t("EKYC_ASSIGN"),
|
|
47
45
|
link: `/digit-ui/employee/ekyc/assign`,
|
|
@@ -9,10 +9,10 @@ const SearchFormFieldsComponents = ({ searchFormState, controlSearchForm }) => {
|
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<React.Fragment>
|
|
12
|
-
{/*
|
|
12
|
+
{/* MOBILE NUMBER */}
|
|
13
13
|
<span className="mobile-input">
|
|
14
14
|
<Label className="flex-roww flex-gap-2">
|
|
15
|
-
{t("
|
|
15
|
+
{t("EKYC_K.NUMBER") || "K Number"}
|
|
16
16
|
<CustomTooltip message={t("EKYC_MOBILE_NUMBER_MESSAGE")} />
|
|
17
17
|
</Label>
|
|
18
18
|
|
|
@@ -22,8 +22,8 @@ const SearchFormFieldsComponents = ({ searchFormState, controlSearchForm }) => {
|
|
|
22
22
|
defaultValue=""
|
|
23
23
|
rules={{
|
|
24
24
|
pattern: {
|
|
25
|
-
value: /^[
|
|
26
|
-
message: t("
|
|
25
|
+
value: /^[0-9]{10}$/,
|
|
26
|
+
message: t("ERR_INVALID_KNO"),
|
|
27
27
|
},
|
|
28
28
|
}}
|
|
29
29
|
render={({ onChange, value }) => <TextInput value={value || ""} onChange={(e) => onChange(e.target.value)} />}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import { CardLabel, LabelFieldPair, MultiSelectDropdown, Loader } from "@djb25/digit-ui-react-components";
|
|
3
|
+
|
|
4
|
+
const SelectEkycZones = ({ config, onSelect, t, formData, isMultiSelect = true, placeHolder }) => {
|
|
5
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
6
|
+
|
|
7
|
+
const [zones, setZones] = useState([]);
|
|
8
|
+
|
|
9
|
+
const [selectedZones, setSelectedZones] = useState(Array.isArray(formData?.zoneIds) ? formData.zoneIds : []);
|
|
10
|
+
|
|
11
|
+
const { data: boundaryData, isLoading } = Digit.Hooks.useCommonMDMS(tenantId, "egov-location", ["TenantBoundary"]);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const tenantBoundary = boundaryData?.["egov-location"]?.TenantBoundary?.[0] || boundaryData?.MdmsRes?.["egov-location"]?.TenantBoundary?.[0];
|
|
15
|
+
|
|
16
|
+
const boundaries = tenantBoundary?.boundary || tenantBoundary?.children || [];
|
|
17
|
+
|
|
18
|
+
if (Array.isArray(boundaries?.children) && boundaries?.children.length > 0) {
|
|
19
|
+
const allZones = boundaries.children.flatMap((assembly) =>
|
|
20
|
+
(assembly?.children || []).map((zone) => ({
|
|
21
|
+
code: zone.code,
|
|
22
|
+
name: zone.name,
|
|
23
|
+
}))
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const zonesList = [...new Map(allZones.map((zone) => [zone.code, zone])).values()];
|
|
27
|
+
|
|
28
|
+
setZones(zonesList);
|
|
29
|
+
}
|
|
30
|
+
}, [boundaryData]);
|
|
31
|
+
|
|
32
|
+
const handleSelect = (value) => {
|
|
33
|
+
if (isMultiSelect) {
|
|
34
|
+
const extractedValue = Array.isArray(value) ? value.map((v) => (Array.isArray(v) ? v[1] : v)).filter(Boolean) : [];
|
|
35
|
+
|
|
36
|
+
setSelectedZones(extractedValue);
|
|
37
|
+
onSelect(config.key, extractedValue);
|
|
38
|
+
} else {
|
|
39
|
+
const selectedZone = Array.isArray(value) ? (Array.isArray(value[0]) ? value[0][1] : value[0]) : value;
|
|
40
|
+
|
|
41
|
+
setSelectedZones(selectedZone ? [selectedZone] : []);
|
|
42
|
+
|
|
43
|
+
onSelect(config.key, selectedZone?.code || "");
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if (isLoading) return <Loader />;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<LabelFieldPair>
|
|
51
|
+
<CardLabel>{t(config.label) + (config.isMandatory ? " *" : "")}</CardLabel>
|
|
52
|
+
|
|
53
|
+
<div className="field" style={{ position: "relative", zIndex: 10 }}>
|
|
54
|
+
<MultiSelectDropdown
|
|
55
|
+
options={zones}
|
|
56
|
+
selected={selectedZones}
|
|
57
|
+
onSelect={handleSelect}
|
|
58
|
+
optionsKey="name"
|
|
59
|
+
t={t}
|
|
60
|
+
multiple={isMultiSelect}
|
|
61
|
+
ServerStyle={{ backgroundColor: "#fff" }}
|
|
62
|
+
isMultiSelect={isMultiSelect}
|
|
63
|
+
placeHolder={placeHolder}
|
|
64
|
+
showSelectedLabels={true}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</LabelFieldPair>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default SelectEkycZones;
|