@@ -60,34 +63,36 @@ export const StagePanelRule = (props: Props) => {
When{" "}
- {}
- {rule.sourceActionInstance ? (
+ {
+
+ }
+ {automation.sourceActionInstance ? (
<>
- {humanReadableEventHydrated(rule.event, community, {
- rule,
- config: rule.config?.ruleConfig ?? undefined,
- sourceAction: rule.sourceActionInstance,
+ {humanReadableEventHydrated(automation.event, community, {
+ automation: automation,
+ config: automation.config?.automationConfig ?? undefined,
+ sourceAction: automation.sourceActionInstance,
})}
>
) : (
- humanReadableEventHydrated(rule.event, community, {
- rule,
- config: rule.config?.ruleConfig ?? undefined,
- sourceAction: rule.sourceActionInstance,
+ humanReadableEventHydrated(automation.event, community, {
+ automation: automation,
+ config: automation.config?.automationConfig ?? undefined,
+ sourceAction: automation.sourceActionInstance,
})
)}
run{" "}
- {rule.actionInstance.name}
+ {automation.actionInstance.name}
{" "}
diff --git a/core/app/c/[communitySlug]/stages/manage/components/panel/actionsTab/StagePanelRuleForm.tsx b/core/app/c/[communitySlug]/stages/manage/components/panel/actionsTab/StagePanelAutomationForm.tsx
similarity index 78%
rename from core/app/c/[communitySlug]/stages/manage/components/panel/actionsTab/StagePanelRuleForm.tsx
rename to core/app/c/[communitySlug]/stages/manage/components/panel/actionsTab/StagePanelAutomationForm.tsx
index 75f405314a..e62ac8f313 100644
--- a/core/app/c/[communitySlug]/stages/manage/components/panel/actionsTab/StagePanelRuleForm.tsx
+++ b/core/app/c/[communitySlug]/stages/manage/components/panel/actionsTab/StagePanelAutomationForm.tsx
@@ -9,7 +9,7 @@ import { useQueryState } from "nuqs";
import { useForm } from "react-hook-form";
import { z } from "zod";
-import type { ActionInstances, CommunitiesId, RulesId, StagesId } from "db/public";
+import type { ActionInstances, AutomationsId, CommunitiesId, StagesId } from "db/public";
import { actionInstancesIdSchema, Event } from "db/public";
import { logger } from "logger";
import { Button } from "ui/button";
@@ -27,27 +27,27 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "u
import { FormSubmitButton } from "ui/submit-button";
import { cn } from "utils";
-import type { RuleConfig, RuleForEvent, Rules } from "~/actions/_lib/rules";
+import type { Automation, AutomationConfig, AutomationForEvent } from "~/actions/_lib/automations";
import type { getStageActions } from "~/lib/db/queries";
import type { AutoReturnType } from "~/lib/types";
import { ActionFormContext } from "~/actions/_lib/ActionForm";
-import { actions, getRuleByName, humanReadableEventBase, rules } from "~/actions/api";
+import { actions, automations, getAutomationByName, humanReadableEventBase } from "~/actions/api";
import { getActionFormComponent } from "~/actions/forms";
import { useCommunity } from "~/app/components/providers/CommunityProvider";
import { isClientException, useServerAction } from "~/lib/serverActions";
-import { addOrUpdateRule, deleteRule } from "../../../actions";
+import { addOrUpdateAutomation, deleteAutomation } from "../../../actions";
type Props = {
stageId: StagesId;
actionInstances: AutoReturnType