Skip to content

Commit 495c5b7

Browse files
committed
fix: eslint errors
1 parent 12244ad commit 495c5b7

File tree

76 files changed

+3502
-3028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3502
-3028
lines changed

src/common/CustomSelect/CustomSelect.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ const CustomSelect = props => {
2828
clickedItem => {
2929
setSelectedList([...selectedList, clickedItem]);
3030
},
31-
[selectedList, setSelectedList],
31+
[selectedList, setSelectedList]
3232
);
3333

3434
const onItemUnselect = useCallback(
3535
clickedItem => {
3636
setSelectedList(selectedList?.filter(item => item?.value !== clickedItem?.value));
3737
},
38-
[selectedList, setSelectedList],
38+
[selectedList, setSelectedList]
3939
);
4040
useOnClickOutside(customDropdownRef, () => {
4141
setIsOpenCustomSelect(false);
@@ -52,7 +52,7 @@ const CustomSelect = props => {
5252
setSearchedText(e?.target?.value);
5353
onSearchChange(e?.target?.value);
5454
},
55-
[isSearching, onSearchChange],
55+
[isSearching, onSearchChange]
5656
);
5757

5858
useEffect(() => {
@@ -61,8 +61,8 @@ const CustomSelect = props => {
6161
options?.filter(
6262
item =>
6363
!selectedItems.includes(item.value) &&
64-
item.label.toLowerCase().includes(searchedText.toString().toLowerCase()),
65-
),
64+
item.label.toLowerCase().includes(searchedText.toString().toLowerCase())
65+
)
6666
);
6767
}, [selectedList, searchedText, options]);
6868

@@ -112,11 +112,15 @@ const CustomSelect = props => {
112112
<div className="more-text">+{selectedList.length - 1} more</div>
113113
</Tooltip>
114114
)}
115-
<span className={`material-icons-round ${isOpenCustomSelect && 'font-field'}`}>expand_more</span>
115+
<span className={`material-icons-round ${isOpenCustomSelect && 'font-field'}`}>
116+
expand_more
117+
</span>
116118
</div>
117119
<div
118120
ref={customDropdownRef}
119-
className={`custom-select-dropdown ${isOpenCustomSelect && 'active-custom-select-dropdown'}`}
121+
className={`custom-select-dropdown ${
122+
isOpenCustomSelect && 'active-custom-select-dropdown'
123+
}`}
120124
>
121125
{selectedList?.length > 0 || notSelectedList?.length > 0 ? (
122126
<>

src/common/Dashboard/Dashboard.js

+51-18
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,25 @@ const Dashboard = () => {
2727
showGraphs,
2828
} = useMemo(() => dashboardDetails, [dashboardDetails]);
2929

30-
const { dashboardDetailsLoader } = useSelector(({ generalLoaderReducer }) => generalLoaderReducer ?? false);
30+
const { dashboardDetailsLoader } = useSelector(
31+
({ generalLoaderReducer }) => generalLoaderReducer ?? false
32+
);
3133

3234
const endorsedLimitsData = {
3335
labels: [''],
3436
datasets: [
3537
{
3638
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+
],
4249
backgroundColor: ['#003A78', '#CBD7E4'],
4350
},
4451
],
@@ -72,18 +79,27 @@ const Dashboard = () => {
7279
datasets: [
7380
{
7481
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+
],
7994
backgroundColor: ['#62d493', '#CBD7E4'],
8095
},
8196
],
8297
};
8398

8499
const pendingApplicationsData = {
85100
labels:
86-
applicationStatus && applicationStatus?.map(e => getLabelFromValues(e._id, dashboardPendingApplicationsMapper)),
101+
applicationStatus &&
102+
applicationStatus?.map(e => getLabelFromValues(e._id, dashboardPendingApplicationsMapper)),
87103
datasets: [
88104
{
89105
label: '',
@@ -138,15 +154,20 @@ const Dashboard = () => {
138154
{endorsedLimit && (
139155
<div className="dashboard-white-container doughnut-white-card">
140156
<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>
142160
</div>
143161
<div className="doughnut-chart-container">
144162
<div className="doughnut-chart">
145163
<Doughnut data={endorsedLimitsData} options={doughnutOptions} />
146164
<div className="doughnut-center-text">
147165
<div>
148166
{endorsedLimit?.totalCount > 0
149-
? ((endorsedLimit?.endorsedLimitCount * 100) / endorsedLimit?.totalCount).toFixed(0)
167+
? (
168+
(endorsedLimit?.endorsedLimitCount * 100) /
169+
endorsedLimit?.totalCount
170+
).toFixed(0)
150171
: 0}
151172
%
152173
</div>
@@ -173,7 +194,11 @@ const Dashboard = () => {
173194
<div className="doughnut-center-text">
174195
<div>
175196
{resChecksCount && resChecksCount?.totalCount > 0
176-
? ((resChecksCount?.applicationCount / resChecksCount?.totalCount) * 100).toFixed(0)
197+
? (
198+
(resChecksCount?.applicationCount /
199+
resChecksCount?.totalCount) *
200+
100
201+
).toFixed(0)
177202
: 0}
178203
%
179204
</div>
@@ -192,7 +217,8 @@ const Dashboard = () => {
192217
<span className="dashboard-card-title">Pending Applications by Status</span>
193218
</div>
194219
<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 ? (
196222
<Pie data={pendingApplicationsData} options={pendingApplicationsOptions} />
197223
) : (
198224
<div className="no-record-found">No record found</div>
@@ -210,7 +236,9 @@ const Dashboard = () => {
210236
<div className="dashboard-title-date-row">
211237
<div className="dashboard-card-title">Discretionary Limit</div>
212238
</div>
213-
<span className="dashboard-readings discretionary-limit">{usdConverter(discretionaryLimit)}</span>
239+
<span className="dashboard-readings discretionary-limit">
240+
{usdConverter(discretionaryLimit)}
241+
</span>
214242
</div>
215243

216244
<div className="dashboard-white-container">
@@ -220,7 +248,10 @@ const Dashboard = () => {
220248
<span className="approved-amount-ratio font-primary">
221249
<div>
222250
{approvedAmount?.total
223-
? ((approvedAmount?.approvedAmount / approvedAmount?.total) * 100).toFixed(2)
251+
? (
252+
(approvedAmount?.approvedAmount / approvedAmount?.total) *
253+
100
254+
).toFixed(2)
224255
: 0}
225256
%
226257
</div>
@@ -250,7 +281,9 @@ const Dashboard = () => {
250281
<span className="material-icons-round">watch_later</span>
251282
</div>
252283
<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>
254287
<div className="approved-application-stripe partially-approved-stripe" />
255288
</div>
256289
<div className="approved-application-block rejected-block">

src/common/Dashboard/components/DashBoardNotification.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ const DashBoardNotification = () => {
1313
const dispatch = useDispatch();
1414
const [isFetching, setIsFetching] = useState(false);
1515
const { notificationList, page, pages, total, hasMoreData } = useSelector(
16-
({ dashboard }) => dashboard?.dashboardNotification ?? {},
16+
({ dashboard }) => dashboard?.dashboardNotification ?? {}
1717
);
1818

1919
const sortedNotification = useMemo(() => {
20-
notificationList?.sort(function (a, b) {
20+
notificationList?.sort((a, b) => {
2121
return new Date(b.title) - new Date(a.title);
2222
});
2323
return notificationList;
@@ -38,7 +38,7 @@ const DashBoardNotification = () => {
3838
/**/
3939
}
4040
},
41-
[total, pages, page],
41+
[total, pages, page]
4242
);
4343

4444
const handleScroll = e => {
@@ -93,7 +93,9 @@ const DashBoardNotification = () => {
9393

9494
<div className="notification-detail-row">
9595
<span className="font-field f-14">{data?.description}</span>
96-
<span className="notification-time">{moment(data?.createdAt).format('hh:mm A')}</span>
96+
<span className="notification-time">
97+
{moment(data?.createdAt).format('hh:mm A')}
98+
</span>
9799
<span
98100
className="material-icons-round"
99101
onClick={() => {

src/common/Dashboard/components/DashboardTask.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const DashboardTask = () => {
2626

2727
const { tempFilter, finalFilter } = useMemo(() => filter ?? {}, [filter]);
2828

29-
const { dashboardTaskListFilters } = useSelector(({ listFilterReducer }) => listFilterReducer ?? {});
29+
const { dashboardTaskListFilters } = useSelector(
30+
({ listFilterReducer }) => listFilterReducer ?? {}
31+
);
3032

3133
const getDashboardTaskListByFilter = useCallback(
3234
async (params = {}, cb) => {
@@ -47,7 +49,7 @@ const DashboardTask = () => {
4749
/**/
4850
}
4951
},
50-
[tempFilter],
52+
[tempFilter]
5153
);
5254

5355
const getTaskListOnRefresh = () => {
@@ -68,7 +70,7 @@ const DashboardTask = () => {
6870

6971
const toggleFilterModal = useCallback(
7072
value => setFilterModal(value !== undefined ? value : e => !e),
71-
[setFilterModal],
73+
[setFilterModal]
7274
);
7375
const onClickApplyFilter = useCallback(async () => {
7476
await getDashboardTaskListByFilter({}, toggleFilterModal);
@@ -100,7 +102,7 @@ const DashboardTask = () => {
100102
},
101103
{ title: 'Apply', buttonType: 'primary', onClick: onClickApplyFilter },
102104
],
103-
[toggleFilterModal, onClickApplyFilter, onClickResetFilter],
105+
[toggleFilterModal, onClickApplyFilter, onClickResetFilter]
104106
);
105107

106108
const handleIsCompletedFilterChange = event => {
@@ -196,7 +198,10 @@ const DashboardTask = () => {
196198
>
197199
<div className="d-flex align-center">
198200
<div className="form-title">Completed Task</div>
199-
<Checkbox checked={tempFilter?.isCompleted} onChange={e => handleIsCompletedFilterChange(e)} />
201+
<Checkbox
202+
checked={tempFilter?.isCompleted}
203+
onChange={e => handleIsCompletedFilterChange(e)}
204+
/>
200205
</div>
201206
</Modal>
202207
)}

src/common/Dashboard/redux/DashboardActions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ export const downloadDashboardTask = params => {
159159
throw Error();
160160
}
161161
return false;
162-
}
163-
}
162+
};
163+
};

src/common/Dashboard/services/DashboardApiService.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export const DashboardApiService = {
2222
getTaskDetailById: id => ApiService.getData(`${DASHBOARD_URLS.DASHBOARD_TASK_DETAILS_URL}${id}`),
2323
updateTask: (id, data) => ApiService.putData(`${DASHBOARD_URLS.UPDATE_TASK}${id}`, data),
2424
getEntitiesBySearch: params => ApiService.getData(DASHBOARD_URLS.SEARCH_ENTITIES, { params }),
25-
downloadDashboardTask: params => ApiService.request({
26-
url: DASHBOARD_URLS.DASHBOARD_DOWNLOAD_TASK,
27-
params,
28-
method: 'GET',
29-
responseType: 'blob',
30-
timeout: 60000
31-
}
32-
)
25+
downloadDashboardTask: params =>
26+
ApiService.request({
27+
url: DASHBOARD_URLS.DASHBOARD_DOWNLOAD_TASK,
28+
params,
29+
method: 'GET',
30+
responseType: 'blob',
31+
timeout: 60000,
32+
}),
3333
};

src/common/Drawer/Drawer.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
33
import { useOnClickOutside } from '../../hooks/UserClickOutsideHook';
44

55
const Drawer = props => {
6-
const { drawerState, closeDrawer, header, className, children, onDrawerScroll, ...restProps } = props;
6+
const { drawerState, closeDrawer, header, className, children, onDrawerScroll, ...restProps } =
7+
props;
78
const drawerMenuRef = useRef();
89
useOnClickOutside(drawerMenuRef, () => {
910
if (drawerState) closeDrawer();
@@ -18,7 +19,11 @@ const Drawer = props => {
1819
<div className="drawer-wrapper">
1920
<div className="drawer-header-container">
2021
{header}
21-
<span className="material-icons-round close-drawer" title="Close drawer" onClick={closeDrawer}>
22+
<span
23+
className="material-icons-round close-drawer"
24+
title="Close drawer"
25+
onClick={closeDrawer}
26+
>
2227
close
2328
</span>{' '}
2429
</div>

0 commit comments

Comments
 (0)