TP-52028 | Filters on Map are resetting on reload + Layout Changes (#761)
* TP-52028 | Filters on Map are resetting on reload * TP-52028 | fix * TP-52028 | fix height * TP-52028 | Refresh Fix * TP-52028 | Logic Change for Filter in MAP --------- Co-authored-by: Aman Chaturvedi <aman.chaturvedi@navi.com>
This commit is contained in:
@@ -65,12 +65,14 @@
|
||||
.mainContent {
|
||||
margin-left: calc(var(--sidenav-width-close)); // sidenav bar width
|
||||
width: calc(100% - var(--sidenav-width-close));
|
||||
height: calc(
|
||||
100% - 58px
|
||||
); // 58px is the height of the topnav bar, 40px is the height of the sticky banner
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.mainContentWithTopBar {
|
||||
height: calc(100% - 58px); // 58px is the height of the topnav bar
|
||||
}
|
||||
|
||||
.mainContentWithStickyBanner {
|
||||
height: calc(
|
||||
100% - 58px - 36px
|
||||
|
||||
@@ -303,6 +303,7 @@ function DefaultLayout() {
|
||||
<div
|
||||
className={cx(styles.mainContent, {
|
||||
[styles.noScroll]: shouldShowScroll,
|
||||
[styles.mainContentWithTopBar]: !hideTopNavBarRoutes,
|
||||
[styles.mainContentWithStickyBanner]: shouldShowStickyBanner
|
||||
})}
|
||||
>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import React, { Suspense, useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import GridRow from '../../../../../web-ui-library/src/layouts/Grid/GridRow/GridRow';
|
||||
import GridColumn from '../../../../../web-ui-library/src/layouts/Grid/GridColumn/GridColumn';
|
||||
import styles from '../../../Cases/components/Cases.module.scss';
|
||||
import Pagination from '@components/Pagination';
|
||||
import { DropDownPosition } from '@components/Pagination/constant';
|
||||
import DataTableHeader from '../DataTableHeader';
|
||||
import axiosInstance, { ApiKeys, getApiUrl } from '../../../../utils/ApiHelper';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { AgencySummary, Serviceability } from '../../types';
|
||||
import { AgencySummary } from '../../types';
|
||||
import { RootState } from '@cp/src/store';
|
||||
import Loader from '../../../../components/Loader/Loader';
|
||||
import toProperCase from '@cp/src/utils/toProperCase';
|
||||
@@ -107,7 +106,7 @@ function DataTable({ openUploadDialog }: DataTableProps) {
|
||||
</GridRow>
|
||||
|
||||
<GridRow className="no-gutters">
|
||||
<GridColumn md={12} className={styles.cases__table}>
|
||||
<GridColumn md={12} className={'h-[calc(100vh-210px)]'}>
|
||||
<AgTable
|
||||
defaultColDef={{
|
||||
suppressMovable: true
|
||||
|
||||
@@ -55,9 +55,6 @@ const Filters = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const isInhouseAgencySelected =
|
||||
queryParams[FilterTypes.AGENCY] === INHOUSE_AGENCY_CODE.toString();
|
||||
|
||||
const applyFilterRecursively = (filterType: FilterTypes) => {
|
||||
const selectedFilter = queryParams[filterType];
|
||||
const { nextFilter } = FilterMap[filterType];
|
||||
@@ -72,7 +69,6 @@ const Filters = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// If selected agency is inhouse, anyway get the agent locations
|
||||
if (filterType === FilterTypes.AGENCY) {
|
||||
dispatch(getAgentsLocations(pinsPayload));
|
||||
}
|
||||
@@ -87,8 +83,8 @@ const Filters = () => {
|
||||
applyFilterRecursively(nextFilter);
|
||||
};
|
||||
|
||||
if (!queryParams?.AGENTID) applyFilterRecursively(FilterTypes.AGENCY);
|
||||
}, [searchParams, filters]);
|
||||
applyFilterRecursively(FilterTypes.AGENCY);
|
||||
}, [queryParams?.AGENCY, queryParams?.TEAM_LEAD, filters]);
|
||||
|
||||
const handleFilterChange = (value: string, filterType: FilterTypes) => {
|
||||
dispatch(setMapLocations({ data: [] }));
|
||||
|
||||
@@ -57,11 +57,6 @@ function TopBar() {
|
||||
if (!selectedAgency) {
|
||||
return true;
|
||||
}
|
||||
const isInhouseAgencySelected =
|
||||
queryParams[FilterTypes.AGENCY] === INHOUSE_AGENCY_CODE.toString();
|
||||
if (!isInhouseAgencySelected && !queryParams[FilterTypes.TEAM_LEAD]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, [selectedAgency, queryParams?.TEAM_LEAD, queryParams?.AGENCY]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user