Merge pull request #217 from getmaxun/edit-ui

feat: rearrange robot options
This commit is contained in:
Karishma Shukla
2024-12-01 19:58:23 +05:30
committed by GitHub

View File

@@ -151,9 +151,6 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
row.name.toLowerCase().includes(searchTerm.toLowerCase()) row.name.toLowerCase().includes(searchTerm.toLowerCase())
); );
return ( return (
<React.Fragment> <React.Fragment>
<Box display="flex" justifyContent="space-between" alignItems="center"> <Box display="flex" justifyContent="space-between" alignItems="center">
@@ -249,6 +246,9 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
<TableCell key={column.id} align={column.align}> <TableCell key={column.id} align={column.align}>
<OptionsButton <OptionsButton
handleEdit={() => handleEditRobot(row.id, row.name, row.params || [])} handleEdit={() => handleEditRobot(row.id, row.name, row.params || [])}
handleDuplicate={() => {
handleDuplicateRobot(row.id, row.name, row.params || []);
}}
handleDelete={() => { handleDelete={() => {
checkRunsForRecording(row.id).then((result: boolean) => { checkRunsForRecording(row.id).then((result: boolean) => {
@@ -265,9 +265,6 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl
} }
}) })
}} }}
handleDuplicate={() => {
handleDuplicateRobot(row.id, row.name, row.params || []);
}}
/> />
</TableCell> </TableCell>
); );
@@ -420,18 +417,18 @@ const OptionsButton = ({ handleEdit, handleDelete, handleDuplicate }: OptionsBut
</ListItemIcon> </ListItemIcon>
<ListItemText>Edit</ListItemText> <ListItemText>Edit</ListItemText>
</MenuItem> </MenuItem>
<MenuItem onClick={() => { handleDelete(); handleClose(); }}>
<ListItemIcon>
<DeleteForever fontSize="small" />
</ListItemIcon>
<ListItemText>Delete</ListItemText>
</MenuItem>
<MenuItem onClick={() => { handleDuplicate(); handleClose(); }}> <MenuItem onClick={() => { handleDuplicate(); handleClose(); }}>
<ListItemIcon> <ListItemIcon>
<ContentCopy fontSize="small" /> <ContentCopy fontSize="small" />
</ListItemIcon> </ListItemIcon>
<ListItemText>Duplicate</ListItemText> <ListItemText>Duplicate</ListItemText>
</MenuItem> </MenuItem>
<MenuItem onClick={() => { handleDelete(); handleClose(); }}>
<ListItemIcon>
<DeleteForever fontSize="small" />
</ListItemIcon>
<ListItemText>Delete</ListItemText>
</MenuItem>
</Menu> </Menu>
</> </>
); );