@djb25/digit-ui-module-ekyc 1.0.7 → 1.0.9
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 +3513 -3789
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/src/Module.js +49 -22
- package/src/components/ConnectionDetailsView.js +183 -60
- package/src/components/DesktopInbox.js +47 -165
- package/src/components/EKYCCard.js +35 -23
- package/src/components/Filter.js +48 -53
- package/src/components/SearchConsumer.js +104 -94
- package/src/components/SearchFormFieldsComponent.js +55 -0
- package/src/components/StatusCards.js +100 -118
- package/src/config/config.js +69 -0
- package/src/hook/useInboxTableConfig.js +134 -0
- package/src/pages/citizen/index.js +90 -0
- package/src/pages/employee/AadhaarVerification.js +473 -609
- package/src/pages/employee/AddressDetails.js +508 -732
- package/src/pages/employee/ConsumerDetails.js +512 -0
- package/src/pages/employee/Create.js +24 -22
- package/src/pages/employee/Dashboard.js +43 -0
- package/src/pages/employee/EKYCForm.js +117 -0
- package/src/pages/employee/Inbox.js +248 -140
- package/src/pages/employee/Mapping.js +645 -0
- package/src/pages/employee/MeterDetails.js +496 -0
- package/src/pages/employee/PropertyInfo.js +471 -560
- package/src/pages/employee/Review.js +268 -484
- package/src/pages/employee/Update.js +9 -0
- package/src/pages/employee/index.js +60 -82
|
@@ -1,173 +1,155 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import
|
|
3
|
+
import * as Chartjs from "chart.js/auto";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const getChartConstructor = () => {
|
|
6
|
+
const C = Chartjs.Chart || Chartjs.default || Chartjs;
|
|
7
|
+
return C;
|
|
8
|
+
};
|
|
6
9
|
|
|
7
10
|
const StatusCards = ({ countData }) => {
|
|
8
11
|
const { t } = useTranslation();
|
|
9
12
|
const chartRef1 = useRef(null);
|
|
10
13
|
const chartInstance1 = useRef(null);
|
|
11
|
-
const chartRef2 = useRef(null);
|
|
12
|
-
const chartInstance2 = useRef(null);
|
|
13
14
|
|
|
14
15
|
const total = countData?.total || 0;
|
|
15
16
|
const pending = countData?.pending || 0;
|
|
16
|
-
const active = countData?.completed || 0;
|
|
17
|
-
const completed = 0;
|
|
17
|
+
const active = countData?.completed || 0;
|
|
18
|
+
const completed = 0;
|
|
18
19
|
const rejected = countData?.rejected || 0;
|
|
19
20
|
|
|
20
21
|
const actualCompleted = countData?.completed || 0;
|
|
21
|
-
const applied = total;
|
|
22
22
|
const approved = actualCompleted;
|
|
23
23
|
|
|
24
24
|
const efficiency = total > 0 ? Math.round((actualCompleted / total) * 100) : 0;
|
|
25
|
+
const healthPct = total > 0 ? Math.round((approved / total) * 100) : 0;
|
|
26
|
+
|
|
27
|
+
const formatNumber = (num) => new Intl.NumberFormat("en-IN").format(num || 0);
|
|
25
28
|
|
|
26
29
|
useEffect(() => {
|
|
27
|
-
// Chart 1: Status Breakdown
|
|
28
30
|
if (chartRef1.current) {
|
|
29
31
|
if (chartInstance1.current) chartInstance1.current.destroy();
|
|
30
32
|
const ctx1 = chartRef1.current.getContext("2d");
|
|
31
|
-
|
|
33
|
+
const ChartConstructor = getChartConstructor();
|
|
34
|
+
chartInstance1.current = new ChartConstructor(ctx1, {
|
|
32
35
|
type: "doughnut",
|
|
33
36
|
data: {
|
|
34
|
-
labels: [t("EKYC_ACTIVE"), t("
|
|
35
|
-
datasets: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
labels: [t("EKYC_ACTIVE"), t("EKYC_PENDING"), t("EKYC_COMPLETED")],
|
|
38
|
+
datasets: [
|
|
39
|
+
{
|
|
40
|
+
data: [active, pending, completed],
|
|
41
|
+
backgroundColor: ["#0c2a52", "#77B6EA", "#c8ddf5"],
|
|
42
|
+
borderColor: ["#ffffff", "#ffffff", "#ffffff"],
|
|
43
|
+
borderWidth: 2,
|
|
44
|
+
hoverOffset: 4,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
42
47
|
},
|
|
43
48
|
options: {
|
|
44
49
|
cutout: "75%",
|
|
45
50
|
plugins: { legend: { display: false } },
|
|
46
|
-
maintainAspectRatio:
|
|
51
|
+
maintainAspectRatio: false,
|
|
47
52
|
responsive: true,
|
|
48
|
-
aspectRatio: 1,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Chart 2: Applied vs Approved
|
|
54
|
-
if (chartRef2.current) {
|
|
55
|
-
if (chartInstance2.current) chartInstance2.current.destroy();
|
|
56
|
-
const ctx2 = chartRef2.current.getContext("2d");
|
|
57
|
-
chartInstance2.current = new Chart(ctx2, {
|
|
58
|
-
type: "doughnut",
|
|
59
|
-
data: {
|
|
60
|
-
labels: [t("EKYC_APPROVED"), t("EKYC_OTHERS")],
|
|
61
|
-
datasets: [{
|
|
62
|
-
data: [approved, Math.max(0, applied - approved)],
|
|
63
|
-
backgroundColor: ["#219653", "#E0E0E0"],
|
|
64
|
-
borderColor: ["#ffffff", "#ffffff"],
|
|
65
|
-
borderWidth: 2,
|
|
66
|
-
hoverOffset: 4,
|
|
67
|
-
}],
|
|
68
|
-
},
|
|
69
|
-
options: {
|
|
70
|
-
cutout: "75%",
|
|
71
|
-
plugins: { legend: { display: false } },
|
|
72
|
-
maintainAspectRatio: true,
|
|
73
|
-
responsive: true,
|
|
74
|
-
aspectRatio: 1,
|
|
75
53
|
},
|
|
76
54
|
});
|
|
77
55
|
}
|
|
78
56
|
|
|
79
57
|
return () => {
|
|
80
58
|
if (chartInstance1.current) chartInstance1.current.destroy();
|
|
81
|
-
if (chartInstance2.current) chartInstance2.current.destroy();
|
|
82
59
|
};
|
|
83
|
-
}, [pending, completed, active,
|
|
60
|
+
}, [pending, completed, active, t]);
|
|
84
61
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
62
|
+
const legendItems = [
|
|
63
|
+
{ color: "#0c2a52", label: t("EKYC_ACTIVE"), value: active },
|
|
64
|
+
{ color: "#77B6EA", label: t("EKYC_PENDING"), value: pending },
|
|
65
|
+
{ color: "#c8ddf5", label: t("EKYC_COMPLETED"), value: completed },
|
|
66
|
+
];
|
|
88
67
|
|
|
89
68
|
return (
|
|
90
|
-
<div
|
|
91
|
-
<div
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<div style={{ display: "flex", flexDirection: "column", gap: "12px" }}>
|
|
100
|
-
{/* Active */}
|
|
101
|
-
<div style={{ display: "flex", alignItems: "center", gap: "10px" }}>
|
|
102
|
-
<span style={{ width: "12px", height: "12px", borderRadius: "50%", backgroundColor: "#1a3a6b", flexShrink: 0 }} />
|
|
103
|
-
<span style={{ fontSize: "14px", color: "#333" }}>
|
|
104
|
-
{t("EKYC_ACTIVE")}: <strong style={{ color: "#1a3a6b" }}>{formatNumber(active)}</strong>
|
|
105
|
-
</span>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
{/* Pending */}
|
|
109
|
-
<div style={{ display: "flex", alignItems: "center", gap: "10px" }}>
|
|
110
|
-
<span style={{ width: "12px", height: "12px", borderRadius: "50%", backgroundColor: "#3d84ed", flexShrink: 0 }} />
|
|
111
|
-
<span style={{ fontSize: "14px", color: "#333" }}>
|
|
112
|
-
{t("EKYC_PENDING")}: <strong style={{ color: "#1a3a6b" }}>{formatNumber(pending)}</strong>
|
|
113
|
-
</span>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
{/* Completed */}
|
|
117
|
-
<div style={{ display: "flex", alignItems: "center", gap: "10px" }}>
|
|
118
|
-
<span style={{ width: "12px", height: "12px", borderRadius: "50%", backgroundColor: "#77B6EA", flexShrink: 0 }} />
|
|
119
|
-
<span style={{ fontSize: "14px", color: "#333" }}>
|
|
120
|
-
{t("EKYC_COMPLETED")}: <strong style={{ color: "#1a3a6b" }}>{formatNumber(completed)}</strong>
|
|
121
|
-
</span>
|
|
69
|
+
<div className="ekyc-employee-container">
|
|
70
|
+
<div className="status-cards-wrapper">
|
|
71
|
+
{/* Header */}
|
|
72
|
+
<div className="status-cards-header">
|
|
73
|
+
<div>
|
|
74
|
+
<div className="eyebrow">
|
|
75
|
+
<span className="eyebrow-dot" />
|
|
76
|
+
{t("EKYC_INSTITUTIONAL_OVERVIEW") || "Institutional Performance Overview"}
|
|
122
77
|
</div>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
78
|
+
<h1 className="status-cards-h1">{t("EKYC_DASHBOARD_TITLE") || "eKYC Verification Dashboard"}</h1>
|
|
79
|
+
<p className="status-cards-subtitle">
|
|
80
|
+
{t("EKYC_DASHBOARD_SUBTITLE") ||
|
|
81
|
+
"Real-time monitoring of consumer verification workflows across all administrative zones."}
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
84
|
+
<div className="total-applications-card">
|
|
85
|
+
<div className="total-label">
|
|
86
|
+
{t("EKYC_TOTAL_APPLICATIONS") || "Total Applications Processed"}
|
|
132
87
|
</div>
|
|
88
|
+
<div className="total-number">{formatNumber(total)}</div>
|
|
89
|
+
<div className="total-badge">↗ +12.4% {t("EKYC_FROM_LAST_QUARTER") || "from last quarter"}</div>
|
|
133
90
|
</div>
|
|
134
91
|
</div>
|
|
135
92
|
|
|
136
|
-
{/*
|
|
137
|
-
<div
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<div
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
93
|
+
{/* Panels */}
|
|
94
|
+
<div className="status-panels-grid">
|
|
95
|
+
{/* Panel 1: Status Breakdown */}
|
|
96
|
+
<div className="status-panel">
|
|
97
|
+
<div className="panel-title">{t("EKYC_STATUS_BREAKDOWN") || "Status Breakdown"}</div>
|
|
98
|
+
<div className="panel-subtitle">
|
|
99
|
+
{t("EKYC_VERIFICATION_LIFECYCLE") || "Verification lifecycle distribution"}
|
|
100
|
+
</div>
|
|
101
|
+
<div className="breakdown-body">
|
|
102
|
+
<div className="status-legend">
|
|
103
|
+
{legendItems.map((item) => (
|
|
104
|
+
<div key={item.label} className="legend-row">
|
|
105
|
+
<span className="legend-label">
|
|
106
|
+
<span
|
|
107
|
+
className="indicator-dot"
|
|
108
|
+
style={{ background: item.color }}
|
|
109
|
+
/>
|
|
110
|
+
{item.label}
|
|
111
|
+
</span>
|
|
112
|
+
<span className="legend-value">{formatNumber(item.value)}</span>
|
|
113
|
+
</div>
|
|
114
|
+
))}
|
|
115
|
+
</div>
|
|
116
|
+
<div className="chart-wrapper">
|
|
117
|
+
<canvas ref={chartRef1} style={{ width: "100%", height: "100%" }} />
|
|
118
|
+
<div className="chart-center">
|
|
119
|
+
<div className="chart-percentage">{efficiency}%</div>
|
|
120
|
+
<div className="chart-label">{t("EKYC_COMPLETE") || "Complete"}</div>
|
|
149
121
|
</div>
|
|
150
122
|
</div>
|
|
151
123
|
</div>
|
|
152
|
-
<div style={{ marginTop: "8px", fontSize: "11px", fontWeight: "700", color: "#888", textTransform: "uppercase" }}>{t("EKYC_STATUS_BREAKDOWN")}</div>
|
|
153
124
|
</div>
|
|
154
125
|
|
|
155
|
-
{/*
|
|
156
|
-
<div
|
|
157
|
-
<div
|
|
158
|
-
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
126
|
+
{/* Panel 2: Submission Health */}
|
|
127
|
+
<div className="status-panel">
|
|
128
|
+
<div className="panel-title">
|
|
129
|
+
{t("EKYC_SUBMISSION_HEALTH") || "Submission Health"}
|
|
130
|
+
<span className="optimal-badge">{t("EKYC_OPTIMAL") || "Optimal"}</span>
|
|
131
|
+
</div>
|
|
132
|
+
<div className="panel-subtitle">
|
|
133
|
+
{t("EKYC_PLATFORM_EFFICIENCY") || "Platform operational efficiency"}
|
|
134
|
+
</div>
|
|
135
|
+
<div className="health-metrics-row">
|
|
136
|
+
<div className="health-percentage">{healthPct}%</div>
|
|
137
|
+
<div className="health-trend">↗ +2.1%</div>
|
|
138
|
+
</div>
|
|
139
|
+
<div className="status-progress-bar">
|
|
140
|
+
<div className="progress-fill" style={{ width: `${healthPct}%` }} />
|
|
141
|
+
</div>
|
|
142
|
+
<div className="mini-metrics-grid">
|
|
143
|
+
<div className="metric-box">
|
|
144
|
+
<div className="metric-label">{t("EKYC_AVG_LATENCY") || "Avg Latency"}</div>
|
|
145
|
+
<div className="metric-value">1.2s</div>
|
|
146
|
+
</div>
|
|
147
|
+
<div className="metric-box">
|
|
148
|
+
<div className="metric-label">{t("EKYC_ERROR_RATE") || "Error Rate"}</div>
|
|
149
|
+
<div className="metric-value">0.04%</div>
|
|
166
150
|
</div>
|
|
167
151
|
</div>
|
|
168
|
-
<div style={{ marginTop: "8px", fontSize: "11px", fontWeight: "700", color: "#888", textTransform: "uppercase" }}>{t("EKYC_SUBMISSION_HEALTH")}</div>
|
|
169
152
|
</div>
|
|
170
|
-
|
|
171
153
|
</div>
|
|
172
154
|
</div>
|
|
173
155
|
</div>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import AadhaarVerification from "../pages/employee/AadhaarVerification";
|
|
2
|
+
|
|
3
|
+
export const ekycConfig = [
|
|
4
|
+
{
|
|
5
|
+
body: [
|
|
6
|
+
{
|
|
7
|
+
route: "consumer-details",
|
|
8
|
+
component: AadhaarVerification,
|
|
9
|
+
key: "aadhaarVerification",
|
|
10
|
+
texts: {
|
|
11
|
+
header: "EKYC_CONSUMER_CONNECTION",
|
|
12
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
13
|
+
},
|
|
14
|
+
timeLine: [
|
|
15
|
+
{
|
|
16
|
+
currentStep: 1,
|
|
17
|
+
actions: "EKYC_CONSUMER_CONNECTION",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
route: "address-details",
|
|
23
|
+
component: "AddressDetails",
|
|
24
|
+
key: "addressDetails",
|
|
25
|
+
doorImage: true,
|
|
26
|
+
texts: {
|
|
27
|
+
header: "EKYC_ADDRESS_DETAILS",
|
|
28
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
29
|
+
},
|
|
30
|
+
timeLine: [
|
|
31
|
+
{
|
|
32
|
+
currentStep: 2,
|
|
33
|
+
actions: "EKYC_ADDRESS_DETAILS",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
route: "property-info",
|
|
39
|
+
component: "PropertyInfo",
|
|
40
|
+
key: "propertyDetails",
|
|
41
|
+
texts: {
|
|
42
|
+
header: "EKYC_PROPERTY_INFO",
|
|
43
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
44
|
+
},
|
|
45
|
+
timeLine: [
|
|
46
|
+
{
|
|
47
|
+
currentStep: 3,
|
|
48
|
+
actions: "EKYC_PROPERTY_INFO",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
route: "meter-details",
|
|
54
|
+
component: "MeterDetails",
|
|
55
|
+
key: "meterDetails",
|
|
56
|
+
texts: {
|
|
57
|
+
header: "EKYC_METER_DETAILS",
|
|
58
|
+
submitBarLabel: "COMMON_SAVE_NEXT",
|
|
59
|
+
},
|
|
60
|
+
timeLine: [
|
|
61
|
+
{
|
|
62
|
+
currentStep: 4,
|
|
63
|
+
actions: "EKYC_METER_DETAILS",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { useHistory } from "react-router-dom";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
|
|
5
|
+
const useInboxTableConfig = ({
|
|
6
|
+
parentRoute,
|
|
7
|
+
onPageSizeChange,
|
|
8
|
+
formState,
|
|
9
|
+
totalCount,
|
|
10
|
+
table,
|
|
11
|
+
dispatch,
|
|
12
|
+
checkPathName,
|
|
13
|
+
onSortingByData,
|
|
14
|
+
tenantId,
|
|
15
|
+
inboxStyles = {},
|
|
16
|
+
tableStyle = {},
|
|
17
|
+
}) => {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const history = useHistory();
|
|
20
|
+
const [selectedKno, setSelectedKno] = useState("");
|
|
21
|
+
const { data: reviewData, getReview } = Digit.Hooks.ekyc.useEkycAPI("review", tenantId);
|
|
22
|
+
const handleReview = (kno) => {
|
|
23
|
+
setSelectedKno(kno);
|
|
24
|
+
getReview({ kno });
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const limit = formState?.tableForm?.limit || 10;
|
|
28
|
+
const offset = formState?.tableForm?.offset || 0;
|
|
29
|
+
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (reviewData) {
|
|
32
|
+
history.push("/digit-ui/employee/ekyc/review", { kNumber: selectedKno, aadhaarData: reviewData?.aadhaarData, reviewData });
|
|
33
|
+
}
|
|
34
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
+
}, [reviewData]);
|
|
36
|
+
|
|
37
|
+
const tableColumnConfig = [
|
|
38
|
+
{
|
|
39
|
+
Header: t("EKYC_APPLICATION_NO"),
|
|
40
|
+
accessor: "applicationNumber",
|
|
41
|
+
disableSortBy: true,
|
|
42
|
+
Cell: ({ row }) => {
|
|
43
|
+
const kno = row.original?.kno || row.original?.applicationNumber || "NA";
|
|
44
|
+
return (
|
|
45
|
+
<span
|
|
46
|
+
className="ekyc-application-link"
|
|
47
|
+
style={{ color: "#add8f7", cursor: "pointer", fontWeight: "bold" }}
|
|
48
|
+
onClick={() => handleReview(kno)}
|
|
49
|
+
>
|
|
50
|
+
{kno}
|
|
51
|
+
</span>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
Header: t("EKYC_CITIZEN_NAME"),
|
|
57
|
+
accessor: "citizenName",
|
|
58
|
+
Cell: ({ row }) => <span>{row.original?.citizenName || "NA"}</span>,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Header: t("EKYC_STATUS"),
|
|
62
|
+
accessor: "actionStatus",
|
|
63
|
+
Cell: ({ row }) => {
|
|
64
|
+
const status = row.original?.status || "DEFAULT";
|
|
65
|
+
return <span className={`ekyc-status-tag ${status}`}>{t(`${status}`)}</span>;
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
Header: t("EKYC_ACTION"),
|
|
70
|
+
accessor: "status",
|
|
71
|
+
Cell: ({ row }) => {
|
|
72
|
+
const kno = row.original?.kno || row.original?.applicationNumber || "NA";
|
|
73
|
+
return (
|
|
74
|
+
<span
|
|
75
|
+
className="ekyc-application-link"
|
|
76
|
+
style={{ color: "#add8f7", cursor: "pointer", fontWeight: "bold" }}
|
|
77
|
+
onClick={() => handleReview(kno)}
|
|
78
|
+
>
|
|
79
|
+
{t("EKYC_REVIEW")}
|
|
80
|
+
</span>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
getCellProps: (cellInfo) => {
|
|
88
|
+
return {
|
|
89
|
+
style: {
|
|
90
|
+
padding: "8px",
|
|
91
|
+
fontSize: "12px",
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
disableSort: false,
|
|
96
|
+
autoSort: false,
|
|
97
|
+
manualPagination: true,
|
|
98
|
+
initSortId: "applicationDate",
|
|
99
|
+
onPageSizeChange: onPageSizeChange,
|
|
100
|
+
currentPage: Math.floor(offset / limit),
|
|
101
|
+
onNextPage: () =>
|
|
102
|
+
dispatch({
|
|
103
|
+
action: "mutateTableForm",
|
|
104
|
+
data: { ...formState.tableForm, offset: parseInt(formState.tableForm?.offset) + parseInt(formState.tableForm?.limit) },
|
|
105
|
+
checkPathName,
|
|
106
|
+
}),
|
|
107
|
+
onPrevPage: () =>
|
|
108
|
+
dispatch({
|
|
109
|
+
action: "mutateTableForm",
|
|
110
|
+
data: { ...formState.tableForm, offset: parseInt(formState.tableForm?.offset) - parseInt(formState.tableForm?.limit) },
|
|
111
|
+
checkPathName,
|
|
112
|
+
}),
|
|
113
|
+
pageSizeLimit: limit,
|
|
114
|
+
onSort: onSortingByData,
|
|
115
|
+
// sortParams: [{id: getValues("sortBy"), desc: getValues("sortOrder") === "DESC" ? true : false}],
|
|
116
|
+
totalRecords: totalCount,
|
|
117
|
+
onSearch: formState?.searchForm?.message,
|
|
118
|
+
onLastPage: () =>
|
|
119
|
+
dispatch({
|
|
120
|
+
action: "mutateTableForm",
|
|
121
|
+
data: { ...formState.tableForm, offset: Math.ceil(totalCount / 10) * 10 - parseInt(formState.tableForm?.limit) },
|
|
122
|
+
checkPathName,
|
|
123
|
+
}),
|
|
124
|
+
onFirstPage: () => dispatch({ action: "mutateTableForm", data: { ...formState.tableForm, offset: 0 }, checkPathName }),
|
|
125
|
+
// globalSearch: {searchForItemsInTable},
|
|
126
|
+
// searchQueryForTable,
|
|
127
|
+
data: table,
|
|
128
|
+
columns: tableColumnConfig,
|
|
129
|
+
inboxStyles: { ...inboxStyles },
|
|
130
|
+
tableStyle: { ...tableStyle },
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export default useInboxTableConfig;
|
|
@@ -0,0 +1,90 @@
|
|
|
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, useRouteMatch } from "react-router-dom";
|
|
5
|
+
import Create from "../employee/Create";
|
|
6
|
+
import AadhaarVerification from "../employee/AadhaarVerification";
|
|
7
|
+
import AddressDetails from "../employee/AddressDetails";
|
|
8
|
+
import PropertyInfo from "../employee/PropertyInfo";
|
|
9
|
+
import MeterDetails from "../employee/MeterDetails";
|
|
10
|
+
import Review from "../employee/Review";
|
|
11
|
+
|
|
12
|
+
const CitizenApp = () => {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
const location = useLocation();
|
|
15
|
+
const { path } = useRouteMatch();
|
|
16
|
+
|
|
17
|
+
sessionStorage.removeItem("revalidateddone");
|
|
18
|
+
|
|
19
|
+
const getBreadcrumbLabel = () => {
|
|
20
|
+
const pathname = location.pathname;
|
|
21
|
+
if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
|
|
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
|
+
if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
|
|
26
|
+
if (pathname.includes("/review")) return "EKYC_REVIEW";
|
|
27
|
+
return "EKYC_HOME";
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const breadcrumbs = [
|
|
31
|
+
{ icon: HomeIcon, path: "/digit-ui/citizen" },
|
|
32
|
+
{ label: t(getBreadcrumbLabel()) }
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<AppContainer>
|
|
37
|
+
<div className="ground-container employee-app-container form-container">
|
|
38
|
+
<ModuleHeader
|
|
39
|
+
leftContent={
|
|
40
|
+
<React.Fragment>
|
|
41
|
+
<ArrowLeft className="icon" />
|
|
42
|
+
{t("CS_COMMON_BACK")}
|
|
43
|
+
</React.Fragment>
|
|
44
|
+
}
|
|
45
|
+
onLeftClick={() => window.history.back()}
|
|
46
|
+
breadcrumbs={breadcrumbs}
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<Switch>
|
|
50
|
+
<PrivateRoute
|
|
51
|
+
path={`${path}/create-kyc`}
|
|
52
|
+
component={() => <Create />}
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<PrivateRoute
|
|
56
|
+
path={`${path}/aadhaar-verification`}
|
|
57
|
+
component={() => <AadhaarVerification />}
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<PrivateRoute
|
|
61
|
+
path={`${path}/address-details`}
|
|
62
|
+
component={() => <AddressDetails />}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<PrivateRoute
|
|
66
|
+
path={`${path}/property-info`}
|
|
67
|
+
component={() => <PropertyInfo />}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<PrivateRoute
|
|
71
|
+
path={`${path}/meter-details`}
|
|
72
|
+
component={() => <MeterDetails />}
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
<PrivateRoute
|
|
76
|
+
path={`${path}/review`}
|
|
77
|
+
component={() => <Review />}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<PrivateRoute
|
|
81
|
+
path={`${path}/`}
|
|
82
|
+
component={() => <Create />}
|
|
83
|
+
/>
|
|
84
|
+
</Switch>
|
|
85
|
+
</div>
|
|
86
|
+
</AppContainer>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default CitizenApp;
|