diff --git a/ui-v2/src/components/automations/automation-details-page.tsx b/ui-v2/src/components/automations/automation-details-page.tsx index 560b4677dc95..997c0ad214c3 100644 --- a/ui-v2/src/components/automations/automation-details-page.tsx +++ b/ui-v2/src/components/automations/automation-details-page.tsx @@ -32,16 +32,16 @@ export const AutomationDetailsPage = ({ id }: AutomationsDetailsPageProps) => { <>
- +
- +
- - - + + +
@@ -50,9 +50,9 @@ export const AutomationDetailsPage = ({ id }: AutomationsDetailsPageProps) => { }; type NavHeaderProps = { - data: Automation; + automation: Automation; }; -const NavHeader = ({ data }: NavHeaderProps) => { +const NavHeader = ({ automation }: NavHeaderProps) => { return ( @@ -63,7 +63,7 @@ const NavHeader = ({ data }: NavHeaderProps) => { - {data.name} + {automation.name} diff --git a/ui-v2/src/components/automations/automation-details.tsx b/ui-v2/src/components/automations/automation-details.tsx index ce9bb7927d73..8dc7c6c2c3bf 100644 --- a/ui-v2/src/components/automations/automation-details.tsx +++ b/ui-v2/src/components/automations/automation-details.tsx @@ -7,24 +7,26 @@ import { Typography } from "@/components/ui/typography"; import { pluralize } from "@/utils"; type AutomationDetailsProps = { - data: Automation; + automation: Automation; }; -export const AutomationDescription = ({ data }: AutomationDetailsProps) => { +export const AutomationDescription = ({ + automation, +}: AutomationDetailsProps) => { return (
Description - {data.description || "None"} + {automation.description || "None"}
); }; -export const AutomationTrigger = ({ data }: AutomationDetailsProps) => { - const { trigger } = data; +export const AutomationTrigger = ({ automation }: AutomationDetailsProps) => { + const { trigger } = automation; return (
Trigger @@ -35,8 +37,9 @@ export const AutomationTrigger = ({ data }: AutomationDetailsProps) => { ); }; -export const AutomationActions = ({ data }: AutomationDetailsProps) => { - const { data: resources, loading } = useGetAutomationActionResources(data); +export const AutomationActions = ({ automation }: AutomationDetailsProps) => { + const { data: resources, loading } = + useGetAutomationActionResources(automation); const { automationsMap, @@ -48,15 +51,15 @@ export const AutomationActions = ({ data }: AutomationDetailsProps) => { return (
- {pluralize(data.actions.length, "Action")} + {pluralize(automation.actions.length, "Action")}
    {loading - ? Array.from({ length: data.actions.length }, (_, i) => ( + ? Array.from({ length: automation.actions.length }, (_, i) => ( )) - : data.actions.map((action, i) => ( + : automation.actions.map((action, i) => (
  • ; export default meta; diff --git a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx index 55b1877f580f..dc0268428823 100644 --- a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx +++ b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.test.tsx @@ -14,7 +14,7 @@ test("AutomationEnableToggle can toggle switch", async () => { render( <> - + , { wrapper: createWrapper() }, ); diff --git a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx index 99f1c5b2a465..f54b38990b22 100644 --- a/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx +++ b/ui-v2/src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx @@ -3,10 +3,10 @@ import { Switch } from "@/components/ui/switch"; import { useToast } from "@/hooks/use-toast"; type AutomationEnableToggleProps = { - data: Automation; + automation: Automation; }; export const AutomationEnableToggle = ({ - data, + automation, }: AutomationEnableToggleProps) => { const { toast } = useToast(); @@ -36,8 +36,8 @@ export const AutomationEnableToggle = ({ return ( handleCheckedChange(checked, data.id)} + checked={automation.enabled} + onCheckedChange={(checked) => handleCheckedChange(checked, automation.id)} /> ); }; diff --git a/ui-v2/src/components/automations/automations-page.tsx b/ui-v2/src/components/automations/automations-page.tsx index 426b7742b2e9..fd043f8f290a 100644 --- a/ui-v2/src/components/automations/automations-page.tsx +++ b/ui-v2/src/components/automations/automations-page.tsx @@ -45,7 +45,7 @@ export const AutomationsPage = () => { aria-label={`automation item ${automation.name}`} > handleDelete(automation)} />
  • @@ -60,46 +60,48 @@ export const AutomationsPage = () => { }; type AutomationCardDetailsProps = { - data: Automation; + automation: Automation; onDelete: () => void; }; const AutomationCardDetails = ({ - data, + automation, onDelete, }: AutomationCardDetailsProps) => { return (
    - +
    - - + +
    - {data.description && } - - + {automation.description && ( + + )} + +
    ); }; type NavHeaderProps = { - data: Automation; + automation: Automation; }; -const NavHeader = ({ data }: NavHeaderProps) => { +const NavHeader = ({ automation }: NavHeaderProps) => { return ( - {data.name} + {automation.name} diff --git a/ui-v2/tests/utils/handlers.ts b/ui-v2/tests/utils/handlers.ts index e45d30b814af..551b83ccb87b 100644 --- a/ui-v2/tests/utils/handlers.ts +++ b/ui-v2/tests/utils/handlers.ts @@ -21,7 +21,7 @@ const automationsHandlers = [ }), ]; -const blocksHandelrs = [ +const blocksHandlers = [ http.post(buildApiUrl("/blocks/filter"), () => { return HttpResponse.json([]); }), @@ -126,7 +126,7 @@ const workeQueuesHandlers = [ export const handlers = [ ...automationsHandlers, - ...blocksHandelrs, + ...blocksHandlers, ...deploymentsHandlers, ...flowHandlers, ...flowRunHandlers,