libs/ngx-pfe/pfe-actions/rewind-history/rewind-history.model.ts

Extends

PfeBaseActionConfig

Relationships

Used by

No results matching.

Depends on

Index

Properties

Properties

clearHistory
clearHistory: boolean
Type : boolean
Optional

Ignore all other options and completely clear the history.

keepSelf
keepSelf: boolean
Type : boolean
Optional

Only remove all pages that appear after the page, but keep the page itself

pageId
pageId: string | JsonPathExpression
Type : string | JsonPathExpression
Optional

The pageId for the history to be rewinded to, can optionally be specified. If no pageId is given, the current pageId is used.

The pageId can either be a static string or a JsonPathExpression. This makes it possible to access values like the _pfe.navigationState

It might be necessary to specify the pageId for cases where the rewind happens in between two pages. (During navigation)

type
type: typeof PfeRewindHistory
Type : typeof PfeRewindHistory

The PFE_REWIND_HISTORY action allows it to remove a page and all pages that appear after the earliest occurrence of the given page in the history. Optionally it is also possible to keep the page itself and to only remove all later pages. It is also possible to clear the complete history.

It is possible to optionally specify a pageId. The default is the current page.

Examples:

Example 01: Clear the complete history:

Example :
{
"type": "PFE_REWIND_HISTORY",
"clearHistory": true,
},

Example 02: onPageEnterActions: Remove all pages, after the page that is being entered;

Example :
"onPageEnterActions": [
{
"type": "PFE_REWIND_HISTORY",
"pageId": "$._pfe.navigationState.navigatingTo"
}
]

$._pfe.navigationState.navigatingTo has to be used here to determine the id of the current page, as it will only become the current page after the onPageEnterActions ran. That means at this point in time, the page that we're entering is not yet the current page.

Example 03: When going to a specific page, remove all pages after that page from the history. Scenario: The user jumps back in the flow and might go down another path.

Example :
"onNavigationStartActions": [
{
"type": "PFE_REWIND_HISTORY",
"pageId": "$._pfe.navigationState.navigatingTo",
"conditions": [
{
"expression": "{$._pfe.navigationState.navigatingTo} == 'welcomePage'"
}
]
}
]

The page itself will also be removed from the history. Once it is entered after the navigation, it is added again.

break
break: boolean
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: Conditions
Type : Conditions
Optional

A list of conditions under which the actions are executed

globalConfigId
globalConfigId: string
Type : string
Optional

Only valid on the navigation. Will spread the actions.

import { JsonPathExpression } from '../../models/jsonpath-expression-type.model';
import { PfeBaseActionConfig } from '../pfe-actions.model';

export const PfeRewindHistory = 'PFE_REWIND_HISTORY';

export interface RewindHistoryActionConfig extends PfeBaseActionConfig {
  /**
   * The PFE_REWIND_HISTORY action allows it to remove a page and all pages that appear after the earliest occurrence of the given page in the history.
   * Optionally it is also possible to keep the page itself and to only remove all later pages.
   * It is also possible to clear the complete history.
   *
   * It is possible to optionally specify a pageId. The default is the current page.
   *
   * Examples:
   *
   * Example 01: Clear the complete history:
   *
```json
{
   "type": "PFE_REWIND_HISTORY",
   "clearHistory": true,
},
```
   *
   * Example 02: onPageEnterActions: Remove all pages, after the page that is being entered;
   *
```json
"onPageEnterActions": [
  {
    "type": "PFE_REWIND_HISTORY",
    "pageId": "$._pfe.navigationState.navigatingTo"
  }
]
```
   * `$._pfe.navigationState.navigatingTo` has to be used here to determine the id of the current page, as it will only become the current page after the onPageEnterActions ran.
   * That means at this point in time, the page that we're entering is not yet the current page.

   * Example 03: When going to a specific page, remove all pages after that page from the history. Scenario: The user jumps back in the flow and might go down another path.
   *
```json
"onNavigationStartActions": [
  {
    "type": "PFE_REWIND_HISTORY",
    "pageId": "$._pfe.navigationState.navigatingTo",
    "conditions": [
      {
        "expression": "{$._pfe.navigationState.navigatingTo} == 'welcomePage'"
      }
    ]
  }
]
```
   *
   * The page itself will also be removed from the history. Once it is entered after the navigation, it is added again.
   *
   */
  type: typeof PfeRewindHistory;
  /**
   * Ignore all other options and completely clear the history.
   */
  clearHistory?: boolean;
  /**
   * The pageId for the history to be rewinded to, can optionally be specified.
   * If no pageId is given, the current pageId is used.
   *
   * The pageId can either be a static string or a JsonPathExpression. This makes it possible to access values like the _pfe.navigationState
   *
   * It might be necessary to specify the pageId for cases where the rewind happens in between two pages. (During navigation)
   */
  pageId?: string | JsonPathExpression;
  /**
   * Only remove all pages that appear after the page, but keep the page itself
   */
  keepSelf?: boolean;
}

results matching ""

    No results matching ""