Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix

This commit is contained in:
yaschalew
2026-06-30 17:27:07 +03:00

View File

@@ -54,12 +54,17 @@ export function TrackingPage() {
})); }));
}, [vehicles]); }, [vehicles]);
const selectedVehicle = vehiclesWithGPS.find(v => v.id === selectedVehicleId); const activeVehicles = useMemo(
const vehicleOptions = useMemo( () => vehiclesWithGPS.filter(v => v.status === 'ACTIVE'),
() => vehiclesWithGPS.map(v => ({ label: v.registrationNumber, value: v.id })),
[vehiclesWithGPS] [vehiclesWithGPS]
); );
const selectedVehicle = activeVehicles.find(v => v.id === selectedVehicleId);
const vehicleOptions = useMemo(
() => activeVehicles.map(v => ({ label: v.registrationNumber, value: v.id })),
[activeVehicles]
);
// Map dimensions // Map dimensions
const mapWidth = 800; const mapWidth = 800;
const mapHeight = 500; const mapHeight = 500;
@@ -146,8 +151,8 @@ export function TrackingPage() {
))} ))}
</svg> </svg>
{/* Vehicle markers */} {/* Vehicle markers - show only active vehicles */}
{vehiclesWithGPS.map((vehicle) => { {vehiclesWithGPS.filter(v => v.status === 'ACTIVE').map((vehicle) => {
const coords = getMapCoords(vehicle.gps.lat, vehicle.gps.lng); const coords = getMapCoords(vehicle.gps.lat, vehicle.gps.lng);
const isSelected = vehicle.id === selectedVehicleId; const isSelected = vehicle.id === selectedVehicleId;
@@ -303,14 +308,14 @@ export function TrackingPage() {
</Card> </Card>
)} )}
{/* All Vehicles List */} {/* All Active Vehicles List */}
<Card withBorder p="lg"> <Card withBorder p="lg">
<Stack gap="md"> <Stack gap="md">
<Text fw={500}>All Vehicles</Text> <Text fw={500}>Active Vehicles ({activeVehicles.length})</Text>
<div style={{ maxHeight: '300px', overflowY: 'auto' }}> <div style={{ maxHeight: '300px', overflowY: 'auto' }}>
<Table size="sm"> <Table size="sm">
<Table.Tbody> <Table.Tbody>
{vehiclesWithGPS.slice(0, 10).map(v => ( {activeVehicles.slice(0, 10).map(v => (
<Table.Tr <Table.Tr
key={v.id} key={v.id}
style={{ style={{