add current item in forloop + global forloop reference (#2512)
This commit is contained in:
@@ -59,6 +59,7 @@ function header(type: WorkflowEditorParameterType) {
|
||||
}
|
||||
|
||||
function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
|
||||
const reservedKeys = ["current_item", "current_value", "current_index"];
|
||||
const isCloud = useContext(CloudContext);
|
||||
const [key, setKey] = useState("");
|
||||
const [urlParameterKey, setUrlParameterKey] = useState("");
|
||||
@@ -317,6 +318,14 @@ function WorkflowParameterAddPanel({ type, onClose, onSave }: Props) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (reservedKeys.includes(key)) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to add parameter",
|
||||
description: `${key} is reserved, please use another key`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (type === "workflow") {
|
||||
if (
|
||||
parameterType === "json" &&
|
||||
|
||||
Reference in New Issue
Block a user