From 0bd666e37240dd929680bc537eaf918c1ba7ae20 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 25 Aug 2025 19:44:30 +0530 Subject: [PATCH] feat: dont show cancel button --- src/components/robot/pages/RobotEditPage.tsx | 33 ++++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/components/robot/pages/RobotEditPage.tsx b/src/components/robot/pages/RobotEditPage.tsx index deaf3d76..bce3a5ea 100644 --- a/src/components/robot/pages/RobotEditPage.tsx +++ b/src/components/robot/pages/RobotEditPage.tsx @@ -18,10 +18,17 @@ import { useNavigate, useLocation } from "react-router-dom"; interface RobotMeta { name: string; id: string; + prebuiltId?: string; createdAt: string; pairs: number; updatedAt: string; params: any[]; + type?: string; + description?: string; + usedByUsers?: number[]; + subscriptionLevel?: number; + access?: string; + sample?: any[]; url?: string; } @@ -33,13 +40,13 @@ interface ScheduleConfig { runEvery: number; runEveryUnit: "MINUTES" | "HOURS" | "DAYS" | "WEEKS" | "MONTHS"; startFrom: - | "SUNDAY" - | "MONDAY" - | "TUESDAY" - | "WEDNESDAY" - | "THURSDAY" - | "FRIDAY" - | "SATURDAY"; + | "SUNDAY" + | "MONDAY" + | "TUESDAY" + | "WEDNESDAY" + | "THURSDAY" + | "FRIDAY" + | "SATURDAY"; atTimeStart?: string; atTimeEnd?: string; timezone: string; @@ -173,6 +180,7 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { action.args && action.args.length > 0 ) { + // Check if first argument has a limit property const arg = action.args[0]; if (arg && typeof arg === "object" && "limit" in arg) { limits.push({ @@ -214,6 +222,7 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { const selector = action.args[0]; + // Handle full word type actions first if ( action.action === "type" && action.args?.length >= 2 && @@ -230,6 +239,7 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { continue; } + // Handle character-by-character sequences (both type and press) if ( (action.action === "type" || action.action === "press") && action.args?.length >= 2 && @@ -582,7 +592,8 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { setRerenderRobots(true); notify("success", t("robot_edit.notifications.update_success")); handleStart(robot); - navigate("/robots"); + const basePath = "/robots"; + navigate(basePath); } else { notify("error", t("robot_edit.notifications.update_failed")); } @@ -595,7 +606,8 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { }; const handleCancel = () => { - navigate("/robots"); + const basePath = "/robots"; + navigate(basePath); }; const lastPair = @@ -610,6 +622,7 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { onCancel={handleCancel} saveButtonText={t("robot_edit.save")} cancelButtonText={t("robot_edit.cancel")} + showCancelButton={false} isLoading={isLoading} > <> @@ -640,4 +653,4 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => { ); -}; +}; \ No newline at end of file