LifecycleSettingsResult
OCP App SDK / LifecycleSettingsResult
LifecycleSettingsResult
Used to compose a response to the onSettingsForm lifecycle request
Hierarchy
FormResult
.LifecycleSettingsResult
Index
Constructors
Properties
Methods
Constructors
constructor()
Signature
new LifecycleSettingsResult(): LifecycleSettingsResult;
Returns
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
Name | Type | Description |
---|---|---|
field | string | key to display the error under, as defined in the form schema |
error | string | message to display to the user |
Returns
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
Name | Type | Description |
---|---|---|
intent | Intent | one of the supported intents that will affect how the toast is displayed |
message | string | to display in the toast |
Returns
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
Name | Type | Description |
---|---|---|
url | string | the destination URL for the redirect (location header) |
Returns
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
Name | Type | Description |
---|---|---|
section | string | to open |
Returns
Defined in: src/app/lib/LifecycleSettingsResult.ts:45
Updated 2 months ago