Skip to content

feat(InstallWizard): support fieldMapping prop (dynamic field + value mappings)#1619

Draft
dionlow wants to merge 2 commits into
mainfrom
eng-feat/wizard-fieldmapping-prop-parity
Draft

feat(InstallWizard): support fieldMapping prop (dynamic field + value mappings)#1619
dionlow wants to merge 2 commits into
mainfrom
eng-feat/wizard-fieldmapping-prop-parity

Conversation

@dionlow

@dionlow dionlow commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Context

The classic Configure variant fully supports the developer-supplied fieldMapping prop (<InstallIntegration fieldMapping={...}>); the wizard (variant="wizard") ignored it entirely — grep for fieldMapping/valueMapping/mappedValues across InstallWizard/ and headless/ returned zero matches. The wizard sourced mapping rows only from the amp.yaml manifest, so anything declared only in the prop never rendered.

This brings the wizard to parity: a wizard install consuming a fieldMapping prop now produces the same selectedFieldMappings + selectedValueMappings config as the classic flow. Part of wizard parity (ENG-4056).

The data model

FieldMapping = { [objectName]: DynamicMappingsInputEntry[] }. Three entry shapes, three behaviors:

Entry shape mapToName fieldName mappedValues Consumer action
field + values Pick a field, then map its values
value-only ✅ (fixed) Only map values (field pre-known)
field-only Only pick a field

Changes

  • headless (useConfigHelper.tsx): add getValueMapping/setValueMapping to ReadObjectHandlers. Dynamic field mappings reuse the existing setFieldMapping.
  • derivation (useObjectMappings.ts): merge manifest map fields with the prop — prop dynamic field mappings (mapToName, no fieldName) fold into optional rows with prop precedence on collisions; prop entries with mappedValues become value-mapping units.
  • UI (value-mappings/): per-entry value-mapping blocks rendered under field mappings on the same Mappings page. Field-mapped units resolve their field from the user's selection; fixed-field units map values directly. Options/validation mirror classic. Fully derived — no useEffect, no seeding.
  • navigation (subPageUtils.ts, useSubPageNavigation.ts, ObjectTabs.tsx): the existing Mappings sub-page now appears when mappings come only from the prop. No new sub-page added.
  • submit (buildSubmissionConfig.tsReviewStep.tsx): derived projection prunes stale selectedValueMappings (fields no longer resolved) at create time instead of eager clearing, preserving user picks on field toggle. Review summary now includes prop-dynamic field mappings.

Verification

  • tsc --noEmit clean
  • yarn lint — 0 errors
  • yarn build — full ESM/CJS/dts build succeeds

Not included

  • Automated tests: the repo has no working jest TS setup (no babel preset / alias mapping / testing-library; yarn test reports "No tests found"). Standing up that infra + the buildSubmissionConfig/useConfigHelper unit tests is a separate change. Manual/Storybook verification against a reference fieldMapping prop still pending.
  • Manifest-driven value mappings (feature is prop-driven, matching classic); wizard update/edit-existing flow (wizard is create-only today).

🤖 Generated with Claude Code

Dion Low and others added 2 commits June 24, 2026 15:28
… mappings)

Bring the wizard variant to parity with the classic Configure flow for the
developer-supplied `fieldMapping` prop, which the wizard previously ignored.

- headless: add getValueMapping/setValueMapping to ReadObjectHandlers
- derive merged mapping units from manifest map fields + fieldMapping prop
  (prop dynamic field mappings take precedence on mapToName collisions)
- render value-mapping blocks per entry on the Mappings sub-page; field-mapped
  entries resolve their field from the user's selection, fixed-field entries
  (fieldName) map values directly
- make the Mappings sub-page appear when mappings come only from the prop
- prune stale value mappings via a derived projection at submit time

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ppable values

- filter provider fields already mapped to another destination out of each
  field-mapping row's options (wizard-idiomatic equivalent of classic
  checkDuplicateFieldError; the current row keeps its own selection)
- replace the silent hide of a value-mapping block with a contextual hint when
  no field is selected yet or the chosen field isn't a mappable picklist

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

1 participant