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

Dev Guide
Dev GuideUser GuidesGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

LifecycleSettingsResult

OCP App SDK


OCP App SDK / LifecycleSettingsResult

Class: LifecycleSettingsResult

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

Used to compose a response to the onSettingsForm lifecycle request

Extends

Constructors

Constructor

new LifecycleSettingsResult(): LifecycleSettingsResult

Returns

LifecycleSettingsResult

Inherited from

FormResult.constructor

Properties

errors

protected errors: object = {}

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

Index Signature

[field: string]: string[]

Inherited from

FormResult.errors


toasts

protected toasts: object[] = []

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

intent

intent: Intent

message

message: string

Inherited from

FormResult.toasts

Methods

addError()

addError(field, error): this

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

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

Parameters

field

string

key to display the error under, as defined in the form schema

error

string

message to display to the user

Returns

this


addToast()

addToast(intent, message): this

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

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

Parameters

intent

Intent

one of the supported intents that will affect how the toast is displayed

message

string

to display in the toast

Returns

this

Inherited from

FormResult.addToast


redirect()

redirect(url): this

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

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

Parameters

url

string

the destination URL for the redirect (location header)

Returns

this


redirectToSettings()

redirectToSettings(section): this

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

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

Parameters

section

string

to open

Returns

this