tanishqgandhi1908 commented on code in PR #5896:
URL: https://github.com/apache/texera/pull/5896#discussion_r3469202268


##########
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts:
##########
@@ -545,6 +545,20 @@ export class OperatorPropertyEditFrameComponent implements 
OnInit, OnChanges, On
         mappedField.type = "datasetversionselector";
       }
 
+      // Aggregate: the attribute is required for every function except 
count(*), which counts all rows.
+      // For count(*) the attribute is irrelevant, so disable the field 
(keeping the row layout consistent),
+      // drop the required marker, and clear any previously-selected column so 
it isn't shown greyed-out as if used.
+      // All react to the sibling aggFunction within the same row.
+      if (this.currentOperatorSchema?.operatorType === "Aggregate" && 
mappedField.key === "attribute") {
+        mappedField.expressions = {
+          ...mappedField.expressions,
+          "props.required": (field: FormlyFieldConfig) => 
field.parent?.model?.aggFunction !== "count(*)",
+          "props.disabled": (field: FormlyFieldConfig) => 
field.parent?.model?.aggFunction === "count(*)",
+          "model.attribute": (field: FormlyFieldConfig) =>
+            field.parent?.model?.aggFunction === "count(*)" ? "" : 
field.formControl?.value,

Review Comment:
   Done



-- 
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