Fired before nav-app initiates a navigation action which will leave the current location, this event allows applications to clean up location-specific state (such as dirty forms) if necessary. The callback is responsible to resolve the Promise before nav-app can continue. When the application is good to “leave”, it resolves the Promise with "true". In order to prevent leaving the current location, the application should resolve the Promise with "false".
Get the current ChildConfig.
Requests navigation items from the iframe application. Applications which register. If an application doesn’t have navigation items to register, it returns an empty array.
Requests the currently selected site saved on the brSM side (as a cookie value).
Requests an array of sites to be used in the nested site selection drop-down of the nav-app’s toolbar. The sites are expected to be provided (only) by the SM Navigation Provider app. Other apps that do not have sites to provide should return an empty array.
Called to let the child app initiate their logout process.
Is a command which tells the application to navigate to the specified location. If a user triggers a navigation (for example by clicking a button) but the url is absolutely the same it doesn’t lead to any transitions. It’s an application’s responsibility to make a decision on how to handle this navigational call.
Called to notify the child app that the user is still active to prevent logging out the user in one app while the user is active in another app.
Sets the accountId (merchantId) and siteId (siteGroupId) to work with. Site selection is intentionally separated from navigation since it represents an additional dimension in the navigation process to cover brSM needs. When a user selects a site, nav-app will call this callback for the active app first, which can update the site and the corresponding cookie and then resolves the promise, then the nav-app broadcast to all apps to update the site. Nav-app will only wait for the Promise of the currently active app to resolve before updating the UI to display the newly selected site. The selectSite should update the site state in the child UI based on whether the selectSite is passed a site object. If a site object is passed the child UI is updated to that site object and the cookie is updated to reflect the new site, if no site object is passed, the site is updated from the cookie. This way the active app will first update its UI and cookie, and the consequent broadcast will cause all other brSM apps to update their site state from the cookie that was just updated.
Fired before nav-app initiates a logout broadcast, this event allows applications to clean up location-specific state (such as dirty forms) if necessary. The callback is responsible to resolve the Promise before nav-app can continue. When the application is good to “logout”, it resolves the Promise. In order to prevent the logout process, the application should reject the Promise.