Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add totalSubSteps property and funnelStepError event #1354

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/internal/analytics/__tests__/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function mockFunnelMetrics() {
funnelStepStart: jest.fn(),
funnelStepComplete: jest.fn(),
funnelStepNavigation: jest.fn(),
funnelStepError: jest.fn(),
funnelSubStepStart: jest.fn(),
funnelSubStepComplete: jest.fn(),
funnelSubStepError: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions src/internal/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export let FunnelMetrics: IFunnelMetrics = {
funnelStepStart(): void {},
funnelStepComplete(): void {},
funnelStepNavigation(): void {},
funnelStepError(): void {},
funnelSubStepStart(): void {},
funnelSubStepComplete(): void {},
funnelSubStepError(): void {},
Expand Down
17 changes: 15 additions & 2 deletions src/internal/analytics/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ export interface FunnelStepProps extends BaseFunnelProps {
subStepAllSelector: string;
}

export interface FunnelStepStartProps extends FunnelStepProps {
totalSubSteps?: number;
}
export interface FunnelStepCompleteProps extends FunnelStepProps {
totalSubSteps?: number;
}

export interface FunnelStepNavigationProps extends FunnelStepProps {
destinationStepNumber: number;
navigationType: string;
totalSubSteps?: number;
}

export interface FunnelStepErrorProps extends FunnelStepProps {
stepErrorSelector: string;
}

export interface FunnelSubStepProps extends FunnelStepProps {
Expand Down Expand Up @@ -70,9 +82,10 @@ export interface IFunnelMetrics {
funnelComplete: FunnelMethod<BaseFunnelProps>;
funnelSuccessful: FunnelMethod<BaseFunnelProps>;
funnelCancelled: FunnelMethod<BaseFunnelProps>;
funnelStepStart: FunnelMethod<FunnelStepProps>;
funnelStepComplete: FunnelMethod<FunnelStepProps>;
funnelStepStart: FunnelMethod<FunnelStepStartProps>;
funnelStepComplete: FunnelMethod<FunnelStepCompleteProps>;
funnelStepNavigation: FunnelMethod<FunnelStepNavigationProps>;
funnelStepError: FunnelMethod<FunnelStepErrorProps>;
funnelSubStepStart: FunnelMethod<FunnelSubStepProps>;
funnelSubStepComplete: FunnelMethod<FunnelSubStepProps>;
funnelSubStepError: FunnelMethod<OptionalFunnelSubStepErrorProps>;
Expand Down
1 change: 1 addition & 0 deletions src/wizard/__tests__/analytics.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function mockFunnelMetrics() {
funnelStepStart: jest.fn(),
funnelStepComplete: jest.fn(),
funnelStepNavigation: jest.fn(),
funnelStepError: jest.fn(),
funnelSubStepStart: jest.fn(),
funnelSubStepComplete: jest.fn(),
funnelSubStepError: jest.fn(),
Expand Down
Loading