Skip to content

feat(drive-integration): add entry wizard for new entry design updates [INTEG-4136]#11027

Merged
Franco Banfi (FBanfi) merged 33 commits into
drive-integration-v1.1from
integ-4136-add-entry-wizard-v2
Jun 19, 2026
Merged

feat(drive-integration): add entry wizard for new entry design updates [INTEG-4136]#11027
Franco Banfi (FBanfi) merged 33 commits into
drive-integration-v1.1from
integ-4136-add-entry-wizard-v2

Conversation

@FBanfi

@FBanfi Franco Banfi (FBanfi) commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Implements the "Add entry" wizard in the edit content modal as part of the new entry design updates. Users can now create a new entry directly from the mapping review screen, optionally wiring it as a reference to an existing entry.

Approach

A 4-step (up to 5-step) semi-wizard is rendered inside the existing EditModal using the existing Modal.Controls buttons for navigation — no new internal buttons:

  1. Select content type — pick the type for the new entry
  2. Is it a reference? — yes/no radio
  3. Select the referenced entry (child) — dropdown of existing entries
  4. Which field holds the reference? — only shown when the content type has more than one Link/Entry or Array/Entry field; auto-skipped otherwise
  5. Select fields — map document content to fields on the new entry (reuses FieldSelectionDropdown)

Key implementation details:

  • WizardStep is an enum; handleWizardNext/Back use switch statements
  • referenceGraph is lifted into useState in ReviewPage (same pattern as entryBlockGraph) so new reference edges can be appended client-side
  • On save, { __ref: childTempId } is written into the new entry's reference field — the backend merges mappingEntry.fields verbatim in step 10, and entryService.ts resolves __ref values in pass 2
  • isEntryReferenceField and buildFieldOptionsForContentType extracted to fieldFormatting.ts to avoid duplication

Testing steps

Automated tests added for the wizzard.

Grabacion.de.pantalla.2026-06-17.a.la.s.12.13.13.p.m.mov

Breaking Changes

No.

Dependencies and/or References

Link to INTEG-4136

🤖 Co-authored with Claude Code

Franco Banfi (FBanfi) and others added 13 commits June 17, 2026 12:02
…G-4136]

Wires up the "Add entry" button in the EditModal with a 4-step semi-wizard:
select content type → is-reference → select reference entry → select fields.
On save, appends a new EntryBlockGraphEntry and applies field assignments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… [INTEG-4136]

Remove wizard-internal buttons. Wizard step state is lifted into EditModal
so Modal.Controls drives Back/Next/Save, and the X button cancels as usual.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… [INTEG-4136]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… fidelity [INTEG-4136]

referenceGraph now lives in useState in ReviewPage (same pattern as
entryBlockGraph). handleAddEntry appends a reference edge when the wizard's
isReference + referenceEntryId are set, so the graph reflects the new
relationship immediately without a full workflow re-run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on [INTEG-4136]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…to fieldFormatting [INTEG-4136]

Removes duplicated field-option mapping logic shared between
getNewLocationForEntry and buildNewLocationForContentType.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n add [INTEG-4136]

Auto-picks the first Link/Entry or Array/Entry field on the content type
and writes { __ref: referenceEntryId } into newEntry.fields so entryService
pass 2 resolves it to a real Contentful link on create.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, selected entry is parent

Parent entry now holds { __ref: newTempId } in its first Link/Entry field.
Reference graph edge is from parent → new child, matching Contentful's data model.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…is child, selected entry is parent"

This reverts commit baf8b1f.
…try wizard

New step 4 (SelectReferenceField) appears between SelectReference and SelectFields
when the chosen content type has more than one Link/Entry or Array/Entry field.
Auto-skipped for content types with a single reference field — falls back to
auto-picking the first one. User-selected field id is passed through to handleAddEntry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…to fieldFormatting

Replaces inline Link/Entry + Array/Entry checks in MappingView and EditModal
with a named predicate, consistent with the existing isAssetFieldForImageAssign pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve the field object once instead of storing the id and re-scanning
fields to check its type. Removes the redundant inner refFieldId check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FBanfi Franco Banfi (FBanfi) requested review from a team as code owners June 17, 2026 15:07
Franco Banfi (FBanfi) and others added 4 commits June 17, 2026 12:29
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mage targets in handleAddEntry

- Pass live `referenceGraph` state as a prop to MappingView so appended
  edges are read from current state rather than the original payload snapshot,
  preventing edge loss when adding multiple reference entries in one session
- Remove duplicate assetTargets/rtTargets variables in the image content
  branch — reuse the already-computed richTextTargets/nonRichTextTargets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
contentType: WorkflowContentType | undefined
): EditModalFieldOption[] {
return (contentType?.fields ?? []).filter(isWorkflowContentTypeFieldWithId).map((field) => {
const fieldType = typeof field.type === 'string' ? field.type : 'Text';

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.

⛏️ I think we should not need to check this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point! A field without a type is malformed and shouldn't be processed. Instead of falling back to Text, we now skip it entirely. Added a hasFieldType guard in fieldFormatting.ts and reused it in the two spots in MappingView.tsx as well.

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.

💡 I think this file is too large. We should probably refactor it a bit

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Leaving this for another PR

Franco Banfi (FBanfi) and others added 7 commits June 18, 2026 18:26
…g to Text

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… resolution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_STEPS descriptor map

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… EditModal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FBanfi Franco Banfi (FBanfi) merged commit 0eb3b06 into drive-integration-v1.1 Jun 19, 2026
11 checks passed
@FBanfi Franco Banfi (FBanfi) deleted the integ-4136-add-entry-wizard-v2 branch June 19, 2026 14:55
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.

2 participants