Skip to content

1026#5330

Merged
ivicac merged 4 commits into
masterfrom
1026
Jul 3, 2026
Merged

1026#5330
ivicac merged 4 commits into
masterfrom
1026

Conversation

@ivicac

@ivicac ivicac commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the embedded React SDK’s ConnectDialog/workflow-input rendering to support a new field_mapping workflow input type, including client-side JWT sub extraction and a new action-execution hook used by mapping callbacks.

Changes:

  • Add field_mapping as a supported WorkflowInputType plus exported mapping-related types.
  • Introduce action execution support (useExecuteAction) and JWT sub decoding for embedded action endpoints.
  • Add a new FieldMappingField UI + tests, and thread executeAction/mapObjectFields through ConnectDialog.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
sdks/frontend/embedded/library/react/src/main.ts Re-export mapping-related public types from the SDK entrypoint.
sdks/frontend/embedded/library/react/src/components/connect-dialog/utils.ts Add decodeJwtSubject helper used to derive external user id from JWT.
sdks/frontend/embedded/library/react/src/components/connect-dialog/utils.test.ts Add unit tests for decodeJwtSubject.
sdks/frontend/embedded/library/react/src/components/connect-dialog/useExecuteAction.ts New hook that POSTs to embedded generic action execution endpoint.
sdks/frontend/embedded/library/react/src/components/connect-dialog/useExecuteAction.test.ts Add hook tests for request shape and missing-user behavior.
sdks/frontend/embedded/library/react/src/components/connect-dialog/types.ts Extend workflow input types with field_mapping and introduce mapping config/value types.
sdks/frontend/embedded/library/react/src/components/connect-dialog/index.tsx Compute externalUserId, create executeAction, and pass mapping props into ConnectDialog.
sdks/frontend/embedded/library/react/src/components/connect-dialog/FieldMappingField.tsx New field-mapping input UI component with async option loading and custom field creation.
sdks/frontend/embedded/library/react/src/components/connect-dialog/FieldMappingField.test.tsx Tests for object type loading, integration-field loading, and emitted mapping value shape.
sdks/frontend/embedded/library/react/src/components/connect-dialog/ConnectDialog.tsx Thread executeAction/mapObjectFields and render FieldMappingField for field_mapping inputs.
sdks/frontend/embedded/library/react/src/components/connect-dialog/ConnectDialog.internalOnly.test.tsx Test that internalOnly inputs are hidden in workflows view.
sdks/frontend/embedded/library/react/src/components/connect-dialog/ConnectDialog.dynamic.test.tsx Tests around dynamic options fetching, dependency handling, and cache key behavior.
Comments suppressed due to low confidence (1)

sdks/frontend/embedded/library/react/src/components/connect-dialog/types.ts:133

  • WorkflowInputType.value doesn't include the FieldMappingValueType shape even though type: 'field_mapping' expects that value. Including it in the union improves type-safety and avoids downstream casts in ConnectDialog.
export interface WorkflowInputType {
    name: string;
    label: string;
    objectName?: string;
    type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'field_mapping';
    componentReference?: ComponentInputReferenceType;
    defaultValue?: unknown;
    internalOnly?: boolean;
    required?: boolean;
    value?: string | number | readonly string[] | Record<string, unknown> | undefined;
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sdks/frontend/embedded/library/react/src/components/connect-dialog/utils.ts Outdated
ivicac and others added 2 commits July 3, 2026 22:23
- decodeJwtSubject: restore base64url padding before atob so valid
  tokens no longer throw when the payload length is not a multiple of 4
- FieldMappingField: derive HTML ids from a sanitized label base plus
  row index so labels/custom fields with spaces cannot break
  label-for association or collide on DOM ids
- FieldMappingField: trim prompted custom-field names and reject
  duplicates to avoid silently overwriting rows/mappings
- ConnectDialog: only pass executeAction once externalUserId and the
  integration instance id exist, so FieldMappingField does not mount and
  fetch empty options before its prerequisites are ready

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ivicac ivicac merged commit c990d34 into master Jul 3, 2026
4 checks passed
@ivicac ivicac deleted the 1026 branch July 3, 2026 20:55
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.

2 participants