Merge pull request #858 from getmaxun/fix-list-limits
feat: display list names instead of generic labels while editing robots
This commit is contained in:
@@ -510,27 +510,36 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
{t("List Limits")}
|
{t("List Limits")}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{scrapeListLimits.map((limitInfo, index) => (
|
{scrapeListLimits.map((limitInfo, index) => {
|
||||||
<TextField
|
// Get the corresponding scrapeList action to extract its name
|
||||||
key={`limit-${limitInfo.pairIndex}-${limitInfo.actionIndex}`}
|
const scrapeListAction = robot?.recording?.workflow?.[limitInfo.pairIndex]?.what?.[limitInfo.actionIndex];
|
||||||
label={`${t("List Limit")} ${index + 1}`}
|
const actionName =
|
||||||
type="number"
|
scrapeListAction?.name ||
|
||||||
value={limitInfo.currentLimit || ""}
|
(scrapeListAction?.args?.[0]?.__name) ||
|
||||||
onChange={(e) => {
|
`List Limit ${index + 1}`;
|
||||||
const value = parseInt(e.target.value, 10);
|
|
||||||
if (value >= 1) {
|
return (
|
||||||
handleLimitChange(
|
<TextField
|
||||||
limitInfo.pairIndex,
|
key={`limit-${limitInfo.pairIndex}-${limitInfo.actionIndex}`}
|
||||||
limitInfo.actionIndex,
|
label={actionName}
|
||||||
limitInfo.argIndex,
|
type="number"
|
||||||
value
|
value={limitInfo.currentLimit || ""}
|
||||||
);
|
onChange={(e) => {
|
||||||
}
|
const value = parseInt(e.target.value, 10);
|
||||||
}}
|
if (value >= 1) {
|
||||||
inputProps={{ min: 1 }}
|
handleLimitChange(
|
||||||
style={{ marginBottom: "20px" }}
|
limitInfo.pairIndex,
|
||||||
/>
|
limitInfo.actionIndex,
|
||||||
))}
|
limitInfo.argIndex,
|
||||||
|
value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
inputProps={{ min: 1 }}
|
||||||
|
style={{ marginBottom: "20px" }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user