@djb25/digit-ui-module-ekyc 1.0.0 → 1.0.1
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 -0
- package/dist/index.modern.js +2965 -0
- package/dist/index.modern.js.map +1 -0
- package/package.json +1 -1
- package/src/Module.js +7 -23
- package/src/components/ConnectionDetailsView.js +130 -0
- package/src/components/DesktopInbox.js +84 -84
- package/src/components/Filter.js +59 -0
- package/src/components/MobileInbox.js +73 -0
- package/src/components/SearchConsumer.js +122 -0
- package/src/components/StatusCards.js +13 -22
- package/src/pages/employee/AadhaarVerification.js +356 -0
- package/src/pages/employee/AddressDetails.js +451 -0
- package/src/pages/employee/Create.js +94 -0
- package/src/pages/employee/Inbox.js +37 -20
- package/src/pages/employee/PropertyInfo.js +353 -0
- package/src/pages/employee/index.js +97 -0
- package/src/components/Search.js +0 -77
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import React, { useState, useRef } from "react";
|
|
2
|
+
import { Header, Card, LabelFieldPair, CardLabel, TextInput, SubmitBar, CardHeader, ActionBar, Dropdown, PropertyHouse, InfoBannerIcon, RemoveableTag, HomeIcon, ConnectingCheckPoints, CheckPoint } from "@djb25/digit-ui-react-components";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { useHistory, useLocation } from "react-router-dom";
|
|
5
|
+
|
|
6
|
+
const PropertyInfo = () => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const history = useHistory();
|
|
9
|
+
const location = useLocation();
|
|
10
|
+
|
|
11
|
+
const { kNumber } = location.state || { kNumber: "EKYC-1234567890" };
|
|
12
|
+
|
|
13
|
+
const [ownerType, setOwnerType] = useState("OWNER");
|
|
14
|
+
const [pidNumber, setPidNumber] = useState("");
|
|
15
|
+
const [connectionType, setConnectionType] = useState(null);
|
|
16
|
+
const [connectionCategory, setConnectionCategory] = useState(null);
|
|
17
|
+
const [userType, setUserType] = useState(null);
|
|
18
|
+
const [noOfFloors, setNoOfFloors] = useState(null);
|
|
19
|
+
const [propertyDocument, setPropertyDocument] = useState(null);
|
|
20
|
+
const [buildingPhoto, setBuildingPhoto] = useState(null);
|
|
21
|
+
const fileRef = useRef(null);
|
|
22
|
+
const cameraRef = useRef(null);
|
|
23
|
+
|
|
24
|
+
const handleSaveAndContinue = () => {
|
|
25
|
+
history.push("/digit-ui/employee/ekyc/dashboard");
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const SuitcaseIcon = () => (
|
|
29
|
+
<div style={{ backgroundColor: "#E8EAF6", padding: "8px", borderRadius: "8px", display: "flex", alignItems: "center", justifyContent: "center" }}>
|
|
30
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
31
|
+
<path d="M20 6H16V4C16 2.89 15.11 2 14 2H10C8.89 2 8 2.89 8 4V6H4C2.89 6 2 6.89 2 8V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V8C22 6.89 21.11 6 20 6ZM10 4H14V6H10V4ZM20 19H4V8H20V19ZM13 13V10H11V13H8L12 17L16 13H13Z" fill="#3D51B0" />
|
|
32
|
+
</svg>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const BuildingIcon = () => (
|
|
37
|
+
<div style={{ backgroundColor: "#E8EAF6", padding: "8px", borderRadius: "8px", display: "flex", alignItems: "center", justifyContent: "center" }}>
|
|
38
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
+
<path d="M12 7V3H2V21H22V7H12ZM6 19H4V17H6V19ZM6 15H4V13H6V15ZM6 11H4V9H6V11ZM6 7H4V5H6V7ZM10 19H8V17H10V19ZM10 15H8V13H10V15ZM10 11H8V9H10V11ZM10 7H8V5H10V7ZM20 19H12V9H20V19ZM18 11H14V13H18V11ZM18 15H14V17H18V15Z" fill="#3D51B0" />
|
|
40
|
+
</svg>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const PdfIcon = () => (
|
|
45
|
+
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
<path d="M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM13 9V3.5L18.5 9H13Z" fill="#1976D2" />
|
|
47
|
+
<path d="M11 14H13V18H11V14ZM11 12H13V13H11V12Z" fill="white" />
|
|
48
|
+
<path d="M8 16H9V17H8V16Z" fill="white" />
|
|
49
|
+
<path d="M15 16H16V17H15V16Z" fill="white" />
|
|
50
|
+
<path d="M12 15.5L14 13.5H10L12 15.5Z" fill="white" />
|
|
51
|
+
{/* Simple representation of upload arrow on document */}
|
|
52
|
+
<path d="M12 18V14M12 14L10 16M12 14L14 16" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
|
|
53
|
+
</svg>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const CameraIcon = () => (
|
|
57
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
58
|
+
<path d="M9 2L7.17 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6C22 4.9 21.1 4 20 4H16.83L15 2H9ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17ZM12 9C10.34 9 9 10.34 9 12C9 13.66 10.34 15 12 15C13.66 15 15 13.66 15 12C15 10.34 13.66 9 12 9Z" fill="#3D51B0" />
|
|
59
|
+
</svg>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div className="inbox-container">
|
|
64
|
+
<div className="filters-container">
|
|
65
|
+
{/* Sidebar Title Card */}
|
|
66
|
+
<Card className="sidebar-title-card" style={{ display: "flex", alignItems: "center", padding: "16px", marginBottom: "16px", borderRadius: "4px" }}>
|
|
67
|
+
<div className="icon-container" style={{ color: "#0068faff", marginRight: "12px" }}>
|
|
68
|
+
<HomeIcon style={{ width: "24px", height: "24px" }} />
|
|
69
|
+
</div>
|
|
70
|
+
<div style={{ fontWeight: "700", fontSize: "18px", color: "#0B0C0C" }}>
|
|
71
|
+
{t("EKYC_PROCESS")}
|
|
72
|
+
</div>
|
|
73
|
+
</Card>
|
|
74
|
+
|
|
75
|
+
{/* Progress Steps Sidebar */}
|
|
76
|
+
<div style={{ padding: "8px 16px" }}>
|
|
77
|
+
<ConnectingCheckPoints>
|
|
78
|
+
<CheckPoint label={t("EKYC_STEP_AADHAAR") || "Aadhaar"} isCompleted={true} />
|
|
79
|
+
<CheckPoint label={t("EKYC_STEP_ADDRESS") || "Address"} isCompleted={true} />
|
|
80
|
+
<CheckPoint label={t("EKYC_STEP_PROPERTY") || "Property"} isCompleted={false} />
|
|
81
|
+
<CheckPoint label={t("EKYC_STEP_REVIEW") || "Review"} />
|
|
82
|
+
</ConnectingCheckPoints>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div style={{ flex: 1, marginLeft: "16px" }}>
|
|
87
|
+
<Card>
|
|
88
|
+
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "24px" }}>
|
|
89
|
+
<Header>{t("Property Details")}</Header>
|
|
90
|
+
<div style={{ fontSize: "14px", fontWeight: "700", color: "#505A5F" }}>
|
|
91
|
+
{t("EKYC_K_NUMBER")}: <span style={{ color: "#0B0C0C" }}>{kNumber}</span>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div style={{ display: "flex", alignItems: "center", gap: "12px", marginBottom: "24px" }}>
|
|
96
|
+
<SuitcaseIcon />
|
|
97
|
+
<span style={{ fontSize: "20px", fontWeight: "700", color: "#101828" }}>{t("Property Details")}</span>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<Card style={{ padding: "20px", borderRadius: "16px", border: "1px solid #EAECF0", marginBottom: "24px" }}>
|
|
101
|
+
{/* Property Owner Selection */}
|
|
102
|
+
<div style={{ marginBottom: "24px" }}>
|
|
103
|
+
<CardLabel style={{ fontSize: "14px", fontWeight: "600", color: "#667085", marginBottom: "12px" }}>{t("Property_Owner")}</CardLabel>
|
|
104
|
+
<div style={{ display: "flex", backgroundColor: "#F2F4F7", padding: "4px", borderRadius: "12px" }}>
|
|
105
|
+
<button
|
|
106
|
+
onClick={() => setOwnerType("OWNER")}
|
|
107
|
+
style={{
|
|
108
|
+
flex: 1,
|
|
109
|
+
padding: "10px",
|
|
110
|
+
borderRadius: "10px",
|
|
111
|
+
border: "none",
|
|
112
|
+
backgroundColor: ownerType === "OWNER" ? "#3D51B0" : "transparent",
|
|
113
|
+
color: ownerType === "OWNER" ? "#FFFFFF" : "#667085",
|
|
114
|
+
fontWeight: "600",
|
|
115
|
+
cursor: "pointer",
|
|
116
|
+
transition: "all 0.2s"
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
{t("Owner")}
|
|
120
|
+
</button>
|
|
121
|
+
<button
|
|
122
|
+
onClick={() => setOwnerType("TENANT")}
|
|
123
|
+
style={{
|
|
124
|
+
flex: 1,
|
|
125
|
+
padding: "10px",
|
|
126
|
+
borderRadius: "10px",
|
|
127
|
+
border: "none",
|
|
128
|
+
backgroundColor: ownerType === "TENANT" ? "#3D51B0" : "transparent",
|
|
129
|
+
color: ownerType === "TENANT" ? "#FFFFFF" : "#667085",
|
|
130
|
+
fontWeight: "600",
|
|
131
|
+
cursor: "pointer",
|
|
132
|
+
transition: "all 0.2s"
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
{t("Tenant")}
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
{/* PID Number Section */}
|
|
141
|
+
<div style={{ marginBottom: "8px" }}>
|
|
142
|
+
<CardLabel style={{ fontSize: "14px", fontWeight: "600", color: "#667085", marginBottom: "12px" }}>
|
|
143
|
+
{t("PID_Number")} <span style={{ fontStyle: "italic", fontWeight: "400", color: "#98A2B3" }}>{t("Optional")}</span>
|
|
144
|
+
</CardLabel>
|
|
145
|
+
<div className="field" style={{ position: "relative" }}>
|
|
146
|
+
<TextInput
|
|
147
|
+
value={pidNumber}
|
|
148
|
+
onChange={(e) => setPidNumber(e.target.value)}
|
|
149
|
+
placeholder={t("Enter_PID_Number")}
|
|
150
|
+
textInputStyle={{ paddingLeft: "44px", borderRadius: "12px", border: "1px solid #D0D5DD", height: "56px" }}
|
|
151
|
+
/>
|
|
152
|
+
<div style={{ position: "absolute", left: "16px", top: "50%", transform: "translateY(-50%)", color: "#3D51B0", fontSize: "20px", fontWeight: "600" }}>#</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</Card>
|
|
156
|
+
|
|
157
|
+
{/* Building Info Section */}
|
|
158
|
+
<div style={{ display: "flex", alignItems: "center", gap: "12px", marginBottom: "24px" }}>
|
|
159
|
+
<BuildingIcon />
|
|
160
|
+
<span style={{ fontSize: "20px", fontWeight: "700", color: "#101828" }}>{t("Building_Info")}</span>
|
|
161
|
+
</div>
|
|
162
|
+
|
|
163
|
+
<Card style={{ padding: "20px", borderRadius: "16px", border: "1px solid #EAECF0", marginBottom: "24px" }}>
|
|
164
|
+
|
|
165
|
+
{/* Dropdowns */}
|
|
166
|
+
{[
|
|
167
|
+
{ label: "Type_of_Connection", state: connectionType, setState: setConnectionType },
|
|
168
|
+
{ label: "Connection_Category", state: connectionCategory, setState: setConnectionCategory },
|
|
169
|
+
{ label: "User_Type", state: userType, setState: setUserType },
|
|
170
|
+
{ label: "No_of_Floor", state: noOfFloors, setState: setNoOfFloors }
|
|
171
|
+
].map((item, idx) => (
|
|
172
|
+
<div key={idx} style={{ marginBottom: "20px" }}>
|
|
173
|
+
<CardLabel style={{ fontSize: "14px", fontWeight: "600", color: "#344054", marginBottom: "8px" }}>{t(item.label)}</CardLabel>
|
|
174
|
+
<Dropdown
|
|
175
|
+
selected={item.state}
|
|
176
|
+
select={item.setState}
|
|
177
|
+
option={[{ label: `Select ${item.label}`, value: "" }]}
|
|
178
|
+
optionKey="label"
|
|
179
|
+
t={t}
|
|
180
|
+
style={{ borderRadius: "12px", border: "1px solid #D0D5DD", height: "48px" }}
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
183
|
+
))}
|
|
184
|
+
<div
|
|
185
|
+
style={{
|
|
186
|
+
display: "flex",
|
|
187
|
+
gap: "24px",
|
|
188
|
+
alignItems: "stretch", // important
|
|
189
|
+
flexWrap: "wrap"
|
|
190
|
+
}}
|
|
191
|
+
>
|
|
192
|
+
{/* PDF Upload Box */}
|
|
193
|
+
<div
|
|
194
|
+
style={{
|
|
195
|
+
flex: 1,
|
|
196
|
+
minWidth: "300px",
|
|
197
|
+
display: "flex",
|
|
198
|
+
flexDirection: "column"
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
<CardLabel
|
|
202
|
+
style={{
|
|
203
|
+
fontSize: "14px",
|
|
204
|
+
fontWeight: "600",
|
|
205
|
+
color: "#344054",
|
|
206
|
+
marginBottom: "8px"
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
{t("Upload_Property_Document")}
|
|
210
|
+
</CardLabel>
|
|
211
|
+
|
|
212
|
+
<div
|
|
213
|
+
style={{
|
|
214
|
+
flex: 1, // important for equal height
|
|
215
|
+
backgroundColor: "#EBF5FF",
|
|
216
|
+
border: "1px solid #B2DDFF",
|
|
217
|
+
borderRadius: "16px",
|
|
218
|
+
padding: "32px 24px",
|
|
219
|
+
textAlign: "center",
|
|
220
|
+
cursor: "pointer",
|
|
221
|
+
display: "flex",
|
|
222
|
+
flexDirection: "column",
|
|
223
|
+
justifyContent: "center"
|
|
224
|
+
}}
|
|
225
|
+
onClick={() => fileRef.current.click()}
|
|
226
|
+
>
|
|
227
|
+
<input type="file" ref={fileRef} style={{ display: "none" }} accept=".pdf" />
|
|
228
|
+
|
|
229
|
+
<div
|
|
230
|
+
style={{
|
|
231
|
+
color: "#1570EF",
|
|
232
|
+
fontWeight: "600",
|
|
233
|
+
fontSize: "16px",
|
|
234
|
+
marginBottom: "20px",
|
|
235
|
+
lineHeight: "1.5"
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
{t("Upload_your_property_document_in_PDF_Only")}
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div style={{ display: "flex", justifyContent: "center" }}>
|
|
242
|
+
<div
|
|
243
|
+
style={{
|
|
244
|
+
backgroundColor: "#FFFFFF",
|
|
245
|
+
padding: "12px",
|
|
246
|
+
borderRadius: "12px",
|
|
247
|
+
boxShadow: "0px 1px 2px rgba(16, 24, 40, 0.05)"
|
|
248
|
+
}}
|
|
249
|
+
>
|
|
250
|
+
<PdfIcon />
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
|
|
256
|
+
{/* Capture Building Image */}
|
|
257
|
+
<div
|
|
258
|
+
style={{
|
|
259
|
+
flex: 1,
|
|
260
|
+
minWidth: "300px",
|
|
261
|
+
display: "flex",
|
|
262
|
+
flexDirection: "column"
|
|
263
|
+
}}
|
|
264
|
+
>
|
|
265
|
+
<CardLabel
|
|
266
|
+
style={{
|
|
267
|
+
fontSize: "14px",
|
|
268
|
+
fontWeight: "600",
|
|
269
|
+
color: "#344054",
|
|
270
|
+
marginBottom: "8px"
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
{t("Capture_Building_Image")}
|
|
274
|
+
</CardLabel>
|
|
275
|
+
|
|
276
|
+
<div
|
|
277
|
+
style={{
|
|
278
|
+
flex: 1, // important
|
|
279
|
+
border: "1px solid #D0D5DD",
|
|
280
|
+
borderRadius: "16px",
|
|
281
|
+
padding: "40px 24px",
|
|
282
|
+
textAlign: "center",
|
|
283
|
+
cursor: "pointer",
|
|
284
|
+
backgroundColor: "#FFFFFF",
|
|
285
|
+
display: "flex",
|
|
286
|
+
flexDirection: "column",
|
|
287
|
+
justifyContent: "center"
|
|
288
|
+
}}
|
|
289
|
+
onClick={() => cameraRef.current.click()}
|
|
290
|
+
>
|
|
291
|
+
<input
|
|
292
|
+
type="file"
|
|
293
|
+
ref={cameraRef}
|
|
294
|
+
style={{ display: "none" }}
|
|
295
|
+
accept="image/*"
|
|
296
|
+
capture="environment"
|
|
297
|
+
/>
|
|
298
|
+
|
|
299
|
+
<div
|
|
300
|
+
style={{
|
|
301
|
+
backgroundColor: "#EEF4FF",
|
|
302
|
+
width: "56px",
|
|
303
|
+
height: "56px",
|
|
304
|
+
borderRadius: "50%",
|
|
305
|
+
display: "flex",
|
|
306
|
+
alignItems: "center",
|
|
307
|
+
justifyContent: "center",
|
|
308
|
+
margin: "0 auto 16px"
|
|
309
|
+
}}
|
|
310
|
+
>
|
|
311
|
+
<CameraIcon />
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
<div
|
|
315
|
+
style={{
|
|
316
|
+
fontWeight: "600",
|
|
317
|
+
color: "#101828",
|
|
318
|
+
fontSize: "16px",
|
|
319
|
+
marginBottom: "4px"
|
|
320
|
+
}}
|
|
321
|
+
>
|
|
322
|
+
{t("Tap_to_Capture")}
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
<div style={{ color: "#667085", fontSize: "14px" }}>
|
|
326
|
+
{t("Building_Photo")}
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
{/* Info Banner */}
|
|
333
|
+
<div style={{ marginTop: "24px", backgroundColor: "#EFF8FF", padding: "16px", borderRadius: "12px", display: "flex", gap: "12px", border: "1px solid #B2DDFF" }}>
|
|
334
|
+
<div style={{ color: "#1570EF" }}>
|
|
335
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
336
|
+
<path d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V9H11V15ZM11 7H9V5H11V7Z" fill="currentColor" />
|
|
337
|
+
</svg>
|
|
338
|
+
</div>
|
|
339
|
+
<div style={{ color: "#175CD3", fontSize: "14px", fontWeight: "500", lineHeight: "1.4" }}>
|
|
340
|
+
{t("This_section_is_enabled_only_if_user_is_not_the_owner.")}
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
<SubmitBar label={t("Save_&_Continue")} onSubmit={handleSaveAndContinue} style={{ borderRadius: "8px", height: "48px", marginTop: "24px", marginRight: "1100px" }} />
|
|
344
|
+
</Card>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
</Card>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
);
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
export default PropertyInfo;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { AppContainer, PrivateRoute, ModuleHeader, ArrowLeft, HomeIcon } 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 Inbox from "./Inbox";
|
|
6
|
+
import Create from "./Create";
|
|
7
|
+
import AadhaarVerification from "./AadhaarVerification";
|
|
8
|
+
import AddressDetails from "./AddressDetails";
|
|
9
|
+
import PropertyInfo from "./PropertyInfo";
|
|
10
|
+
|
|
11
|
+
const EmployeeApp = ({ path }) => {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const location = useLocation();
|
|
14
|
+
|
|
15
|
+
sessionStorage.removeItem("revalidateddone");
|
|
16
|
+
|
|
17
|
+
const getBreadcrumbLabel = () => {
|
|
18
|
+
const pathname = location.pathname;
|
|
19
|
+
if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
|
|
20
|
+
if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
|
|
21
|
+
if (pathname.includes("/k-details")) return "EKYC_K_DETAILS";
|
|
22
|
+
if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
|
|
23
|
+
if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
|
|
24
|
+
if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
|
|
25
|
+
return "ES_COMMON_INBOX";
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const breadcrumbs = [
|
|
29
|
+
{ icon: HomeIcon, path: "/digit-ui/employee" },
|
|
30
|
+
{ label: t(getBreadcrumbLabel()) }
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<AppContainer>
|
|
35
|
+
<div className="ground-container employee-app-container">
|
|
36
|
+
<ModuleHeader
|
|
37
|
+
leftContent={
|
|
38
|
+
<React.Fragment>
|
|
39
|
+
<ArrowLeft className="icon" />
|
|
40
|
+
Back
|
|
41
|
+
</React.Fragment>
|
|
42
|
+
}
|
|
43
|
+
onLeftClick={() => window.history.back()}
|
|
44
|
+
breadcrumbs={breadcrumbs}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<Switch>
|
|
48
|
+
<PrivateRoute
|
|
49
|
+
path={`${path}/dashboard`}
|
|
50
|
+
component={() => (
|
|
51
|
+
<Inbox
|
|
52
|
+
parentRoute={path}
|
|
53
|
+
businessService="EKYC"
|
|
54
|
+
moduleCode="EKYC"
|
|
55
|
+
isInbox={true}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<PrivateRoute
|
|
61
|
+
path={`${path}/create-kyc`}
|
|
62
|
+
component={() => <Create />}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<PrivateRoute
|
|
66
|
+
path={`${path}/aadhaar-verification`}
|
|
67
|
+
component={() => <AadhaarVerification />}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<PrivateRoute
|
|
71
|
+
path={`${path}/address-details`}
|
|
72
|
+
component={() => <AddressDetails />}
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
<PrivateRoute
|
|
76
|
+
path={`${path}/property-info`}
|
|
77
|
+
component={() => <PropertyInfo />}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<PrivateRoute
|
|
81
|
+
path={`${path}/`}
|
|
82
|
+
component={() => (
|
|
83
|
+
<Inbox
|
|
84
|
+
parentRoute={path}
|
|
85
|
+
businessService="EKYC"
|
|
86
|
+
moduleCode="EKYC"
|
|
87
|
+
isInbox={true}
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
90
|
+
/>
|
|
91
|
+
</Switch>
|
|
92
|
+
</div>
|
|
93
|
+
</AppContainer>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default EmployeeApp;
|
package/src/components/Search.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { useForm, Controller } from "react-hook-form";
|
|
3
|
-
import { TextInput, Label, LinkLabel, Dropdown } from "@djb25/digit-ui-react-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
6
|
-
const SearchApplication = ({ onSearch, searchFields, searchParams }) => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const { register, handleSubmit, reset, watch, control } = useForm({
|
|
9
|
-
defaultValues: searchParams,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const onSubmitInput = (data) => {
|
|
13
|
-
onSearch(data);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
function clearSearch() {
|
|
17
|
-
const resetValues = searchFields.reduce((acc, field) => ({ ...acc, [field?.name]: "" }), {});
|
|
18
|
-
reset(resetValues);
|
|
19
|
-
onSearch({ ...resetValues });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Watch all fields
|
|
23
|
-
const watchedFields = watch();
|
|
24
|
-
const prevFields = useRef(watchedFields);
|
|
25
|
-
|
|
26
|
-
// Trigger search only when fields actually change and compare values to avoid loops
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const isChanged = JSON.stringify(prevFields.current) !== JSON.stringify(watchedFields);
|
|
29
|
-
if (isChanged) {
|
|
30
|
-
prevFields.current = watchedFields;
|
|
31
|
-
// Debounce or delay if needed, but for dropdowns immediate is fine
|
|
32
|
-
const timeoutId = setTimeout(() => {
|
|
33
|
-
onSearch(watchedFields);
|
|
34
|
-
}, 300); // Small debounce to be safe
|
|
35
|
-
return () => clearTimeout(timeoutId);
|
|
36
|
-
}
|
|
37
|
-
}, [watchedFields, onSearch]);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<form onSubmit={handleSubmit(onSubmitInput)} style={{ flex: 1 }}>
|
|
41
|
-
<div className="search-container" style={{ backgroundColor: "#ffffffff", padding: "24px" }}>
|
|
42
|
-
<div className="complaint-input-container" style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(700px, 1fr))", gap: "20px", alignItems: "end" }}>
|
|
43
|
-
{searchFields?.map((input) => (
|
|
44
|
-
<div key={input.name} className="input-fields">
|
|
45
|
-
<Label>{input.label}</Label>
|
|
46
|
-
{input.type === "dropdown" ? (
|
|
47
|
-
<Controller
|
|
48
|
-
control={control}
|
|
49
|
-
name={input.name}
|
|
50
|
-
render={(props) => (
|
|
51
|
-
<Dropdown
|
|
52
|
-
selected={props.value}
|
|
53
|
-
select={(val) => {
|
|
54
|
-
props.onChange(val);
|
|
55
|
-
}}
|
|
56
|
-
onBlur={props.onBlur}
|
|
57
|
-
option={input.options}
|
|
58
|
-
optionKey={input.optionsKey}
|
|
59
|
-
t={t}
|
|
60
|
-
/>
|
|
61
|
-
)}
|
|
62
|
-
/>
|
|
63
|
-
) : (
|
|
64
|
-
<TextInput {...input} inputRef={register} watch={watch} />
|
|
65
|
-
)}
|
|
66
|
-
</div>
|
|
67
|
-
))}
|
|
68
|
-
{/* <div className="search-submit-wrapper" style={{ display: "flex", alignItems: "center", gap: "20px", height: "40px" }}>
|
|
69
|
-
<LinkLabel onClick={clearSearch}>{t("ES_COMMON_CLEAR_ALL")}</LinkLabel>
|
|
70
|
-
</div> */}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
</form>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default SearchApplication;
|