From 0bff94b9fa8fddbc5bad8dbf125aef83176e1df6 Mon Sep 17 00:00:00 2001 From: Bruno Silva Date: Wed, 7 Oct 2026 18:36:07 +0100 Subject: [PATCH 1/3] feat(ENG-3220): show only the notice for apps linked at sign-in An app whose accounts the identity provider links at sign-in (Okta Cross App Access) has nothing to connect, but the no-fields view still said "Press Connect below to authenticate" under the API's "linked through SSO" notice, and Connect only returned an error. When the API marks the config linkedAtSignIn, the Hub shows the notice alone and drops Connect. Back stays, so the user can return to the list. --- .../integration-picker/IntegrationPicker.tsx | 3 ++ .../components/IntegrationFields.tsx | 52 ++++++++++++------- .../components/IntegrationPickerContent.tsx | 3 ++ .../components/cardFooter.tsx | 20 ++++--- .../components/views/IntegrationFormView.tsx | 3 ++ .../hooks/useIntegrationPicker.ts | 2 + src/modules/integration-picker/types.test.ts | 37 +++++++++++++ src/modules/integration-picker/types.ts | 8 +++ 8 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 src/modules/integration-picker/types.test.ts diff --git a/src/modules/integration-picker/IntegrationPicker.tsx b/src/modules/integration-picker/IntegrationPicker.tsx index d8ee013..b4c68c4 100644 --- a/src/modules/integration-picker/IntegrationPicker.tsx +++ b/src/modules/integration-picker/IntegrationPicker.tsx @@ -43,6 +43,7 @@ export const IntegrationPicker: React.FC = ({ fields, notices, guide, + linkedAtSignIn, // State connectionState, @@ -108,6 +109,7 @@ export const IntegrationPicker: React.FC = ({ showActions={!connectionState.loading && !connectionState.success} onBack={accountData || hasOnlyOneIntegration ? undefined : onBack} onNext={handleConnect} + canConnect={!linkedAtSignIn} isFormValid={isFormValid} isLoading={isLoading} showFooterLinks={showFooterLinks} @@ -157,6 +159,7 @@ export const IntegrationPicker: React.FC = ({ hubData={hubData ?? null} fields={fields} notices={notices} + linkedAtSignIn={linkedAtSignIn} errorHubData={(errorHubData as Error) ?? null} errorConnectorData={(errorConnectorData as Error) ?? null} onSelect={setSelectedIntegration} diff --git a/src/modules/integration-picker/components/IntegrationFields.tsx b/src/modules/integration-picker/components/IntegrationFields.tsx index 68fe908..441fd35 100644 --- a/src/modules/integration-picker/components/IntegrationFields.tsx +++ b/src/modules/integration-picker/components/IntegrationFields.tsx @@ -218,6 +218,7 @@ const ErrorBlock = ({ error }: { error?: { message: string; provider_response: s interface IntegrationFieldsProps { fields: Array; notices?: Array; + linkedAtSignIn?: boolean; error?: { message: string; provider_response: string; @@ -234,7 +235,8 @@ const NoFieldsView: React.FC<{ integrationName: string; error?: { message: string; provider_response: string }; notices?: AuthenticationNotice[]; -}> = ({ integrationName, error, notices = [] }) => { + linkedAtSignIn?: boolean; +}> = ({ integrationName, error, notices = [], linkedAtSignIn = false }) => { // No fields for a notice to sit above or below, so position is irrelevant here — // render every notice together rather than orphaning bottom ones under the card. return ( @@ -251,24 +253,26 @@ const NoFieldsView: React.FC<{ {notices.map((n) => ( ))} - - - - Press "Connect" below to authenticate - - - An authentication window for {integrationName} will display, -
- please complete the necessary steps. -
-
-
+ {!linkedAtSignIn && ( + + + + Press "Connect" below to authenticate + + + An authentication window for {integrationName} will display, +
+ please complete the necessary steps. +
+
+
+ )} ); }; @@ -276,6 +280,7 @@ const NoFieldsView: React.FC<{ export const IntegrationForm: React.FC = ({ fields, notices = [], + linkedAtSignIn, onChange, error, onValidationChange, @@ -336,7 +341,14 @@ export const IntegrationForm: React.FC = ({ }, [isValid, onValidationChange]); if (displayedFields.length === 0) { - return ; + return ( + + ); } return ( diff --git a/src/modules/integration-picker/components/IntegrationPickerContent.tsx b/src/modules/integration-picker/components/IntegrationPickerContent.tsx index 280819e..b6f15f7 100644 --- a/src/modules/integration-picker/components/IntegrationPickerContent.tsx +++ b/src/modules/integration-picker/components/IntegrationPickerContent.tsx @@ -31,6 +31,7 @@ interface IntegrationPickerContentProps { hubData: HubData | null; fields: ConnectorConfigField[]; notices?: AuthenticationNotice[]; + linkedAtSignIn?: boolean; selectedCategory: string | null; search: string; @@ -56,6 +57,7 @@ export const IntegrationPickerContent: React.FC = hubData, fields, notices, + linkedAtSignIn, selectedCategory, search, errorHubData, @@ -122,6 +124,7 @@ export const IntegrationPickerContent: React.FC = void; onNext: () => void; + canConnect?: boolean; isFormValid?: boolean; isLoading?: boolean; showFooterLinks?: boolean; @@ -27,6 +28,7 @@ const CardFooter: React.FC = ({ showActions, onBack, onNext, + canConnect = true, isFormValid = true, isLoading = false, showFooterLinks = true, @@ -54,16 +56,18 @@ const CardFooter: React.FC = ({ }); } - buttons.push({ - label: 'Connect', - type: 'filled' as const, - onClick: onNext, - disabled: !isFormValid || isLoading, - loading: isLoading, - }); + if (canConnect) { + buttons.push({ + label: 'Connect', + type: 'filled' as const, + onClick: onNext, + disabled: !isFormValid || isLoading, + loading: isLoading, + }); + } return buttons; - }, [selectedIntegration, onBack, onNext, showActions, isFormValid, isLoading]); + }, [selectedIntegration, onBack, onNext, showActions, canConnect, isFormValid, isLoading]); if (buttons.length === 0) { if (!showFooterLinks) { diff --git a/src/modules/integration-picker/components/views/IntegrationFormView.tsx b/src/modules/integration-picker/components/views/IntegrationFormView.tsx index c862851..b6f50d1 100644 --- a/src/modules/integration-picker/components/views/IntegrationFormView.tsx +++ b/src/modules/integration-picker/components/views/IntegrationFormView.tsx @@ -5,6 +5,7 @@ import { IntegrationForm } from '../IntegrationFields'; interface IntegrationFormViewProps { fields: ConnectorConfigField[]; notices?: AuthenticationNotice[]; + linkedAtSignIn?: boolean; error?: { message: string; provider_response: string; @@ -20,6 +21,7 @@ interface IntegrationFormViewProps { export const IntegrationFormView: React.FC = ({ fields, notices, + linkedAtSignIn, error, onChange, onValidationChange, @@ -32,6 +34,7 @@ export const IntegrationFormView: React.FC = ({ = {}): FalconConnectorConfig => ({ + key: 'todo', + name: 'Todo', + type: 'custom', + configFields: [], + ...overrides, +}); + +const legacyConfig: LegacyConnectorConfig = { + key: 'todo', + name: 'Todo', + authentication: {}, +}; + +describe('#isLinkedAtSignIn', () => { + describe('when the identity provider links the accounts at sign-in', () => { + it('is true', () => { + expect(isLinkedAtSignIn(falconConfig({ linkedAtSignIn: true }))).toBe(true); + }); + }); + + describe('when the user connects the account here', () => { + it('is false', () => { + expect(isLinkedAtSignIn(falconConfig())).toBe(false); + }); + }); + + describe('when the config is a legacy one, or has not loaded', () => { + it('is false', () => { + expect(isLinkedAtSignIn(legacyConfig)).toBe(false); + expect(isLinkedAtSignIn(undefined)).toBe(false); + }); + }); +}); diff --git a/src/modules/integration-picker/types.ts b/src/modules/integration-picker/types.ts index b31c436..72a86bc 100644 --- a/src/modules/integration-picker/types.ts +++ b/src/modules/integration-picker/types.ts @@ -124,6 +124,8 @@ export interface FalconConnectorConfig { grantType?: 'authorization_code' | 'client_credentials'; configFields?: Array; configNotices?: Array; + /** The identity provider links these accounts when the user signs in, so there is nothing to connect. */ + linkedAtSignIn?: boolean; assets?: { icon: string; }; @@ -156,6 +158,12 @@ export function isFalconConnectorConfig(config: ConnectorConfig): config is Falc return ('configFields' in config || 'configNotices' in config) && !('authentication' in config); } +export function isLinkedAtSignIn(config: ConnectorConfig | undefined): boolean { + return ( + config !== undefined && isFalconConnectorConfig(config) && config.linkedAtSignIn === true + ); +} + export interface AccountData { secureId: string; provider: string; From 673ed3fb953f010818cc90fc8144bdd326f2abf0 Mon Sep 17 00:00:00 2001 From: Bruno Silva Date: Wed, 7 Oct 2026 19:35:45 +0100 Subject: [PATCH 2/3] refactor(ENG-3220): read linkedAtSignIn where the config is already narrowed The fields memo already narrows to a Falcon config, so it carries the flag and the separate type guard goes. The footer builds its buttons as one array instead of pushing onto a mutable one. --- .../components/cardFooter.tsx | 53 +++++++++---------- .../hooks/useIntegrationPicker.ts | 6 +-- src/modules/integration-picker/types.test.ts | 37 ------------- src/modules/integration-picker/types.ts | 6 --- 4 files changed, 27 insertions(+), 75 deletions(-) delete mode 100644 src/modules/integration-picker/types.test.ts diff --git a/src/modules/integration-picker/components/cardFooter.tsx b/src/modules/integration-picker/components/cardFooter.tsx index e26aedb..14b7a1f 100644 --- a/src/modules/integration-picker/components/cardFooter.tsx +++ b/src/modules/integration-picker/components/cardFooter.tsx @@ -38,35 +38,30 @@ const CardFooter: React.FC = ({ return []; } - const buttons: Array<{ - label: string; - type: 'outline' | 'filled'; - onClick: () => void; - disabled: boolean; - loading: boolean; - }> = []; - - if (onBack) { - buttons.push({ - label: 'Back', - type: 'outline' as const, - onClick: onBack, - disabled: isLoading, - loading: false, - }); - } - - if (canConnect) { - buttons.push({ - label: 'Connect', - type: 'filled' as const, - onClick: onNext, - disabled: !isFormValid || isLoading, - loading: isLoading, - }); - } - - return buttons; + return [ + ...(onBack + ? [ + { + label: 'Back', + type: 'outline' as const, + onClick: onBack, + disabled: isLoading, + loading: false, + }, + ] + : []), + ...(canConnect + ? [ + { + label: 'Connect', + type: 'filled' as const, + onClick: onNext, + disabled: !isFormValid || isLoading, + loading: isLoading, + }, + ] + : []), + ]; }, [selectedIntegration, onBack, onNext, showActions, canConnect, isFormValid, isLoading]); if (buttons.length === 0) { diff --git a/src/modules/integration-picker/hooks/useIntegrationPicker.ts b/src/modules/integration-picker/hooks/useIntegrationPicker.ts index e4673a4..8db428e 100644 --- a/src/modules/integration-picker/hooks/useIntegrationPicker.ts +++ b/src/modules/integration-picker/hooks/useIntegrationPicker.ts @@ -16,7 +16,6 @@ import { Integration, isFalconConnectorConfig, isLegacyConnectorConfig, - isLinkedAtSignIn, } from '../types'; import { isSecretPlaceholder } from '../utils/secretPlaceholder'; @@ -201,7 +200,7 @@ export const useIntegrationPicker = ({ ...RETRY_CONFIG, }); - const { fields, guide, notices } = useMemo(() => { + const { fields, guide, notices, linkedAtSignIn } = useMemo(() => { if (!connectorData || !selectedIntegration) { const fields: ConnectorConfigField[] = []; const notices: AuthenticationNotice[] = []; @@ -259,6 +258,7 @@ export const useIntegrationPicker = ({ return { fields: fieldsWithPrefilledValues, notices: connectorData.config.configNotices ?? [], + linkedAtSignIn: connectorData.config.linkedAtSignIn === true, guide: { supportLink: connectorData.config.support?.link, description: connectorData.config.support?.description ?? '', @@ -791,7 +791,7 @@ export const useIntegrationPicker = ({ fields, notices, guide, - linkedAtSignIn: isLinkedAtSignIn(connectorData?.config), + linkedAtSignIn, // State formData, diff --git a/src/modules/integration-picker/types.test.ts b/src/modules/integration-picker/types.test.ts deleted file mode 100644 index 9de4530..0000000 --- a/src/modules/integration-picker/types.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { describe, expect, it } from 'vitest'; -import { type FalconConnectorConfig, type LegacyConnectorConfig, isLinkedAtSignIn } from './types'; - -const falconConfig = (overrides: Partial = {}): FalconConnectorConfig => ({ - key: 'todo', - name: 'Todo', - type: 'custom', - configFields: [], - ...overrides, -}); - -const legacyConfig: LegacyConnectorConfig = { - key: 'todo', - name: 'Todo', - authentication: {}, -}; - -describe('#isLinkedAtSignIn', () => { - describe('when the identity provider links the accounts at sign-in', () => { - it('is true', () => { - expect(isLinkedAtSignIn(falconConfig({ linkedAtSignIn: true }))).toBe(true); - }); - }); - - describe('when the user connects the account here', () => { - it('is false', () => { - expect(isLinkedAtSignIn(falconConfig())).toBe(false); - }); - }); - - describe('when the config is a legacy one, or has not loaded', () => { - it('is false', () => { - expect(isLinkedAtSignIn(legacyConfig)).toBe(false); - expect(isLinkedAtSignIn(undefined)).toBe(false); - }); - }); -}); diff --git a/src/modules/integration-picker/types.ts b/src/modules/integration-picker/types.ts index 72a86bc..89b8050 100644 --- a/src/modules/integration-picker/types.ts +++ b/src/modules/integration-picker/types.ts @@ -158,12 +158,6 @@ export function isFalconConnectorConfig(config: ConnectorConfig): config is Falc return ('configFields' in config || 'configNotices' in config) && !('authentication' in config); } -export function isLinkedAtSignIn(config: ConnectorConfig | undefined): boolean { - return ( - config !== undefined && isFalconConnectorConfig(config) && config.linkedAtSignIn === true - ); -} - export interface AccountData { secureId: string; provider: string; From f7ea5fa6f0c5589246cf73f47f88780172a99723 Mon Sep 17 00:00:00 2001 From: Bruno Silva Date: Wed, 7 Oct 2026 20:55:04 +0100 Subject: [PATCH 3/3] refactor(ENG-3220): hide the footer actions instead of the Connect button The title's back arrow shows under the same conditions as the footer's Back, so an app linked at sign-in can drop the footer actions like the list view does, with no new prop on CardFooter. --- .../integration-picker/IntegrationPicker.tsx | 5 +- .../components/IntegrationFields.tsx | 2 +- .../components/cardFooter.tsx | 55 ++++++++++--------- .../hooks/useIntegrationPicker.ts | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/modules/integration-picker/IntegrationPicker.tsx b/src/modules/integration-picker/IntegrationPicker.tsx index b4c68c4..870b73d 100644 --- a/src/modules/integration-picker/IntegrationPicker.tsx +++ b/src/modules/integration-picker/IntegrationPicker.tsx @@ -106,10 +106,11 @@ export const IntegrationPicker: React.FC = ({ ) : ( = ({ integrationName, error, notices = [], linkedAtSignIn = false }) => { +}> = ({ integrationName, error, notices = [], linkedAtSignIn }) => { // No fields for a notice to sit above or below, so position is irrelevant here — // render every notice together rather than orphaning bottom ones under the card. return ( diff --git a/src/modules/integration-picker/components/cardFooter.tsx b/src/modules/integration-picker/components/cardFooter.tsx index 14b7a1f..f8c9d72 100644 --- a/src/modules/integration-picker/components/cardFooter.tsx +++ b/src/modules/integration-picker/components/cardFooter.tsx @@ -16,7 +16,6 @@ interface CardFooterProps { showActions?: boolean; onBack?: () => void; onNext: () => void; - canConnect?: boolean; isFormValid?: boolean; isLoading?: boolean; showFooterLinks?: boolean; @@ -28,7 +27,6 @@ const CardFooter: React.FC = ({ showActions, onBack, onNext, - canConnect = true, isFormValid = true, isLoading = false, showFooterLinks = true, @@ -38,31 +36,34 @@ const CardFooter: React.FC = ({ return []; } - return [ - ...(onBack - ? [ - { - label: 'Back', - type: 'outline' as const, - onClick: onBack, - disabled: isLoading, - loading: false, - }, - ] - : []), - ...(canConnect - ? [ - { - label: 'Connect', - type: 'filled' as const, - onClick: onNext, - disabled: !isFormValid || isLoading, - loading: isLoading, - }, - ] - : []), - ]; - }, [selectedIntegration, onBack, onNext, showActions, canConnect, isFormValid, isLoading]); + const buttons: Array<{ + label: string; + type: 'outline' | 'filled'; + onClick: () => void; + disabled: boolean; + loading: boolean; + }> = []; + + if (onBack) { + buttons.push({ + label: 'Back', + type: 'outline' as const, + onClick: onBack, + disabled: isLoading, + loading: false, + }); + } + + buttons.push({ + label: 'Connect', + type: 'filled' as const, + onClick: onNext, + disabled: !isFormValid || isLoading, + loading: isLoading, + }); + + return buttons; + }, [selectedIntegration, onBack, onNext, showActions, isFormValid, isLoading]); if (buttons.length === 0) { if (!showFooterLinks) { diff --git a/src/modules/integration-picker/hooks/useIntegrationPicker.ts b/src/modules/integration-picker/hooks/useIntegrationPicker.ts index 8db428e..d3643fe 100644 --- a/src/modules/integration-picker/hooks/useIntegrationPicker.ts +++ b/src/modules/integration-picker/hooks/useIntegrationPicker.ts @@ -258,7 +258,7 @@ export const useIntegrationPicker = ({ return { fields: fieldsWithPrefilledValues, notices: connectorData.config.configNotices ?? [], - linkedAtSignIn: connectorData.config.linkedAtSignIn === true, + linkedAtSignIn: connectorData.config.linkedAtSignIn, guide: { supportLink: connectorData.config.support?.link, description: connectorData.config.support?.description ?? '',