chore: deprecate robot duplication

This commit is contained in:
amhsirak
2026-01-06 13:32:18 +05:30
parent 670fcfe186
commit 6acab57aef
2 changed files with 3 additions and 21 deletions

View File

@@ -9,7 +9,6 @@ import {
import { RobotIntegrationPage } from "./pages/RobotIntegrationPage";
import { RobotSettingsPage } from "./pages/RobotSettingsPage";
import { RobotEditPage } from "./pages/RobotEditPage";
import { RobotDuplicatePage } from "./pages/RobotDuplicatePage";
import { useNavigate, useLocation, useParams } from "react-router-dom";
import { useGlobalInfoStore } from "../../context/globalInfo";
import { useTranslation } from "react-i18next";
@@ -106,8 +105,6 @@ export const Recordings = ({
return <RobotSettingsPage handleStart={() => {}} />;
} else if (currentPath.endsWith("/edit")) {
return <RobotEditPage handleStart={() => {}} />;
} else if (currentPath.endsWith("/duplicate")) {
return <RobotDuplicatePage handleStart={() => {}} />;
}
return null;
};
@@ -118,7 +115,6 @@ export const Recordings = ({
currentPath.includes("/integrate") ||
currentPath.includes("/settings") ||
currentPath.includes("/edit") ||
currentPath.includes("/duplicate") ||
currentPath.includes("/run");
if (isConfigPage) {
@@ -146,9 +142,6 @@ export const Recordings = ({
handleEditRobot={(id, name, params) =>
handleNavigate(`/robots/${id}/edit`, id, name, params)
}
handleDuplicateRobot={(id, name, params) =>
handleNavigate(`/robots/${id}/duplicate`, id, name, params)
}
/>
</Grid>
</Grid>

View File

@@ -77,7 +77,6 @@ interface RecordingsTableProps {
handleIntegrateRecording: (id: string, fileName: string, params: string[]) => void;
handleSettingsRecording: (id: string, fileName: string, params: string[]) => void;
handleEditRobot: (id: string, name: string, params: string[]) => void;
handleDuplicateRobot: (id: string, name: string, params: string[]) => void;
}
const LoadingRobotRow = memo(({ row, columns }: any) => {
@@ -155,7 +154,6 @@ const TableRowMemoized = memo(({ row, columns, handlers }: any) => {
<MemoizedOptionsButton
handleRetrain={() =>handlers.handleRetrainRobot(row.id, row.name)}
handleEdit={() => handlers.handleEditRobot(row.id, row.name, row.params || [])}
handleDuplicate={() => handlers.handleDuplicateRobot(row.id, row.name, row.params || [])}
handleDelete={() => handlers.handleDelete(row.id)}
robotType={row.type}
/>
@@ -184,7 +182,7 @@ export const RecordingsTable = ({
handleIntegrateRecording,
handleSettingsRecording,
handleEditRobot,
handleDuplicateRobot }: RecordingsTableProps) => {
}: RecordingsTableProps) => {
const { t } = useTranslation();
const theme = useTheme();
const [page, setPage] = React.useState(0);
@@ -506,10 +504,9 @@ export const RecordingsTable = ({
handleIntegrateRecording,
handleSettingsRecording,
handleEditRobot,
handleDuplicateRobot,
handleRetrainRobot,
handleDelete: async (id: string) => openDeleteConfirm(id)
}), [handleRunRecording, handleScheduleRecording, handleIntegrateRecording, handleSettingsRecording, handleEditRobot, handleDuplicateRobot, handleRetrainRobot, notify, t, refetch]);
}), [handleRunRecording, handleScheduleRecording, handleIntegrateRecording, handleSettingsRecording, handleEditRobot, handleRetrainRobot, notify, t, refetch]);
return (
<React.Fragment>
@@ -777,11 +774,10 @@ interface OptionsButtonProps {
handleRetrain: () => void;
handleEdit: () => void;
handleDelete: () => void;
handleDuplicate: () => void;
robotType: string;
}
const OptionsButton = ({ handleRetrain, handleEdit, handleDelete, handleDuplicate, robotType }: OptionsButtonProps) => {
const OptionsButton = ({ handleRetrain, handleEdit, handleDelete, robotType }: OptionsButtonProps) => {
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
@@ -826,13 +822,6 @@ const OptionsButton = ({ handleRetrain, handleEdit, handleDelete, handleDuplicat
<ListItemIcon><DeleteForever fontSize="small" /></ListItemIcon>
<ListItemText>Delete</ListItemText>
</MenuItem>
{robotType !== 'scrape' && (
<MenuItem onClick={() => { handleDuplicate(); handleClose(); }}>
<ListItemIcon><ContentCopy fontSize="small" /></ListItemIcon>
<ListItemText>Duplicate</ListItemText>
</MenuItem>
)}
</Menu>
</>