@@ -27,18 +27,25 @@ const Dashboard = () => {
27
27
showGraphs,
28
28
} = useMemo ( ( ) => dashboardDetails , [ dashboardDetails ] ) ;
29
29
30
- const { dashboardDetailsLoader } = useSelector ( ( { generalLoaderReducer } ) => generalLoaderReducer ?? false ) ;
30
+ const { dashboardDetailsLoader } = useSelector (
31
+ ( { generalLoaderReducer } ) => generalLoaderReducer ?? false
32
+ ) ;
31
33
32
34
const endorsedLimitsData = {
33
35
labels : [ '' ] ,
34
36
datasets : [
35
37
{
36
38
label : '' ,
37
- data : endorsedLimit ?. totalCount !== 0 && endorsedLimit ?. totalCount < endorsedLimit ?. endorsedLimitCount ? [ 1 , 0 ] : [
38
- endorsedLimit ?. totalCount === 0 || endorsedLimit ?. endorsedLimitCount === 0 ? 0 :
39
- endorsedLimit ?. totalCount - endorsedLimit ?. endorsedLimitCount ,
40
- endorsedLimit ?. totalCount === 0 ? 1 : endorsedLimit ?. totalCount ,
41
- ] ,
39
+ data :
40
+ endorsedLimit ?. totalCount !== 0 &&
41
+ endorsedLimit ?. totalCount < endorsedLimit ?. endorsedLimitCount
42
+ ? [ 1 , 0 ]
43
+ : [
44
+ endorsedLimit ?. totalCount === 0 || endorsedLimit ?. endorsedLimitCount === 0
45
+ ? 0
46
+ : endorsedLimit ?. totalCount - endorsedLimit ?. endorsedLimitCount ,
47
+ endorsedLimit ?. totalCount === 0 ? 1 : endorsedLimit ?. totalCount ,
48
+ ] ,
42
49
backgroundColor : [ '#003A78' , '#CBD7E4' ] ,
43
50
} ,
44
51
] ,
@@ -72,18 +79,27 @@ const Dashboard = () => {
72
79
datasets : [
73
80
{
74
81
label : '' ,
75
- data : resChecksCount ?. totalCount !== 0 && resChecksCount ?. totalCount < resChecksCount ?. applicationCount ? [ 1 , 0 ] : [
76
- resChecksCount ?. totalCount === 0 || resChecksCount ?. applicationCount === 0 ? 0 : resChecksCount ?. applicationCount ,
77
- resChecksCount ?. totalCount === 0 ? 1 : resChecksCount ?. totalCount - resChecksCount ?. applicationCount ,
78
- ] ,
82
+ data :
83
+ resChecksCount ?. totalCount !== 0 &&
84
+ resChecksCount ?. totalCount < resChecksCount ?. applicationCount
85
+ ? [ 1 , 0 ]
86
+ : [
87
+ resChecksCount ?. totalCount === 0 || resChecksCount ?. applicationCount === 0
88
+ ? 0
89
+ : resChecksCount ?. applicationCount ,
90
+ resChecksCount ?. totalCount === 0
91
+ ? 1
92
+ : resChecksCount ?. totalCount - resChecksCount ?. applicationCount ,
93
+ ] ,
79
94
backgroundColor : [ '#62d493' , '#CBD7E4' ] ,
80
95
} ,
81
96
] ,
82
97
} ;
83
98
84
99
const pendingApplicationsData = {
85
100
labels :
86
- applicationStatus && applicationStatus ?. map ( e => getLabelFromValues ( e . _id , dashboardPendingApplicationsMapper ) ) ,
101
+ applicationStatus &&
102
+ applicationStatus ?. map ( e => getLabelFromValues ( e . _id , dashboardPendingApplicationsMapper ) ) ,
87
103
datasets : [
88
104
{
89
105
label : '' ,
@@ -138,15 +154,20 @@ const Dashboard = () => {
138
154
{ endorsedLimit && (
139
155
< div className = "dashboard-white-container doughnut-white-card" >
140
156
< div className = "dashboard-title-date-row" >
141
- < span className = "dashboard-card-title" > Endorsed limits out of Aggregated Credit Limits</ span >
157
+ < span className = "dashboard-card-title" >
158
+ Endorsed limits out of Aggregated Credit Limits
159
+ </ span >
142
160
</ div >
143
161
< div className = "doughnut-chart-container" >
144
162
< div className = "doughnut-chart" >
145
163
< Doughnut data = { endorsedLimitsData } options = { doughnutOptions } />
146
164
< div className = "doughnut-center-text" >
147
165
< div >
148
166
{ endorsedLimit ?. totalCount > 0
149
- ? ( ( endorsedLimit ?. endorsedLimitCount * 100 ) / endorsedLimit ?. totalCount ) . toFixed ( 0 )
167
+ ? (
168
+ ( endorsedLimit ?. endorsedLimitCount * 100 ) /
169
+ endorsedLimit ?. totalCount
170
+ ) . toFixed ( 0 )
150
171
: 0 }
151
172
%
152
173
</ div >
@@ -173,7 +194,11 @@ const Dashboard = () => {
173
194
< div className = "doughnut-center-text" >
174
195
< div >
175
196
{ resChecksCount && resChecksCount ?. totalCount > 0
176
- ? ( ( resChecksCount ?. applicationCount / resChecksCount ?. totalCount ) * 100 ) . toFixed ( 0 )
197
+ ? (
198
+ ( resChecksCount ?. applicationCount /
199
+ resChecksCount ?. totalCount ) *
200
+ 100
201
+ ) . toFixed ( 0 )
177
202
: 0 }
178
203
%
179
204
</ div >
@@ -192,7 +217,8 @@ const Dashboard = () => {
192
217
< span className = "dashboard-card-title" > Pending Applications by Status</ span >
193
218
</ div >
194
219
< div className = "d-flex align-center h-100 mt-10" >
195
- { pendingApplicationsData && pendingApplicationsData ?. datasets ?. [ 0 ] ?. data ?. length > 0 ? (
220
+ { pendingApplicationsData &&
221
+ pendingApplicationsData ?. datasets ?. [ 0 ] ?. data ?. length > 0 ? (
196
222
< Pie data = { pendingApplicationsData } options = { pendingApplicationsOptions } />
197
223
) : (
198
224
< div className = "no-record-found" > No record found</ div >
@@ -210,7 +236,9 @@ const Dashboard = () => {
210
236
< div className = "dashboard-title-date-row" >
211
237
< div className = "dashboard-card-title" > Discretionary Limit</ div >
212
238
</ div >
213
- < span className = "dashboard-readings discretionary-limit" > { usdConverter ( discretionaryLimit ) } </ span >
239
+ < span className = "dashboard-readings discretionary-limit" >
240
+ { usdConverter ( discretionaryLimit ) }
241
+ </ span >
214
242
</ div >
215
243
216
244
< div className = "dashboard-white-container" >
@@ -220,7 +248,10 @@ const Dashboard = () => {
220
248
< span className = "approved-amount-ratio font-primary" >
221
249
< div >
222
250
{ approvedAmount ?. total
223
- ? ( ( approvedAmount ?. approvedAmount / approvedAmount ?. total ) * 100 ) . toFixed ( 2 )
251
+ ? (
252
+ ( approvedAmount ?. approvedAmount / approvedAmount ?. total ) *
253
+ 100
254
+ ) . toFixed ( 2 )
224
255
: 0 }
225
256
%
226
257
</ div >
@@ -250,7 +281,9 @@ const Dashboard = () => {
250
281
< span className = "material-icons-round" > watch_later</ span >
251
282
</ div >
252
283
< div className = "mt-15 title" > Partially Approved</ div >
253
- < div className = "mt-5 reading" > { approvedApplication ?. partiallyApproved ?? 0 } </ div >
284
+ < div className = "mt-5 reading" >
285
+ { approvedApplication ?. partiallyApproved ?? 0 }
286
+ </ div >
254
287
< div className = "approved-application-stripe partially-approved-stripe" />
255
288
</ div >
256
289
< div className = "approved-application-block rejected-block" >
0 commit comments