feat(data-warehouse): render oauth-account-select fields in DynamicSourceSetup#3401
Open
Gilbert09 wants to merge 2 commits into
Open
feat(data-warehouse): render oauth-account-select fields in DynamicSourceSetup#3401Gilbert09 wants to merge 2 commits into
Gilbert09 wants to merge 2 commits into
Conversation
…urceSetup Add support for the backend's `oauth-account-select` field type (a picker whose options are the accounts/resources a connected OAuth integration exposes, e.g. GitHub repositories) to the inbox's generic source-setup renderer, plus a `getOauthAccounts` api-client method. The picker reads its integration id from the sibling `integrationField` in the (flat) form values, fetches options from the oauth_accounts endpoint with debounced server-side search, and falls back to free text until an integration is connected. The backend uses the integration's stored token; the client only passes the id. This is the Code-app consumer for the field type. Routing GitHub's inbox setup through DynamicSourceSetup (repository field uses this picker, removing the bespoke GitHubSetup) is a follow-up, gated on the posthog config swap and best verified with the app running.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
Contributor
|
Reset the oauth-account-select selection when the backing integration changes, so an account (or fallback text) chosen for one integration can't survive into another and be submitted as an account that was never selected for the active integration. Also stop treating typed text as a committed value: typing only filters the list, and picking an option shows the account's human-readable name while submitting its opaque value. Editing the text after a selection clears the committed value rather than silently mutating the underlying account id. Generated-By: PostHog Code Task-Id: d1804989-7d93-42d8-ba74-a5d496495c31
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.
Problem
The inbox source-setup renderer (
DynamicSourceSetup) handles input, select, switch-group, and oauth fields, but not the backend'soauth-account-selectfield type — a picker whose options are the accounts/resources a connected OAuth integration exposes (e.g. GitHub repositories). Without it, a source whose config uses that field type can't be set up from the inbox.Changes
getOauthAccounts(projectId, sourceType, integrationId, search?)api-client method (hitsexternal_data_sources/oauth_accounts/; the backend uses the integration's stored token, so the client only passes an id).oauth-account-selectinDynamicSourceSetup: a searchable picker that reads its integration id from the siblingintegrationFieldin the flat form values, fetches options with debounced (300ms) server-side search, and lets the user pick one. Falls back to a free-text input until a valid integration is connected. Handled inbuildPayload/missingRequiredFieldstoo.This is the Code-app consumer for the field type, paired with the posthog-side work (server-side search + GitHub adoption). Routing GitHub's inbox setup through
DynamicSourceSetup— so itsrepositoryfield uses this picker and the bespokeGitHubSetupis removed — is a follow-up: it needs the GitHub App-install connect wired into the generic OAuth field and is best verified with the app running.How did you test this?
pnpm --filter @posthog/ui --filter @posthog/api-client typecheck— clean for the changed files.DynamicSourceSetupfield patterns.Automatic notifications