Skip to content

Commit

Permalink
chore: Make FormField analyticsMetadata public
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldowseza committed Feb 5, 2025
1 parent 1ade36a commit 6490f51
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pages/funnel-analytics/static-single-page-flow.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export default function StaticSinglePageCreatePage() {
>
<SpaceBetween size="s">
<FormField
analyticsMetadata={{
instanceIdentifier: 'field1',
}}
info={
<Link data-testid="external-link" external={true} href="#">
Learn more
Expand Down
11 changes: 11 additions & 0 deletions src/form-field/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,20 @@ export interface FormFieldProps extends BaseComponentProps {
* non-empty string, it will render the form field in a warning state.
*/
warningText?: React.ReactNode;

/**
* Specifies additional analytics-related metadata.
* * `instanceIdentifier` - A unique string that identifies this component instance in your application.
* @analytics
*/
analyticsMetadata?: FormFieldProps.AnalyticsMetadata;
}

export namespace FormFieldProps {
export interface AnalyticsMetadata {
instanceIdentifier?: string;
}

export interface I18nStrings {
/**
* Provides a text alternative for the error icon in the error message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ describe.each(['refresh', 'refresh-toolbar'] as Theme[])('%s', theme => {
stepNumber: 1,
subStepName: 'Container 1 - header',
fieldErrorContext: null,
fieldIdentifier: null,
fieldIdentifier: 'field1',
subStepErrorContext: null,
});

Expand Down

0 comments on commit 6490f51

Please sign in to comment.