Merge pull request #884 from getmaxun/setting-fix
fix: settings show only one limit for robots with multiple list actions
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user