44 Flow ,
55 LiteralValue ,
66 NodeFunction ,
7- NodeParameterValue , ParameterDefinition ,
7+ NodeParameterValue ,
88 ReferenceValue
99} from "@code0-tech/sagittarius-graphql-types" ;
1010import { FileTabsService } from "@code0-tech/pictor/dist/components/file-tabs/FileTabs.service" ;
@@ -66,7 +66,7 @@ export const FunctionFileDefaultComponent: React.FC<FunctionFileDefaultComponent
6666 const parameterIndex = definition ?. parameterDefinitions ?. nodes ?. findIndex ( p => p ?. id === parameterDefinition ?. id )
6767 if ( typeof parameterIndex !== "number" ) return
6868 if ( ! changedParameters . current . has ( parameterIndex ) ) continue ;
69- const nodeParameter = node . parameters ?. nodes ?. find ( p => p ?. parameterDefinition ?. id === parameterDefinition ?. id )
69+ const nodeParameter = node . parameters ?. nodes ?. [ parameterIndex ]
7070 const value = values [ parameterDefinition ! . id ! ]
7171 const previousValue = nodeParameter ?. value as NodeParameterValue
7272 const syntaxValue = ( value ?. [ 0 ] ?. type == "block" || value ?. [ 0 ] ?. type == "text" ? value ?. [ 0 ] ?. value : value ) ?? null as NodeFunction | LiteralValue | ReferenceValue | null
@@ -79,7 +79,7 @@ export const FunctionFileDefaultComponent: React.FC<FunctionFileDefaultComponent
7979 }
8080
8181 if ( ! syntaxValue || ! value || ( Array . isArray ( syntaxValue ) && Array . from ( syntaxValue ) . length <= 0 ) ) {
82- await flowService . setParameterValue ( flowId , node . id ! ! , parameterIndex , undefined , parameterDefinition ?. id ) ;
82+ await flowService . setParameterValue ( flowId , node . id ! ! , parameterIndex , undefined , definition ) ;
8383 continue ;
8484 }
8585
@@ -89,22 +89,22 @@ export const FunctionFileDefaultComponent: React.FC<FunctionFileDefaultComponent
8989 await flowService . setParameterValue ( flowId , node . id ! ! , parameterIndex , syntaxValue ? {
9090 __typename : "LiteralValue" ,
9191 value : parsedSyntaxValue
92- } : undefined , parameterDefinition ?. id ) ;
92+ } : undefined , definition ) ;
9393 continue ;
9494 }
9595 } catch ( e ) {
9696 if ( ! syntaxValue ?. __typename ) {
9797 await flowService . setParameterValue ( flowId , node . id ! ! , parameterIndex , syntaxValue ? {
9898 __typename : "LiteralValue" ,
9999 value : syntaxValue ,
100- } : undefined , parameterDefinition ?. id ) ;
100+ } : undefined , definition ) ;
101101 continue ;
102102 }
103103 }
104104
105105 const parsedSyntaxValue = typeof syntaxValue === "object" ? syntaxValue : JSON . parse ( syntaxValue )
106106
107- await flowService . setParameterValue ( flowId , node . id ! ! , parameterIndex , parsedSyntaxValue . __typename === "LiteralValue" ? ( ! ! parsedSyntaxValue . value ? parsedSyntaxValue : undefined ) : parsedSyntaxValue , parameterDefinition ?. id ) ;
107+ await flowService . setParameterValue ( flowId , node . id ! ! , parameterIndex , parsedSyntaxValue . __typename === "LiteralValue" ? ( ! ! parsedSyntaxValue . value ? parsedSyntaxValue : undefined ) : parsedSyntaxValue , definition ) ;
108108 }
109109 changedParameters . current . clear ( )
110110 } )
@@ -118,6 +118,8 @@ export const FunctionFileDefaultComponent: React.FC<FunctionFileDefaultComponent
118118 onSubmit : onSubmit
119119 } )
120120
121+ console . log ( initialValues , node . id )
122+
121123 React . useEffect ( ( ) => {
122124 validate ( )
123125 } , [ validation ] )
0 commit comments