navigateTo

Updated:
Supported Platforms:
UUX
Config

Transitions to a Tecton or platform level feature.

The navigateTo capability transitions the page to the Tecton or platform-level feature passed as an argument. If navigating to a Tecton feature, a specific module within that feature can be passed as the second argument.

If a module name is not provided for a Tecton feature, the capability will find and navigate to the module with the primary key set to true. Additionally, if the module's configuration has the navigable property set to false, the capability will do nothing. As a result, it may be helpful to check if a module is navigable via the isNavigable capability so you can provide an alternative workflow if necessary.

Using navigateTo with the ssoDirect route requires a navigation node to be in place for the SSO. The UUX platform uses the setup from the navigation option to determine how to open the SSO and whether disclaimer or PDF acceptance is required before opening. The required navigation node can be hidden from display. Please contact us for assistance with adding these required navigation elements.

Details

Type

function navigateTo(featureName: string): void;
function navigateTo(featureName: string, moduleName: string): void;
function navigateTo(featureName: string, urlParams: any[]): void;
function navigateTo(featureName: string, queryParams: Dict<any>): void;
function navigateTo(featureName: string, urlParams: any[], queryParams: Dict<any>): void;
function navigateTo(featureName: string, moduleName: string, urlParams: any[]): void;
function navigateTo(featureName: string, moduleName: string, queryParams: Dict<any>): void;
function navigateTo(options: {featureName?: string, moduleName?: string, urlParams?: any[], queryParams?: Dict<any>}): void;

Example

document.querySelector('#funds-transfer-edit-link').addEventListener('click', () => {
  tecton.actions.navigateTo('FundsTransferEdit', ['15432']);
});

document.querySelector('#goal-savings-rainyday-link').addEventListener('click', () => {
  tecton.actions.navigateTo('GoalBasedSavings', 'create', {category: 'rainyday'});
});

List of available routes

Options Signature

Another acceptable way to call navigateTo is by passing it an options object with named keys for the arguments listed above. All keys (arguments) are optional. Although you must have either moduleName or featureName defined.

If you have featureName defined but not moduleName it will navigate to the "primary" module declared in the specified feature.

If you have moduleName defined but not featureName it will navigate to the specified moduleName declared in your own feature.

tecton.actions.navigateTo({
  featureName: 'FundsTransfer',
  moduleName: 'Main',
  urlParams: ['123'],
  queryParams: {isRecurring: true}
});

Platform Compatibility Notes

To navigate to a non-Tecton route in UUX, login and go to the desired page. Once there, execute the following line of code in the JavaScript console to get the current route's attributes:

The following code is only available at the UUX platform level; do not include it in any module code. This is a private lookup for informational purposes only.

(() => {
  const container = Ngam.__container__;
  const currentRoute = container.lookup(
  "controller:application"
  ).currentRouteName;
  const routeState = container.lookup("router:main")._routerMicrolib.state;
  const params =
  (routeState.params && Object.entries(routeState.params).reverse()) || [];
  const routeParams = params.find((param) => !!Object.keys(param[1]).length);
  const queryParams = routeState.queryParams;
  const finalParams = routeParams ? Object.keys(routeParams[1]).sort().map(key => routeParams[1][key]) : [];
  if (!!Object.keys(queryParams).length) finalParams.push({ queryParams });
  return console.log({
    route: currentRoute,
    routeParams: 0 < finalParams.length ? JSON.stringify(finalParams) : null,
  });
})();

The output will look something like this:

{route: 'tecton', routeParams: '["SavvyMoneyCreditScoreDashboard", "Main"]'}

To navigate to this account page with tecton.actions.navigateTo, set:

  • "account" as the featureName
  • the values for the parameters listed in the paramNames property, in order, as the urlParams.

The parameters' current values are listed in the params property.

Example

  • UUX
    Animation of navigateTo workflow

    In this example, the navigateTo method’s featureName parameter is provided a value of “landingPage”. You can observe the change to the URL as well as the page content when the user clicks on the button associated with the navigation event.

    Captured on UUX version 4.6.0.10A.

Arguments

UUX
Config

Unique name of feature can be a tecton feature or platform feature

UUX
Config

Supported only for Tecton features. Navigate to a specific module within a feature. Navigable Tecton features have an entry point module by default.

UUX
Config

Not supported in Tecton features. Used for Platform features who's routes rely on url parameters. This is an array of params.

UUX
Config

For Tecton features this is where all parameters are passed. For platform features that pull query params from the URL pass them here. This is an array of queryParams.

Release Notes

Initial Release