chore: deprecate robot duplication
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
|||||||
import { RobotIntegrationPage } from "./pages/RobotIntegrationPage";
|
import { RobotIntegrationPage } from "./pages/RobotIntegrationPage";
|
||||||
import { RobotSettingsPage } from "./pages/RobotSettingsPage";
|
import { RobotSettingsPage } from "./pages/RobotSettingsPage";
|
||||||
import { RobotEditPage } from "./pages/RobotEditPage";
|
import { RobotEditPage } from "./pages/RobotEditPage";
|
||||||
import { RobotDuplicatePage } from "./pages/RobotDuplicatePage";
|
|
||||||
import { useNavigate, useLocation, useParams } from "react-router-dom";
|
import { useNavigate, useLocation, useParams } from "react-router-dom";
|
||||||
import { useGlobalInfoStore } from "../../context/globalInfo";
|
import { useGlobalInfoStore } from "../../context/globalInfo";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -106,8 +105,6 @@ export const Recordings = ({
|
|||||||
return <RobotSettingsPage handleStart={() => {}} />;
|
return <RobotSettingsPage handleStart={() => {}} />;
|
||||||
} else if (currentPath.endsWith("/edit")) {
|
} else if (currentPath.endsWith("/edit")) {
|
||||||
return <RobotEditPage handleStart={() => {}} />;
|
return <RobotEditPage handleStart={() => {}} />;
|
||||||
} else if (currentPath.endsWith("/duplicate")) {
|
|
||||||
return <RobotDuplicatePage handleStart={() => {}} />;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
@@ -118,7 +115,6 @@ export const Recordings = ({
|
|||||||
currentPath.includes("/integrate") ||
|
currentPath.includes("/integrate") ||
|
||||||
currentPath.includes("/settings") ||
|
currentPath.includes("/settings") ||
|
||||||
currentPath.includes("/edit") ||
|
currentPath.includes("/edit") ||
|
||||||
currentPath.includes("/duplicate") ||
|
|
||||||
currentPath.includes("/run");
|
currentPath.includes("/run");
|
||||||
|
|
||||||
if (isConfigPage) {
|
if (isConfigPage) {
|
||||||
@@ -146,9 +142,6 @@ export const Recordings = ({
|
|||||||
handleEditRobot={(id, name, params) =>
|
handleEditRobot={(id, name, params) =>
|
||||||
handleNavigate(`/robots/${id}/edit`, id, name, params)
|
handleNavigate(`/robots/${id}/edit`, id, name, params)
|
||||||
}
|
}
|
||||||
handleDuplicateRobot={(id, name, params) =>
|
|
||||||
handleNavigate(`/robots/${id}/duplicate`, id, name, params)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ interface RecordingsTableProps {
|
|||||||
handleIntegrateRecording: (id: string, fileName: string, params: string[]) => void;
|
handleIntegrateRecording: (id: string, fileName: string, params: string[]) => void;
|
||||||
handleSettingsRecording: (id: string, fileName: string, params: string[]) => void;
|
handleSettingsRecording: (id: string, fileName: string, params: string[]) => void;
|
||||||
handleEditRobot: (id: string, name: 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) => {
|
const LoadingRobotRow = memo(({ row, columns }: any) => {
|
||||||
@@ -155,7 +154,6 @@ const TableRowMemoized = memo(({ row, columns, handlers }: any) => {
|
|||||||
<MemoizedOptionsButton
|
<MemoizedOptionsButton
|
||||||
handleRetrain={() =>handlers.handleRetrainRobot(row.id, row.name)}
|
handleRetrain={() =>handlers.handleRetrainRobot(row.id, row.name)}
|
||||||
handleEdit={() => handlers.handleEditRobot(row.id, row.name, row.params || [])}
|
handleEdit={() => handlers.handleEditRobot(row.id, row.name, row.params || [])}
|
||||||
handleDuplicate={() => handlers.handleDuplicateRobot(row.id, row.name, row.params || [])}
|
|
||||||
handleDelete={() => handlers.handleDelete(row.id)}
|
handleDelete={() => handlers.handleDelete(row.id)}
|
||||||
robotType={row.type}
|
robotType={row.type}
|
||||||
/>
|
/>
|
||||||
@@ -184,7 +182,7 @@ export const RecordingsTable = ({
|
|||||||
handleIntegrateRecording,
|
handleIntegrateRecording,
|
||||||
handleSettingsRecording,
|
handleSettingsRecording,
|
||||||
handleEditRobot,
|
handleEditRobot,
|
||||||
handleDuplicateRobot }: RecordingsTableProps) => {
|
}: RecordingsTableProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [page, setPage] = React.useState(0);
|
const [page, setPage] = React.useState(0);
|
||||||
@@ -506,10 +504,9 @@ export const RecordingsTable = ({
|
|||||||
handleIntegrateRecording,
|
handleIntegrateRecording,
|
||||||
handleSettingsRecording,
|
handleSettingsRecording,
|
||||||
handleEditRobot,
|
handleEditRobot,
|
||||||
handleDuplicateRobot,
|
|
||||||
handleRetrainRobot,
|
handleRetrainRobot,
|
||||||
handleDelete: async (id: string) => openDeleteConfirm(id)
|
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 (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
@@ -777,11 +774,10 @@ interface OptionsButtonProps {
|
|||||||
handleRetrain: () => void;
|
handleRetrain: () => void;
|
||||||
handleEdit: () => void;
|
handleEdit: () => void;
|
||||||
handleDelete: () => void;
|
handleDelete: () => void;
|
||||||
handleDuplicate: () => void;
|
|
||||||
robotType: string;
|
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 [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
||||||
|
|
||||||
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
|
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
|
||||||
@@ -826,13 +822,6 @@ const OptionsButton = ({ handleRetrain, handleEdit, handleDelete, handleDuplicat
|
|||||||
<ListItemIcon><DeleteForever fontSize="small" /></ListItemIcon>
|
<ListItemIcon><DeleteForever fontSize="small" /></ListItemIcon>
|
||||||
<ListItemText>Delete</ListItemText>
|
<ListItemText>Delete</ListItemText>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
{robotType !== 'scrape' && (
|
|
||||||
<MenuItem onClick={() => { handleDuplicate(); handleClose(); }}>
|
|
||||||
<ListItemIcon><ContentCopy fontSize="small" /></ListItemIcon>
|
|
||||||
<ListItemText>Duplicate</ListItemText>
|
|
||||||
</MenuItem>
|
|
||||||
)}
|
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user