Update planning view to show guard coverage and calculation status
Add new UI elements to display guard coverage status, including total needed, assigned, and missing guards, and update the display logic to accurately reflect these calculations. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e5565357-90e1-419f-b9a8-6ee8394636df Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/6d543d2c-20b9-4ea6-93fe-70fe9b1d9f80/e5565357-90e1-419f-b9a8-6ee8394636df/uZXH8P1
This commit is contained in:
parent
2616fb775a
commit
b1e5a13882
BIN
attached_assets/immagine_1760773435933.png
Normal file
BIN
attached_assets/immagine_1760773435933.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
@ -6,7 +6,7 @@ import { useLocation } from "wouter";
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||||
import { ChevronLeft, ChevronRight, Calendar, MapPin, Users, AlertTriangle, Car, Edit } from "lucide-react";
|
import { ChevronLeft, ChevronRight, Calendar, MapPin, Users, AlertTriangle, Car, Edit, CheckCircle2 } from "lucide-react";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
import {
|
import {
|
||||||
@ -282,6 +282,24 @@ export default function GeneralPlanning() {
|
|||||||
>
|
>
|
||||||
{daySiteData && daySiteData.shiftsCount > 0 ? (
|
{daySiteData && daySiteData.shiftsCount > 0 ? (
|
||||||
<div className="space-y-2 text-xs">
|
<div className="space-y-2 text-xs">
|
||||||
|
{/* Riepilogo guardie necessarie/assegnate/mancanti */}
|
||||||
|
<div className="pb-2 border-b">
|
||||||
|
{daySiteData.missingGuards > 0 ? (
|
||||||
|
<Badge variant="destructive" className="w-full justify-center gap-1">
|
||||||
|
<AlertTriangle className="h-3 w-3" />
|
||||||
|
Mancano {daySiteData.missingGuards} {daySiteData.missingGuards === 1 ? "guardia" : "guardie"}
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
|
<Badge variant="default" className="w-full justify-center gap-1 bg-green-600 hover:bg-green-700">
|
||||||
|
<CheckCircle2 className="h-3 w-3" />
|
||||||
|
Copertura Completa
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
<div className="text-xs text-muted-foreground mt-1 text-center">
|
||||||
|
{daySiteData.guardsAssigned + daySiteData.missingGuards} necessarie · {daySiteData.guardsAssigned} assegnate
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Guardie assegnate */}
|
{/* Guardie assegnate */}
|
||||||
{daySiteData.guards.length > 0 && (
|
{daySiteData.guards.length > 0 && (
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
@ -315,16 +333,6 @@ export default function GeneralPlanning() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Guardie mancanti */}
|
|
||||||
{daySiteData.missingGuards > 0 && (
|
|
||||||
<div className="pt-2 border-t">
|
|
||||||
<Badge variant="destructive" className="w-full justify-center gap-1">
|
|
||||||
<AlertTriangle className="h-3 w-3" />
|
|
||||||
Mancano {daySiteData.missingGuards} {daySiteData.missingGuards === 1 ? "guardia" : "guardie"}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Info copertura */}
|
{/* Info copertura */}
|
||||||
<div className="text-xs text-muted-foreground pt-1 border-t">
|
<div className="text-xs text-muted-foreground pt-1 border-t">
|
||||||
<div>Turni: {daySiteData.shiftsCount}</div>
|
<div>Turni: {daySiteData.shiftsCount}</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user