diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx index 1a54ac0e5..ab82589dc 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/run-details-panel.tsx @@ -53,7 +53,11 @@ export function RunDetailsPanel({ const isTerminal = liveStatus !== "pending" && liveStatus !== "running"; // Defer the REST round-trip until the run can actually carry heavy // fields — output/artifacts/error are only written at terminal mark. - const { data: run, isLoading, error } = useAutomationRun(automationId, runId, { + const { + data: run, + isLoading, + error, + } = useAutomationRun(automationId, runId, { enabled: isTerminal, }); diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/trigger-card.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/trigger-card.tsx index 681877523..1b3c9786f 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/trigger-card.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/[automation_id]/components/trigger-card.tsx @@ -4,6 +4,7 @@ import { AlertCircle, CalendarClock, Clock, Pencil, Save, Trash2 } from "lucide- import { useState } from "react"; import { updateTriggerMutationAtom } from "@/atoms/automations/automations-mutation.atoms"; import { JsonView } from "@/components/json-view"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { Spinner } from "@/components/ui/spinner"; import { Switch } from "@/components/ui/switch"; @@ -164,17 +165,19 @@ export function TriggerCard({ trigger, automationId, canUpdate, canDelete }: Tri {issues.length > 0 && ( -
-
- + + + {issues.length === 1 ? "1 issue" : `${issues.length} issues`} -
- -
+ + + + + )}
diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/automations-content.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/automations-content.tsx index 756221d38..3a9532f1c 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/automations-content.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/automations-content.tsx @@ -1,5 +1,6 @@ "use client"; -import { ShieldAlert } from "lucide-react"; +import { AlertCircle, ShieldAlert } from "lucide-react"; +import { Alert, AlertDescription } from "@/components/ui/alert"; import { useAutomations } from "@/hooks/use-automations"; import { AutomationsEmptyState } from "./components/automations-empty-state"; import { AutomationsHeader } from "./components/automations-header"; @@ -60,9 +61,10 @@ export function AutomationsContent({ searchSpaceId }: AutomationsContentProps) { loading={false} canCreate={perms.canCreate} /> -
-

Couldn't load automations. {error.message}

-
+ + + Couldn't load automations. {error.message} + ); } diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-empty-state.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-empty-state.tsx index cc54c5e94..b2e7b2532 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-empty-state.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-empty-state.tsx @@ -1,5 +1,5 @@ "use client"; -import { MessageSquarePlus, SquarePen, Workflow } from "lucide-react"; +import { Workflow } from "lucide-react"; import Link from "next/link"; import { Button } from "@/components/ui/button"; @@ -28,16 +28,14 @@ export function AutomationsEmptyState({ searchSpaceId, canCreate }: AutomationsE {canCreate ? (
-
) : ( diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-header.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-header.tsx index 137727f60..5c1fcb507 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-header.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/components/automations-header.tsx @@ -1,5 +1,4 @@ "use client"; -import { MessageSquarePlus, SquarePen } from "lucide-react"; import Link from "next/link"; import { Button } from "@/components/ui/button"; @@ -41,17 +40,16 @@ export function AutomationsHeader({
{canCreate && showCreateCta && (
-
)} diff --git a/surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/automation-builder-form.tsx b/surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/automation-builder-form.tsx index 39904dfa0..117b7bfe8 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/automation-builder-form.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/automations/components/builder/automation-builder-form.tsx @@ -1,6 +1,6 @@ "use client"; import { useAtomValue } from "jotai"; -import { Code2, LayoutList, Save } from "lucide-react"; +import { AlertCircle, Code2, LayoutList, Save } from "lucide-react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useMemo, useState } from "react"; @@ -12,6 +12,7 @@ import { updateAutomationMutationAtom, updateTriggerMutationAtom, } from "@/atoms/automations/automations-mutation.atoms"; +import { Alert, AlertDescription } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Spinner } from "@/components/ui/spinner"; @@ -452,7 +453,12 @@ export function AutomationBuilderForm({ )} - {rootError &&

{rootError}

} + {rootError && ( + + + {rootError} + + )}