feat(InstallWizard): support fieldMapping prop (dynamic field + value mappings)#1619
Draft
dionlow wants to merge 2 commits into
Draft
feat(InstallWizard): support fieldMapping prop (dynamic field + value mappings)#1619dionlow wants to merge 2 commits into
dionlow wants to merge 2 commits into
Conversation
… 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>
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.
Context
The classic Configure variant fully supports the developer-supplied
fieldMappingprop (<InstallIntegration fieldMapping={...}>); the wizard (variant="wizard") ignored it entirely —grepforfieldMapping/valueMapping/mappedValuesacrossInstallWizard/andheadless/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
fieldMappingprop now produces the sameselectedFieldMappings+selectedValueMappingsconfig as the classic flow. Part of wizard parity (ENG-4056).The data model
FieldMapping = { [objectName]: DynamicMappingsInputEntry[] }. Three entry shapes, three behaviors:mapToNamefieldNamemappedValuesChanges
useConfigHelper.tsx): addgetValueMapping/setValueMappingtoReadObjectHandlers. Dynamic field mappings reuse the existingsetFieldMapping.useObjectMappings.ts): merge manifest map fields with the prop — prop dynamic field mappings (mapToName, nofieldName) fold into optional rows with prop precedence on collisions; prop entries withmappedValuesbecome value-mapping units.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 — nouseEffect, no seeding.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.buildSubmissionConfig.ts→ReviewStep.tsx): derived projection prunes staleselectedValueMappings(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 --noEmitcleanyarn lint— 0 errorsyarn build— full ESM/CJS/dts build succeedsNot included
yarn testreports "No tests found"). Standing up that infra + thebuildSubmissionConfig/useConfigHelperunit tests is a separate change. Manual/Storybook verification against a referencefieldMappingprop still pending.🤖 Generated with Claude Code