Fix Loop block parameters (#1492)
This commit is contained in:
@@ -368,14 +368,14 @@ function convertToNode(
|
|||||||
const loopVariableReference =
|
const loopVariableReference =
|
||||||
block.loop_variable_reference !== null
|
block.loop_variable_reference !== null
|
||||||
? block.loop_variable_reference
|
? block.loop_variable_reference
|
||||||
: block.loop_over.key;
|
: block.loop_over?.key ?? "";
|
||||||
return {
|
return {
|
||||||
...identifiers,
|
...identifiers,
|
||||||
...common,
|
...common,
|
||||||
type: "loop",
|
type: "loop",
|
||||||
data: {
|
data: {
|
||||||
...commonData,
|
...commonData,
|
||||||
loopValue: block.loop_over.key,
|
loopValue: block.loop_over?.key ?? "",
|
||||||
loopVariableReference: loopVariableReference,
|
loopVariableReference: loopVariableReference,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ class ForLoopBlockYAML(BlockYAML):
|
|||||||
# to infer the type of the parameter_type attribute.
|
# to infer the type of the parameter_type attribute.
|
||||||
block_type: Literal[BlockType.FOR_LOOP] = BlockType.FOR_LOOP # type: ignore
|
block_type: Literal[BlockType.FOR_LOOP] = BlockType.FOR_LOOP # type: ignore
|
||||||
|
|
||||||
loop_over_parameter_key: str
|
|
||||||
loop_blocks: list["BLOCK_YAML_SUBCLASSES"]
|
loop_blocks: list["BLOCK_YAML_SUBCLASSES"]
|
||||||
|
loop_over_parameter_key: str = ""
|
||||||
loop_variable_reference: str | None = None
|
loop_variable_reference: str | None = None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user