libs/ngx-pfe/pfe-actions/nested-actions/nested-actions.model.ts
You can group a list of actions that will be executed together
{
"type": "PFE_NESTED_ACTIONS",
"conditions": [
{
"expression": "{$.EMAIL_ERROR}"
}
],
"break": true,
"actions": [
{
"type": "EDP_TOAST_NOTIFICATION",
// Show a toast notification of error...
},
{
"type": "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> {}
Properties |
actions |
actions:
|
Type : ACTIONS[]
|
type |
type:
|
import { PfeBaseActionConfig } from './../pfe-actions.model';
// eslint-disable-next-line @typescript-eslint/naming-convention
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": "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: ACTIONS[];
}