diff --git a/frontend/src/components/ScheduledOperationsView.tsx b/frontend/src/components/ScheduledOperationsView.tsx index 7fc88f62..42e56dc5 100644 --- a/frontend/src/components/ScheduledOperationsView.tsx +++ b/frontend/src/components/ScheduledOperationsView.tsx @@ -4,8 +4,7 @@ import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'; -import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog'; +import { Modal, ModalHeader, ModalBody, ModalFooter, ConfirmModal } from '@/components/ui/modal'; import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet'; import { ScrollArea } from '@/components/ui/scroll-area'; import { TogglePill } from '@/components/ui/toggle-pill'; @@ -315,7 +314,6 @@ export default function ScheduledOperationsView({ filterNodeId, onClearFilter, p const res = await apiFetch(`/scheduled-tasks/${deleteTarget.id}`, { method: 'DELETE', localOnly: true }); if (res.ok) { toast.success('Task deleted'); - setDeleteTarget(null); fetchTasks(); } else { const data = await res.json().catch(() => ({})); @@ -323,6 +321,8 @@ export default function ScheduledOperationsView({ filterNodeId, onClearFilter, p } } catch { toast.error('Something went wrong.'); + } finally { + setDeleteTarget(null); } }; @@ -661,14 +661,14 @@ export default function ScheduledOperationsView({ filterNodeId, onClearFilter, p - {/* Create/Edit Dialog */} - - - - {editingTask ? 'Edit Scheduled Task' : 'New Scheduled Task'} - Configure a scheduled operation task. - - + {/* Create/Edit Modal */} + + + Name setFormName(e.target.value)} /> @@ -815,33 +815,33 @@ export default function ScheduledOperationsView({ filterNodeId, onClearFilter, p Task removes itself after its first successful execution. Failures keep the task so you can retry or debug. - - + + setDialogOpen(false)}>Cancel + } + primary={ {saving ? 'Saving...' : editingTask ? 'Update' : 'Create'} - - - + } + /> + {/* Delete Confirmation */} - { if (!open) setDeleteTarget(null); }}> - - - Delete Scheduled Task - - Are you sure you want to delete “{deleteTarget?.name}”? This will also remove all execution history. This action cannot be undone. - - - - Cancel - - Delete - - - - + { if (!open) setDeleteTarget(null); }} + variant="destructive" + kicker="SCHEDULER · DELETE · IRREVERSIBLE" + title="Delete scheduled task" + confirmLabel="Delete" + onConfirm={handleDelete} + > + + Permanently deletes {deleteTarget?.name} and all of its execution history. + + {/* Run History Sheet */} { if (!open) setRunsTask(null); }}>
Task removes itself after its first successful execution. Failures keep the task so you can retry or debug.
+ Permanently deletes {deleteTarget?.name} and all of its execution history. +