feat(intent): honor major on to-one relations (off the list, still in the form)#6394
Merged
Conversation
… the form) A relation's `major` attribute was silently ignored: RelationIntent had no `major` field and EdmIntentGenerator hardcoded widgetIsMajor="true" for every relation (both the local and the cross-model emitter). So `major: false` on a manyToOne/oneToOne parsed fine but never dropped the dropdown from the entity list / document-items table. Add `major` (default true) to RelationIntent and emit widgetIsMajor from it in relationProperty + crossModelRelationProperty. The Harmonia detail-register columns loop already filters on widgetIsMajor, so a `major: false` relation now renders in the create/edit form and detail pane but not as a list column - the relation counterpart of a field's `major: false`. Default true preserves all existing behavior; the attribute is opt-in. EdmIntentGeneratorTest covers a local and a cross-model major:false relation emitting widgetIsMajor=false while a default relation stays true. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A relation's
majorattribute was silently ignored.RelationIntenthad nomajorfield, andEdmIntentGeneratorhardcodedwidgetIsMajor="true"for every relation (bothrelationPropertyandcrossModelRelationProperty). Somajor: falseon amanyToOne/oneToOneparsed without error but never dropped the dropdown from the entity list / document-items table.Change
RelationIntent: newmajorfield (defaulttrue) +isMajor()/setMajor().EdmIntentGenerator: both relation emitters now emitwidgetIsMajorfromrelation.isMajor().The Harmonia
detail-registercolumns loop already filters onwidgetIsMajor, so amajor: falserelation now renders in the create/edit form and detail pane but not as a list/items-table column — the exact counterpart of a field'smajor: false(already supported). Defaulttruepreserves all existing behavior; the attribute is opt-in.Motivation
Document line-item tables often want the FK dropdown in the add/edit dialog only, with a Depends-On-copied descriptive field shown as the single column instead (e.g. an invoice item auto-copying the Product's name into an editable
Name, and hiding the rawProductcolumn). That needsmajor: falseon the relation, which this enables.Test
EdmIntentGeneratorTest#relationMajorFalseEmitsWidgetIsMajorFalseAndDefaultsTrue— a local and a cross-modelmajor: falserelation emitwidgetIsMajor=false; a default relation staystrue. Full engine-intent unit suite green (214).Docs follow-up (separate
dirigible.ioPR): extend the DSL reference note onmajor: falseto say it applies to relations too.🤖 Generated with Claude Code