Skip to content

fix(drive-integration): link new Add Entry as child of selected parent [INTEG-4524]#11111

Open
JuliRossi wants to merge 6 commits into
INTEG-4524-add-entry-form-uifrom
INTEG-4524-child-reference-logic
Open

fix(drive-integration): link new Add Entry as child of selected parent [INTEG-4524]#11111
JuliRossi wants to merge 6 commits into
INTEG-4524-add-entry-form-uifrom
INTEG-4524-child-reference-logic

Conversation

@JuliRossi

Copy link
Copy Markdown
Collaborator

Summary

  • Flip Add Entry reference semantics: the new entry is a child of an existing parent (not a parent pointing at an existing entry).
  • Reference fields come from the parent content type; __ref / sourceEntryIds are written on the parent; edge is from=parent → to=child.
  • Single Link fields replace any prior child; Array fields append.
  • Disable Yes only when no existing parent content type has an Entry reference field.
  • Stacked on feat(drive-integration): Replace Add Entry wizard with single-screen form [INTEG-4524] #11110 (UI form refactor).

New reference logic

flowchart TD
  A[Select content type for new entry] --> B{Any existing parent<br/>has Entry reference fields?}
  B -->|No| C[Yes disabled — only No allowed]
  B -->|Yes| D{Should this new entry be a<br/>reference of an existing entry?}
  D -->|No| E[Map fields on new entry only]
  D -->|Yes| F[Select parent entry]
  F --> G{Parent has how many<br/>Entry reference fields?}
  G -->|0| H[Save disabled]
  G -->|1| I[Auto-pick that field]
  G -->|2+| J[Select parent field]
  I --> K[Save]
  J --> K
  K --> L[Create new child entry]
  L --> M{Parent field type}
  M -->|Link| N[Replace parent field value,<br/>sourceEntryIds, and edges]
  M -->|Array| O[Append child to parent field,<br/>sourceEntryIds, and edges]
  N --> P["Edge: from=parent → to=child"]
  O --> P
Loading

Before vs after

Before (wrong) After
Who holds __ref New entry Parent entry
Reference fields shown New content type Parent content type
Graph edge from=new → to=existing from=parent → to=child
Yes disabled when New CT has no ref fields No parent can accept a ref

Test plan

  • Add entry No → saves standalone entry with mapped fields
  • Add entry Yes with parent that has one Link field → links as child without showing field select
  • Add entry Yes with parent that has multiple ref fields → field select appears; Save requires a choice
  • Parent already has a filled single Link → creating a new child replaces the old reference on create
  • Parent Array reference → new child is appended
  • When every existing entry’s CT has no Entry refs → Yes is disabled, No still works
  • New entry CT with no ref fields (e.g. Component/Tag) but parents can accept refs → Yes stays enabled

Made with Cursor

@JuliRossi
JuliRossi requested a review from a team as a code owner July 21, 2026 19:51

@FBanfi Franco Banfi (FBanfi) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Left a comment that I don't think would end up happing in practice but that may be worth addressing just in case!

JuliRossi and others added 4 commits July 24, 2026 12:09
… path + rename fmIdx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ds, fieldMappings, and edges consistent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… double Object.keys call

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…zedField, drop unnecessary casts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants