Skip to content

Commit e6d3323

Browse files
committed
chore: lint
1 parent 158347b commit e6d3323

File tree

1 file changed

+77
-77
lines changed

1 file changed

+77
-77
lines changed

src/components/robot/pages/RobotEditPage.tsx

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -536,87 +536,87 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
536536
};
537537

538538
const renderActionNameFields = () => {
539-
if (!robot || !robot.recording || !robot.recording.workflow) return null;
540-
541-
const editableActions = new Set(['screenshot', 'scrapeList', 'scrapeSchema']);
542-
const textInputs: JSX.Element[] = [];
543-
const screenshotInputs: JSX.Element[] = [];
544-
const listInputs: JSX.Element[] = [];
545-
546-
robot.recording.workflow.forEach((pair, pairIndex) => {
547-
if (!pair.what) return;
548-
549-
pair.what.forEach((action, actionIndex) => {
550-
if (!editableActions.has(String(action.action))) return;
551-
552-
const currentName =
553-
action.name ||
554-
(action.args && action.args[0] && typeof action.args[0] === 'object' && action.args[0].__name) ||
555-
'';
556-
557-
const textField = (
558-
<TextField
559-
key={`action-name-${pairIndex}-${actionIndex}`}
560-
type="text"
561-
value={currentName}
562-
onChange={(e) => handleActionNameChange(pairIndex, actionIndex, e.target.value)}
563-
style={{ marginBottom: '12px' }}
564-
fullWidth
565-
/>
566-
);
539+
if (!robot || !robot.recording || !robot.recording.workflow) return null;
567540

568-
switch (action.action) {
569-
case 'scrapeSchema':
570-
textInputs.push(textField);
571-
break;
572-
case 'screenshot':
573-
screenshotInputs.push(textField);
574-
break;
575-
case 'scrapeList':
576-
listInputs.push(textField);
577-
break;
578-
}
541+
const editableActions = new Set(['screenshot', 'scrapeList', 'scrapeSchema']);
542+
const textInputs: JSX.Element[] = [];
543+
const screenshotInputs: JSX.Element[] = [];
544+
const listInputs: JSX.Element[] = [];
545+
546+
robot.recording.workflow.forEach((pair, pairIndex) => {
547+
if (!pair.what) return;
548+
549+
pair.what.forEach((action, actionIndex) => {
550+
if (!editableActions.has(String(action.action))) return;
551+
552+
const currentName =
553+
action.name ||
554+
(action.args && action.args[0] && typeof action.args[0] === 'object' && action.args[0].__name) ||
555+
'';
556+
557+
const textField = (
558+
<TextField
559+
key={`action-name-${pairIndex}-${actionIndex}`}
560+
type="text"
561+
value={currentName}
562+
onChange={(e) => handleActionNameChange(pairIndex, actionIndex, e.target.value)}
563+
style={{ marginBottom: '12px' }}
564+
fullWidth
565+
/>
566+
);
567+
568+
switch (action.action) {
569+
case 'scrapeSchema':
570+
textInputs.push(textField);
571+
break;
572+
case 'screenshot':
573+
screenshotInputs.push(textField);
574+
break;
575+
case 'scrapeList':
576+
listInputs.push(textField);
577+
break;
578+
}
579+
});
579580
});
580-
});
581581

582-
const hasAnyInputs = textInputs.length > 0 || screenshotInputs.length > 0 || listInputs.length > 0;
583-
if (!hasAnyInputs) return null;
582+
const hasAnyInputs = textInputs.length > 0 || screenshotInputs.length > 0 || listInputs.length > 0;
583+
if (!hasAnyInputs) return null;
584584

585-
return (
586-
<>
587-
<Typography variant="body1" style={{ marginBottom: '10px', marginTop: '20px' }}>
588-
{t('Actions')}
589-
</Typography>
590-
591-
{textInputs.length > 0 && (
592-
<>
593-
<Typography variant="subtitle1" style={{ marginBottom: '8px' }}>
594-
Texts
595-
</Typography>
596-
{textInputs}
597-
</>
598-
)}
599-
600-
{screenshotInputs.length > 0 && (
601-
<>
602-
<Typography variant="subtitle1" style={{ marginBottom: '8px', marginTop: textInputs.length > 0 ? '16px' : '0' }}>
603-
Screenshots
604-
</Typography>
605-
{screenshotInputs}
606-
</>
607-
)}
608-
609-
{listInputs.length > 0 && (
610-
<>
611-
<Typography variant="subtitle1" style={{ marginBottom: '8px', marginTop: (textInputs.length > 0 || screenshotInputs.length > 0) ? '16px' : '0' }}>
612-
Lists
613-
</Typography>
614-
{listInputs}
615-
</>
616-
)}
617-
</>
618-
);
619-
};
585+
return (
586+
<>
587+
<Typography variant="body1" style={{ marginBottom: '10px', marginTop: '20px' }}>
588+
{t('Actions')}
589+
</Typography>
590+
591+
{textInputs.length > 0 && (
592+
<>
593+
<Typography variant="subtitle1" style={{ marginBottom: '8px' }}>
594+
Texts
595+
</Typography>
596+
{textInputs}
597+
</>
598+
)}
599+
600+
{screenshotInputs.length > 0 && (
601+
<>
602+
<Typography variant="subtitle1" style={{ marginBottom: '8px', marginTop: textInputs.length > 0 ? '16px' : '0' }}>
603+
Screenshots
604+
</Typography>
605+
{screenshotInputs}
606+
</>
607+
)}
608+
609+
{listInputs.length > 0 && (
610+
<>
611+
<Typography variant="subtitle1" style={{ marginBottom: '8px', marginTop: (textInputs.length > 0 || screenshotInputs.length > 0) ? '16px' : '0' }}>
612+
Lists
613+
</Typography>
614+
{listInputs}
615+
</>
616+
)}
617+
</>
618+
);
619+
};
620620

621621
const renderCredentialFields = (
622622
selectors: string[],

0 commit comments

Comments
 (0)