add current item in forloop + global forloop reference (#2512)

This commit is contained in:
Shuchang Zheng
2025-05-29 08:12:07 -07:00
committed by GitHub
parent 49ef1aaa07
commit bd72491d7d
4 changed files with 29 additions and 0 deletions

View File

@@ -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" &&