feat: update consumers for new input setting#21
Open
ahasseyp-paragon wants to merge 10 commits intomainfrom
Open
feat: update consumers for new input setting#21ahasseyp-paragon wants to merge 10 commits intomainfrom
ahasseyp-paragon wants to merge 10 commits intomainfrom
Conversation
d53b697 to
718f443
Compare
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
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.
Issues Closed
Brief Summary
adopt
setDataSourcesapi and typed source objects across inputsDetailed Summary
This PR migrates the headless connect example app to use the new
paragon.setDataSources()API and theparagon.getSourcesForInput()resolver. Previously, input components fetched data source configurations viauseDataSourceOptionsusing string-basedsourceTypecache keys. Now, a centralizedsetDataSourcescall inapp.tsxconfigures all dropdowns, field mapping sources, and integration-specific overrides upfront, and each component resolves its typed source objects through the newuseSourcesForInputhook.This aligns the example app with the updated
@useparagon/connectSDK, which introduces typed source discriminators (SingleSource,DefaultFieldValueSources,FieldMapperSources) and asource-first overload forgetFieldOptions.Changes
paragon.setDataSources()call inapp.tsxconfiguring static dropdowns (priority-level), dynamic dropdowns (pokemon-pickervia PokeAPI), static field mappings (Test), dynamic field mappings with object types (Taskvia PokeAPI), and integration-specific source overrides (jira)useSourcesForInputhook inhooks.tsthat wrapsparagon.getSourcesForInput()with memoizationuseFieldOptionsinhooks.tsto accept an optionalsource: DynamicDataSourcealongside the existingsourceType: string, withsourcetaking priority when providedcombo-input.tsxanddynamic-combo-input.tsxfromuseDataSourceOptions<ComboInputDataSource>touseSourcesForInputwithDefaultFieldValueSourcestypedynamic-enum.tsxfromuseDataSourceOptionstouseSourcesForInputwithSingleSourcetypefield-mapper.tsxfromuseDataSourceOptions<FieldMapperDataSource>touseSourcesForInputwithFieldMapperSourcestype; addedfieldMappingEntriescomputed property supportingmapObjectFieldOptions; extractedrenderMainInputOptionshelper to deduplicate JSXfield-mapper.tsxsearch logic to use early returns andfor..ofinstead of indexed loopsCustomDropdownInputcomponent inserialized-connect-input-picker.tsxthat resolves source type at runtime and renders either aComboboxField(dynamic) orSelectField(static)variable-input.tsxprops from string-based keys (sourceType,mainInputKey,dependantInputKey) to typedDynamicDataSourceobjects (variableInputSource,mainInputSource,dependantInputSource)Future Work
sourceType: stringpath fromuseFieldOptionsonce all consumers have migrated to thesourceobject patternuseSourcesForInputreturnsnull(no matching data source configured)CustomDropdownInputdynamic path (cursor-based loading)Steps to Test
pokemon-picker) should fetch and display options from the API with search supportTest) and dynamic (Task) configurationsjiraintegration specifically to confirm integration-specific source overrides apply (e.g.,priority-levelshould show 5 options instead of 3)QA Notes
setDataSourcescall uses PokeAPI as a demo data source — this is for example/testing purposes onlysourceTypestring fallback path is still present inuseFieldOptionsfor backward compatibility — both paths should be exercisedDeployment Notes
@useparagon/connectSDK version that exposessetDataSources,getSourcesForInput, and the typed source interfaces (SingleSource,DefaultFieldValueSources,FieldMapperSources,DynamicDataSource,StaticEnumDataSource)Screenshots
N/A — headless (non-visual) integration changes; UI behavior unchanged