kz930 opened a new pull request, #7644: URL: https://github.com/apache/texera/pull/7644
### What changes were proposed in this PR? A field required only under a condition cannot say so in the top-level `required` array, which is a fixed list. The property panel drew the marker from that array alone, so the marker never appeared for such a field and the panel gave no sign that a field had become mandatory until the operator was refused. Aggregate needs such a rule and already declares it correctly, under `definitions.AggregationOperation.allOf`: `attribute` is required for every function except `count`, where an empty attribute means COUNT(*). The marker was then produced a second time, by operator name, in the panel itself. Two statements of one rule, in two languages, free to drift, and the next operator wanting the same thing would have added a third branch beside the field-specific ones already there. `conditionalRequiredRules` reads what the schema declares, and the panel applies it. The walk is recursive because a rule may govern a field inside an array item, where it sits under `definitions` rather than at the top. Keying by field name is enough: the condition is evaluated against the field's own parent model, which is the row for an array item and the operator for a top-level field, so one rule resolves correctly in both. It matches on `if.properties.<sibling>.const`, which the `attributeTypeRules` blocks do not have, naming their sibling directly and requiring nothing. Aggregate keeps its behaviour and loses its branch and helper. An operator that wants a conditional required now states it once, in its descriptor, with no change here. ### Any related issues, documentation, discussions? Closes #7642 ### How was this PR tested? Existing tests, plus four cases in `operator-property-edit-frame.component.spec.ts` covering the `then` form, the `else` form nested in a definition as Aggregate states it, an `attributeTypeRules` block that must not be mistaken for one, and a schema stating no condition. These replace the test of the helper that is now removed. `ng test` passes: 4465 tests. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5) -- 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]
