Skip to content

feat(gui): take the required marker from the schema's own condition - #7644

Open
kz930 wants to merge 1 commit into
apache:mainfrom
kz930:feat/conditional-required-marker
Open

feat(gui): take the required marker from the schema's own condition#7644
kz930 wants to merge 1 commit into
apache:mainfrom
kz930:feat/conditional-required-marker

Conversation

@kz930

@kz930 kz930 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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)

A field required only under a condition cannot say so in the top-level `required`
array, which is a fixed list, so the marker never appeared for one 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. The marker was then produced a second
time, by operator name, in this component. 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 here.

conditionalRequiredRules reads what the schema declares. 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, the row for an array item and
the operator for a top-level field, so the same 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. Sklearn's text column, which
its descriptor now declares the same way, gets the marker without a line here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @carloea2
    You can notify them by mentioning @carloea2 in a comment.

@kz930

kz930 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@aglinxinyuan @carloea2 May you take a look at it?

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.65%. Comparing base (12169c2) to head (8363f0e).

Files with missing lines Patch % Lines
...it-frame/operator-property-edit-frame.component.ts 84.21% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7644      +/-   ##
============================================
- Coverage     89.65%   89.65%   -0.01%     
  Complexity     4397     4397              
============================================
  Files          1177     1177              
  Lines         46996    47011      +15     
  Branches       5268     5273       +5     
============================================
+ Hits          42136    42149      +13     
  Misses         3094     3094              
- Partials       1766     1768       +2     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 12169c2
agent-service 98.62% <ø> (ø) Carriedforward from 12169c2
amber 86.35% <ø> (ø) Carriedforward from 12169c2
computing-unit-managing-service 72.46% <ø> (ø) Carriedforward from 12169c2
config-service 77.31% <ø> (ø) Carriedforward from 12169c2
file-service 68.90% <ø> (ø) Carriedforward from 12169c2
frontend 90.67% <84.21%> (-0.01%) ⬇️
notebook-migration-service 78.89% <ø> (ø) Carriedforward from 12169c2
pyamber 97.57% <ø> (ø) Carriedforward from 12169c2
workflow-compiling-service 57.89% <ø> (ø) Carriedforward from 12169c2

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The required marker cannot follow a conditional required, so each operator that needs one hardcodes it

2 participants