Compare commits
2 Commits
2b62d8ff4e
...
753e01d612
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
753e01d612 | ||
|
|
3b3056f6b8 |
@ -273,13 +273,33 @@ export default function PlanningMobile() {
|
||||
|
||||
// Funzione per aprire dialog duplicazione sequenza
|
||||
const handleOpenDuplicateDialog = (route: any) => {
|
||||
const nextDay = format(addDays(parseISO(selectedDate), 1), "yyyy-MM-dd");
|
||||
try {
|
||||
// Validazione data selezionata
|
||||
const parsedDate = parseISO(selectedDate);
|
||||
if (!isValid(parsedDate)) {
|
||||
toast({
|
||||
title: "Errore data",
|
||||
description: "La data selezionata non è valida",
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const nextDay = format(addDays(parsedDate, 1), "yyyy-MM-dd");
|
||||
setDuplicateDialog({
|
||||
isOpen: true,
|
||||
sourceRoute: route,
|
||||
targetDate: nextDay, // Default = giorno successivo
|
||||
selectedDuplicateGuardId: route.guardId, // Pre-compilato con guardia attuale
|
||||
selectedDuplicateGuardId: route.guardId || "", // Pre-compilato con guardia attuale
|
||||
});
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: "Errore",
|
||||
description: "Impossibile aprire il dialog di duplicazione",
|
||||
variant: "destructive",
|
||||
});
|
||||
console.error("Error opening duplicate dialog:", error);
|
||||
}
|
||||
};
|
||||
|
||||
// Handler submit dialog duplicazione
|
||||
@ -879,7 +899,9 @@ export default function PlanningMobile() {
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-muted-foreground">Data:</span>
|
||||
<span className="font-medium">
|
||||
{format(parseISO(duplicateDialog.sourceRoute.scheduledDate), "dd/MM/yyyy", { locale: it })}
|
||||
{duplicateDialog.sourceRoute.scheduledDate && isValid(parseISO(duplicateDialog.sourceRoute.scheduledDate))
|
||||
? format(parseISO(duplicateDialog.sourceRoute.scheduledDate), "dd/MM/yyyy", { locale: it })
|
||||
: "Data non valida"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
@ -901,7 +923,7 @@ export default function PlanningMobile() {
|
||||
data-testid="input-target-date"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{duplicateDialog.sourceRoute && duplicateDialog.targetDate &&
|
||||
{duplicateDialog.sourceRoute && duplicateDialog.targetDate && duplicateDialog.sourceRoute.scheduledDate && isValid(parseISO(duplicateDialog.sourceRoute.scheduledDate)) &&
|
||||
format(parseISO(duplicateDialog.sourceRoute.scheduledDate), "yyyy-MM-dd") === duplicateDialog.targetDate
|
||||
? "⚠️ Stessa data: verrà modificata la guardia della sequenza esistente"
|
||||
: "✓ Data diversa: verrà creata una nuova sequenza con tutte le tappe"
|
||||
|
||||
Binary file not shown.
BIN
database-backups/vigilanzaturni_v1.0.54_20251024_172526.sql.gz
Normal file
BIN
database-backups/vigilanzaturni_v1.0.54_20251024_172526.sql.gz
Normal file
Binary file not shown.
16
version.json
16
version.json
@ -1,7 +1,13 @@
|
||||
{
|
||||
"version": "1.0.53",
|
||||
"lastUpdate": "2025-10-24T16:35:13.318Z",
|
||||
"version": "1.0.54",
|
||||
"lastUpdate": "2025-10-24T17:25:43.941Z",
|
||||
"changelog": [
|
||||
{
|
||||
"version": "1.0.54",
|
||||
"date": "2025-10-24",
|
||||
"type": "patch",
|
||||
"description": "Deployment automatico v1.0.54"
|
||||
},
|
||||
{
|
||||
"version": "1.0.53",
|
||||
"date": "2025-10-24",
|
||||
@ -295,12 +301,6 @@
|
||||
"date": "2025-10-17",
|
||||
"type": "patch",
|
||||
"description": "Deployment automatico v1.0.5"
|
||||
},
|
||||
{
|
||||
"version": "1.0.4",
|
||||
"date": "2025-10-17",
|
||||
"type": "patch",
|
||||
"description": "Deployment automatico v1.0.4"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user