From d45d3315e1dfa8b1f0545480511e185cfece4bc3 Mon Sep 17 00:00:00 2001 From: Lixian Zhou Date: Tue, 10 Mar 2026 11:32:12 -0400 Subject: [PATCH] fix --- client/src/App.css | 1 + .../center-calendar/CenterCalendar.js | 4 +- .../trans-routes/RoutesDashboard.js | 37 ++++++++++++------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/client/src/App.css b/client/src/App.css index 82e05b5..fc26769 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -2500,6 +2500,7 @@ input[type="checkbox"] { .calendar-list-column .event-list-item-container { width: 100%; + min-width: 320px; max-width: 100%; box-sizing: border-box; overflow: hidden; diff --git a/client/src/components/center-calendar/CenterCalendar.js b/client/src/components/center-calendar/CenterCalendar.js index 311ead8..6a99c9a 100644 --- a/client/src/components/center-calendar/CenterCalendar.js +++ b/client/src/components/center-calendar/CenterCalendar.js @@ -1005,9 +1005,9 @@ const EventsCalendar = () => {
-
+
List
-
+
{(!groupedEvents || groupedEvents.size === 0) && (
No events for this period diff --git a/client/src/components/trans-routes/RoutesDashboard.js b/client/src/components/trans-routes/RoutesDashboard.js index 1751bc2..cef455c 100644 --- a/client/src/components/trans-routes/RoutesDashboard.js +++ b/client/src/components/trans-routes/RoutesDashboard.js @@ -54,6 +54,7 @@ const RoutesDashboard = () => { const [showCopyDateTargetLoading, setShowCopyDateTargetLoading] = useState(false); const [copyDisabled, setCopyDisabled] = useState(false); const [showDeleteModal, setShowDeleteModal] = useState(false); + const [deleteRouteType, setDeleteRouteType] = useState(''); const [targetedDateSelected, setTargetedDateSelected] = useState(undefined); const [originDateSelected, setOriginDateSelected] = useState(undefined); const [showOriginDateDropdown, setShowOriginDateDropdown] = useState(false); @@ -187,15 +188,12 @@ const RoutesDashboard = () => { (route?.route_customer_list || []).forEach((customer) => { const customerKey = customer?.customer_id || normalizeName(customer?.customer_name); if (!customerKey) return; - const timeKey = getCustomerTimeKey(route, customer); - if (!timeKey) return; const record = { customerKey, customerName: customer?.customer_name || 'Unknown', customerAddress: customer?.customer_address_override || customer?.customer_address || '', routeId: route?.id || route?._id || '', - routeName: route?.name || 'Unnamed Route', - timeKey + routeName: route?.name || 'Unnamed Route' }; const existing = byCustomer.get(customerKey) || []; byCustomer.set(customerKey, [...existing, record]); @@ -211,8 +209,7 @@ const RoutesDashboard = () => { const first = records[i]; const second = records[j]; if (first.routeId === second.routeId) continue; - if (first.timeKey !== second.timeKey) continue; - const pairKey = [first.customerKey, first.timeKey, first.routeId, second.routeId].sort().join('|'); + const pairKey = [first.customerKey, first.routeId, second.routeId].sort().join('|'); if (seenPairs.has(pairKey)) continue; seenPairs.add(pairKey); issues.push({ @@ -220,8 +217,7 @@ const RoutesDashboard = () => { customerAddressA: first.customerAddress || '', customerAddressB: second.customerAddress || '', routeA: first.routeName, - routeB: second.routeName, - time: first.timeKey + routeB: second.routeName }); } } @@ -766,7 +762,12 @@ const RoutesDashboard = () => { } const cleanupSchedule = () => { - allTomorrowRoutes.forEach((route) => { + const routesToDelete = deleteRouteType === 'inbound' + ? (tmrInboundRoutes || []) + : deleteRouteType === 'outbound' + ? (tmrOutboundRoutes || []) + : (allTomorrowRoutes || []); + routesToDelete.forEach((route) => { TransRoutesService.deleteRoute(route.id); }); setTimeout(() => { @@ -777,9 +778,11 @@ const RoutesDashboard = () => { const closeDeleteModal = () => { setShowDeleteModal(false); + setDeleteRouteType(''); } - const triggerShowDeleteModal = () => { + const triggerShowDeleteModal = (routeType = '') => { + setDeleteRouteType(routeType); setShowDeleteModal(true); } @@ -1722,11 +1725,11 @@ const RoutesDashboard = () => { )}
- + triggerShowDeleteModal('inbound')}/>

- + triggerShowDeleteModal('outbound')}/>

} @@ -1915,7 +1918,13 @@ const RoutesDashboard = () => { Delete Schedule -
Are you sure you want to delete all the schedule?
+
+ {deleteRouteType === 'inbound' + ? 'Are you sure you want to delete all inbound routes for this date?' + : deleteRouteType === 'outbound' + ? 'Are you sure you want to delete all outbound routes for this date?' + : 'Are you sure you want to delete all the schedule?'} +