Merge branch 'dev' of github.com:Tria-plc/edr-platform into contrat-backup2

This commit is contained in:
marshal
2026-07-02 21:02:22 +03:00
28 changed files with 585 additions and 166 deletions

View File

@@ -42,8 +42,8 @@ export function ContainerAllocationTable({
);
const { data: vehicles = [], isLoading: vehiclesLoading } = useQuery({
queryKey: ["vehicles", "active"],
queryFn: () => vehiclesService.getAll({ status: "ACTIVE" }),
queryKey: ["vehicles", "free"],
queryFn: () => vehiclesService.getAll({ status: "ACTIVE", availability: "FREE" }),
});
const vehicleOptions = useMemo(
@@ -99,7 +99,7 @@ export function ContainerAllocationTable({
<Stack gap="md">
{vehicles.length === 0 && (
<Alert icon={<AlertCircle size={16} />} color="yellow">
No active vehicles available. Add vehicles before allocating containers.
No free vehicles available. Free up or add vehicles before allocating containers.
</Alert>
)}

View File

@@ -42,8 +42,8 @@ export function FirstMileContainerAllocationTable({
);
const { data: vehicles = [], isLoading: vehiclesLoading } = useQuery({
queryKey: ["vehicles", "active"],
queryFn: () => vehiclesService.getAll({ status: "ACTIVE" }),
queryKey: ["vehicles", "free"],
queryFn: () => vehiclesService.getAll({ status: "ACTIVE", availability: "FREE" }),
});
const vehicleOptions = useMemo(
@@ -99,7 +99,7 @@ export function FirstMileContainerAllocationTable({
<Stack gap="md">
{vehicles.length === 0 && (
<Alert icon={<AlertCircle size={16} />} color="yellow">
No active vehicles available. Add vehicles before allocating containers.
No free vehicles available. Free up or add vehicles before allocating containers.
</Alert>
)}

View File

@@ -42,8 +42,8 @@ export function LastMileContainerAllocationTable({
);
const { data: vehicles = [], isLoading: vehiclesLoading } = useQuery({
queryKey: ["vehicles", "active"],
queryFn: () => vehiclesService.getAll({ status: "ACTIVE" }),
queryKey: ["vehicles", "free"],
queryFn: () => vehiclesService.getAll({ status: "ACTIVE", availability: "FREE" }),
});
const vehicleOptions = useMemo(
@@ -99,7 +99,7 @@ export function LastMileContainerAllocationTable({
<Stack gap="md">
{vehicles.length === 0 && (
<Alert icon={<AlertCircle size={16} />} color="yellow">
No active vehicles available. Add vehicles before allocating containers.
No free vehicles available. Free up or add vehicles before allocating containers.
</Alert>
)}

View File

@@ -25,6 +25,8 @@ export const formatFleetCell = (
const getStatusColor = (st: string): string => {
const s = st.toUpperCase();
if (s === "ACTIVE" || s === "AVAILABLE") return "green";
if (s === "FREE") return "teal";
if (s === "BUSY") return "blue";
if (s === "INACTIVE") return "gray";
if (s === "SUSPENDED" || s === "OUT_OF_SERVICE") return "red";
if (s === "MAINTENANCE" || s === "ON_LEAVE") return "orange";