@@ -48,18 +48,6 @@ export const WorkspaceParametersPageViewExperimental: FC<
4848onCancel,
4949templateVersionId,
5050} ) => {
51- const autofillByName = Object . fromEntries (
52- autofillParameters . map ( ( param ) => [ param . name , param ] ) ,
53- ) ;
54- const initialTouched = parameters . reduce (
55- ( touched , parameter ) => {
56- if ( autofillByName [ parameter . name ] !== undefined ) {
57- touched [ parameter . name ] = true ;
58- }
59- return touched ;
60- } ,
61- { } as Record < string , boolean > ,
62- ) ;
6351const form = useFormik ( {
6452onSubmit,
6553initialValues :{
@@ -68,7 +56,6 @@ export const WorkspaceParametersPageViewExperimental: FC<
6856autofillParameters ,
6957) ,
7058} ,
71- initialTouched,
7259validationSchema :useValidationSchemaForDynamicParameters ( parameters ) ,
7360enableReinitialize :false ,
7461validateOnChange :true ,
@@ -89,28 +76,23 @@ export const WorkspaceParametersPageViewExperimental: FC<
8976name :parameter . name ,
9077value,
9178} ) ;
92- form . setFieldTouched ( parameter . name , true ) ;
9379sendDynamicParamsRequest ( parameter , value ) ;
9480} ;
9581
96- // Send the changed parameter and all touched parameters to the websocket
9782const sendDynamicParamsRequest = (
9883parameter :PreviewParameter ,
9984value :string ,
10085) => {
10186const formInputs :Record < string , string > = { } ;
102- formInputs [ parameter . name ] = value ;
10387const parameters = form . values . rich_parameter_values ?? [ ] ;
104-
105- for ( const [ fieldName , isTouched ] of Object . entries ( form . touched ) ) {
106- if ( isTouched && fieldName !== parameter . name ) {
107- const param = parameters . find ( ( p ) => p . name === fieldName ) ;
108- if ( param ?. value ) {
109- formInputs [ fieldName ] = param . value ;
110- }
88+ for ( const param of parameters ) {
89+ if ( param ?. name && param ?. value ) {
90+ formInputs [ param . name ] = param . value ;
11191}
11292}
11393
94+ formInputs [ parameter . name ] = value ;
95+
11496sendMessage ( formInputs ) ;
11597} ;
11698