From 174ea5e8f2a024dede548427c46668330e30a43b Mon Sep 17 00:00:00 2001 From: dharaneesh-r Date: Fri, 5 Jun 2026 09:33:41 +0530 Subject: [PATCH] removed the all location button inthe dispatch page and the rdierlogs page only show the active riders --- src/pages/nearle/dispatch/Dispatch.js | 37 --------------------------- src/pages/nearle/reports/riderLogs.js | 36 +++++++++++++++----------- 2 files changed, 21 insertions(+), 52 deletions(-) diff --git a/src/pages/nearle/dispatch/Dispatch.js b/src/pages/nearle/dispatch/Dispatch.js index b3655fd..4b6f55b 100644 --- a/src/pages/nearle/dispatch/Dispatch.js +++ b/src/pages/nearle/dispatch/Dispatch.js @@ -2788,43 +2788,6 @@ const Dispatch = ({
D
Dispatch
- {appLocations && appLocations.length > 0 && ( -
- - {locationMenuOpen && ( -
- {appLocations.map((loc) => { - const isActive = String(loc.applocationid) === String(selectedAppLocationId); - return ( - - ); - })} -
- )} -
- )}
{/* Header right-cluster: total-orders pill, date picker. Sits to the diff --git a/src/pages/nearle/reports/riderLogs.js b/src/pages/nearle/reports/riderLogs.js index 74ac2d5..b588cea 100644 --- a/src/pages/nearle/reports/riderLogs.js +++ b/src/pages/nearle/reports/riderLogs.js @@ -117,9 +117,16 @@ const RidersLogs = () => { refetchInterval: 5 * 60 * 1000 }); + // Only active riders are surfaced on this page — inactive riders are filtered + // out entirely before they reach the list, selection, counts, or map. + const activeRiders = React.useMemo( + () => (riders || []).filter((r) => r.status === 'active'), + [riders] + ); + useEffect(() => { - setSelectedRiders(riders); - }, [riders]); + setSelectedRiders(activeRiders); + }, [activeRiders]); useEffect(() => { setOpen(isDesktop); @@ -140,10 +147,9 @@ const RidersLogs = () => { return () => document.removeEventListener('keydown', handleKeyPress); }, []); - // Counts shown in the drawer header. - const totalRiders = riders?.length || 0; - const activeCount = (riders || []).filter((r) => r.status === 'active').length; - const inactiveCount = totalRiders - activeCount; + // Counts shown in the drawer header (active riders only). + const totalRiders = activeRiders.length; + const activeCount = totalRiders; const isAllSelected = totalRiders > 0 && selectedRiders?.length === totalRiders; return ( @@ -195,8 +201,11 @@ const RidersLogs = () => { sx={{ position: 'sticky', top: 0, - zIndex: 2, - background: `linear-gradient(135deg, ${tint(BRAND)} 0%, ${tint(BRAND_LIGHT)} 100%)`, + zIndex: 5, + // Solid white base UNDER the translucent brand gradient so the + // scrolling rider list never shows through the sticky header. + backgroundColor: '#fff', + backgroundImage: `linear-gradient(135deg, ${tint(BRAND)} 0%, ${tint(BRAND_LIGHT)} 100%)`, borderBottom: `1px solid ${DT.borderSubtle}`, p: 1.75 }} @@ -250,9 +259,6 @@ const RidersLogs = () => { }> Active · {activeCount} - }> - Inactive · {inactiveCount} - {/* Pill search */} @@ -301,7 +307,7 @@ const RidersLogs = () => { { if (!isAllSelected) { - setSelectedRiders(riders); + setSelectedRiders(activeRiders); } }} sx={{ @@ -328,7 +334,7 @@ const RidersLogs = () => { checked={isAllSelected} onChange={(e) => { if (e.target.checked) { - setSelectedRiders(riders); + setSelectedRiders(activeRiders); } }} sx={{ @@ -380,7 +386,7 @@ const RidersLogs = () => { )) - : riders?.map((row) => { + : activeRiders.map((row) => { const isSelected = selectedRiders?.length === 1 && selectedRiders[0]?.userid === row?.userid; const statusColor = row.status === 'active' ? C_ACTIVE : C_INACTIVE; const initial = (row.firstname || row.username || '?').charAt(0).toUpperCase(); @@ -422,7 +428,7 @@ const RidersLogs = () => { if (e.target.checked) { setSelectedRiders([row]); } else { - setSelectedRiders(riders); + setSelectedRiders(activeRiders); } }} sx={{