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,10 +510,18 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
{t("List Limits")}
|
{t("List Limits")}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{scrapeListLimits.map((limitInfo, index) => (
|
{scrapeListLimits.map((limitInfo, index) => {
|
||||||
|
// Get the corresponding scrapeList action to extract its name
|
||||||
|
const scrapeListAction = robot?.recording?.workflow?.[limitInfo.pairIndex]?.what?.[limitInfo.actionIndex];
|
||||||
|
const actionName =
|
||||||
|
scrapeListAction?.name ||
|
||||||
|
(scrapeListAction?.args?.[0]?.__name) ||
|
||||||
|
`List Limit ${index + 1}`;
|
||||||
|
|
||||||
|
return (
|
||||||
<TextField
|
<TextField
|
||||||
key={`limit-${limitInfo.pairIndex}-${limitInfo.actionIndex}`}
|
key={`limit-${limitInfo.pairIndex}-${limitInfo.actionIndex}`}
|
||||||
label={`${t("List Limit")} ${index + 1}`}
|
label={actionName}
|
||||||
type="number"
|
type="number"
|
||||||
value={limitInfo.currentLimit || ""}
|
value={limitInfo.currentLimit || ""}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
@@ -530,7 +538,8 @@ export const RobotEditPage = ({ handleStart }: RobotSettingsProps) => {
|
|||||||
inputProps={{ min: 1 }}
|
inputProps={{ min: 1 }}
|
||||||
style={{ marginBottom: "20px" }}
|
style={{ marginBottom: "20px" }}
|
||||||
/>
|
/>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user