fix: settings limit capture list

This commit is contained in:
Rohit Rajan
2025-11-12 23:11:15 +05:30
parent fb3e41ea66
commit 8fd3528c4c

View File

@@ -152,20 +152,36 @@ export const RobotSettingsPage = ({ handleStart }: RobotSettingsProps) => {
}} }}
style={{ marginBottom: "20px" }} style={{ marginBottom: "20px" }}
/> />
{robot.recording.workflow?.[0]?.what?.[0]?.args?.[0]?.limit !== {(() => {
undefined && ( let listCounter = 1;
<TextField
label={t("robot_settings.robot_limit")} return robot.recording.workflow.flatMap((wf, wfIndex) =>
type="number" wf.what.flatMap((action, actionIndex) => {
value={ const argsWithLimit = action.args?.filter(
robot.recording.workflow[0].what[0].args[0].limit || "" (arg: any) => arg && typeof arg === "object" && arg.limit !== undefined
} );
InputProps={{
readOnly: true, if (!argsWithLimit?.length) return [];
}}
style={{ marginBottom: "20px" }} return argsWithLimit.map((arg, limitIndex) => {
/> const labelName = action.name || `List ${listCounter++}`;
)} return (
<TextField
key={`limit-${wfIndex}-${actionIndex}-${limitIndex}`}
label={`${t("robot_settings.robot_limit")} (${labelName})`}
type="number"
value={arg.limit || ""}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: "20px" }}
/>
);
});
})
);
})()}
<TextField <TextField
label={t("robot_settings.created_by_user")} label={t("robot_settings.created_by_user")}
key="Created By User" key="Created By User"