Copilot commented on code in PR #5912:
URL: https://github.com/apache/texera/pull/5912#discussion_r3660349215


##########
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts:
##########
@@ -1034,6 +1053,10 @@ export class OperatorPropertyEditFrameComponent 
implements OnInit, OnChanges, On
         }
       }
 
+      if (mappedField.key === "uiParameters") {
+        mappedField.type = "ui-udf-parameters";
+      }

Review Comment:
   A new schema-to-Formly mapping is introduced for `uiParameters`, but the 
existing unit tests in `operator-property-edit-frame.component.spec.ts` only 
cover other custom mappings (e.g., `datasetVersionPath`, `code`). Add a focused 
test asserting `uiParameters` maps to `ui-udf-parameters` so future schema 
changes don’t silently break rendering.



##########
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts:
##########
@@ -516,6 +518,23 @@ export class OperatorPropertyEditFrameComponent implements 
OnInit, OnChanges, On
           this.currentOperatorStatus = update[this.currentOperatorId];
         }
       });
+
+    this.uiUdfParametersSyncService.uiParametersChanged$
+      .pipe(untilDestroyed(this))
+      .subscribe(({ operatorId, parameters }) => {
+        if (operatorId !== this.currentOperatorId) return;
+
+        const currentOperator = 
this.workflowActionService.getTexeraGraph().getOperator(operatorId);
+
+        const newModel = {
+          ...cloneDeep(currentOperator.operatorProperties),
+          uiParameters: cloneDeep(parameters),
+        };
+
+        this.listeningToChange = false;
+        this.workflowActionService.setOperatorProperty(operatorId, newModel);
+        this.listeningToChange = true;
+      });

Review Comment:
   `uiParametersChanged$` handler assumes the operator still exists and can 
throw when `setOperatorProperty` runs after an operator was deleted 
(WorkflowGraph.setOperatorProperty throws if the operator ID is missing). Also, 
toggling `listeningToChange` to false here can suppress the operator-property 
change event that is needed to refresh `formData`, so the property panel may 
not render newly inferred UI parameters.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to