libs/ngx-pfe/pfe-actions/nested-actions/nested-actions.model.ts
You can group a list of actions that will be executed together
Example :{
"type": "PFE_NESTED_ACTIONS",
"conditions": [
{
"expression": "{$.EMAIL_ERROR}"
}
],
"break": true,
"actions": [
{
"type": "EDP_TOAST_NOTIFICATION",
// Show a toast notification of error...
},
{
"type": "PFE_UPDATE_STATE_VALUES",
// Restore the email to the previous one
}
]
}JsonSchema:
export type UnNestedActionConfig = PfeActionConfig | XtraActionsConfig;
export type PortalActionConfig = UnNestedActionConfig | PfeNestedActions<UnNestedActionConfig>;
export interface PortalNavigationConfiguration extends PfeNavigationConfiguration<PortalActionConfig> {}
No results matching.
Properties |
|
| actions |
actions:
|
Type : Array<ACTIONS | PfeBaseActionConfig>
|
| type |
type:
|
Type : typeof PfeNestedActionsType
|
| break |
break:
|
Type : boolean
|
| Optional |
|
If break is "true" and the action was executed (that means, no conditions or conditions returns true) The flow will be stopped and the next actions will not be executed |
| conditions |
conditions:
|
Type : Conditions
|
| Optional |
|
A list of conditions under which the actions are executed |
| globalConfigId |
globalConfigId:
|
Type : string
|
| Optional |
|
Only valid on the navigation. Will spread the actions. |
import { PfeBaseActionConfig } from './../pfe-actions.model';
export const PfeNestedActionsType = 'PFE_NESTED_ACTIONS';
/**
* You can group a list of actions that will be executed together
* ```json
* {
* "type": "PFE_NESTED_ACTIONS",
* "conditions": [
* {
* "expression": "{$.EMAIL_ERROR}"
* }
* ],
* "break": true,
* "actions": [
* {
* "type": "EDP_TOAST_NOTIFICATION",
* // Show a toast notification of error...
* },
* {
* "type": "PFE_UPDATE_STATE_VALUES",
* // Restore the email to the previous one
* }
* ]
* }
* ```
* JsonSchema:
* - In theory, we can nest endless actions, but probably we want to keep things simple. Also the json-schema
* can give some errors.
* Here its an example of the JsonSchema
* ```typescript
* export type UnNestedActionConfig = PfeActionConfig | XtraActionsConfig;
* export type PortalActionConfig = UnNestedActionConfig | PfeNestedActions<UnNestedActionConfig>;
* export interface PortalNavigationConfiguration extends PfeNavigationConfiguration<PortalActionConfig> {}
* ```
*/
export interface PfeNestedActions<ACTIONS> extends PfeBaseActionConfig {
type: typeof PfeNestedActionsType;
actions: Array<ACTIONS | PfeBaseActionConfig>;
}