From 0213df4ac474bede78cd279920d234638ea528f5 Mon Sep 17 00:00:00 2001 From: 35C4n0r Date: Fri, 27 Sep 2024 17:40:29 +0530 Subject: [PATCH 1/6] feat: workflow fix Signed-off-by: 35C4n0r --- keep-ui/app/workflows/models.tsx | 1 + keep-ui/app/workflows/workflow-tile.tsx | 14 +++- .../utils/hooks/useWorkflowInitialization.ts | 2 +- keep/api/core/db.py | 14 +++- .../versions/2024-09-26-19-43_b4caf6779ec1.py | 44 +++++++++++ keep/api/models/db/workflow.py | 1 + keep/api/models/workflow.py | 3 +- keep/api/routes/workflows.py | 77 +++++++++++++++---- keep/workflowmanager/workflowstore.py | 18 ++++- 9 files changed, 147 insertions(+), 27 deletions(-) create mode 100644 keep/api/models/db/migrations/versions/2024-09-26-19-43_b4caf6779ec1.py diff --git a/keep-ui/app/workflows/models.tsx b/keep-ui/app/workflows/models.tsx index 5e77ddcfa..72722aca2 100644 --- a/keep-ui/app/workflows/models.tsx +++ b/keep-ui/app/workflows/models.tsx @@ -34,6 +34,7 @@ export type Workflow = { providers: Provider[]; triggers: Trigger[]; disabled:boolean, + is_valid: boolean, last_execution_time: string; last_execution_status: string; last_updated: string; diff --git a/keep-ui/app/workflows/workflow-tile.tsx b/keep-ui/app/workflows/workflow-tile.tsx index 7e3da37ba..0b91497d1 100644 --- a/keep-ui/app/workflows/workflow-tile.tsx +++ b/keep-ui/app/workflows/workflow-tile.tsx @@ -27,7 +27,7 @@ import SlidingPanel from "react-sliding-side-panel"; import { useFetchProviders } from "app/providers/page.client"; import { Provider as FullProvider } from "app/providers/providers"; import "./workflow-tile.css"; -import { CheckCircleIcon, XCircleIcon } from "@heroicons/react/24/outline"; +import { CheckCircleIcon, XCircleIcon, InformationCircleIcon } from "@heroicons/react/24/outline"; import AlertTriggerModal from "./workflow-run-with-alert-modal"; import { formatDistanceToNowStrict } from "date-fns"; import TimeAgo, { Formatter, Suffix, Unit } from "react-timeago"; @@ -551,7 +551,7 @@ function WorkflowTile({ workflow }: { workflow: Workflow }) { )} { e.stopPropagation(); e.preventDefault(); @@ -581,14 +581,20 @@ function WorkflowTile({ workflow }: { workflow: Workflow }) {
-
+

- {workflow?.name || "Unkown"} + {workflow?.name || "Unknown"}

{workflow?.description || "no description"}

+
+ {!workflow.is_valid ? +
+ Invalid workflow Configuration +
:
+ }
{!!workflow?.interval && (