Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev Guide
Dev GuideUser GuidesLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

LifecycleSettingsResult

OCP App SDK / LifecycleSettingsResult

LifecycleSettingsResult

Used to compose a response to the onSettingsForm lifecycle request

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor()

Signature

new LifecycleSettingsResult(): LifecycleSettingsResult;

Returns

LifecycleSettingsResult

Inherited from: FormResult.constructor

Properties

errors

Protected object = {}

Index signature

[field: string]: string[]

Type declaration

Inherited from: FormResult.errors

Defined in: src/app/lib/FormResult.ts:4

toasts

Protected {

`intent`: [`Intent`](app-sdk-api-reference-types-intent);
`message`: `string`;

}[] = []

Inherited from: FormResult.toasts

Defined in: src/app/lib/FormResult.ts:5

Methods

addError()

Add an error to display to the user for a particular form field (implicitly scoped to the submitted section)

Signature

addError(field: string, error: string): LifecycleSettingsResult;

Parameters

NameTypeDescription
fieldstringkey to display the error under, as defined in the form schema
errorstringmessage to display to the user

Returns

LifecycleSettingsResult

Defined in: src/app/lib/LifecycleSettingsResult.ts:25

addToast()

Display a toast to user, such as, "Successfully authenticated with " or
"Authentication failed, please check your credentials and try again."

Signature

addToast(intent: Intent, message: string): LifecycleSettingsResult;

Parameters

NameTypeDescription
intentIntentone of the supported intents that will affect how the toast is displayed
messagestringto display in the toast

Returns

LifecycleSettingsResult

Inherited from: FormResult.addToast

Defined in: src/app/lib/FormResult.ts:13

redirect()

Redirect the user to another page, such as for an OAuth flow. Calling this method will override any value
previously set by redirectToSettings.

Signature

redirect(url: string): LifecycleSettingsResult;

Parameters

NameTypeDescription
urlstringthe destination URL for the redirect (location header)

Returns

LifecycleSettingsResult

Defined in: src/app/lib/LifecycleSettingsResult.ts:34

redirectToSettings()

Redirect the user to a particular section of the settings form. Calling this method will override any value
previously set by redirect.

Signature

redirectToSettings(section: string): LifecycleSettingsResult;

Parameters

NameTypeDescription
sectionstringto open

Returns

LifecycleSettingsResult

Defined in: src/app/lib/LifecycleSettingsResult.ts:45