Sets up the view so that it can be made aware of how it is being used, and is used to establish a trusted connection with Web Portal.
In addition, iframe ping message communication will be started between the module’s active iframe view and the portal frame, and the portal frame will attempt to reload the iframe view if it enters an unresponsive state based on the UnresponsiveViewReloadTimeoutInSeconds (optional field) set by the module as part of the module views registration
| name |
usage |
onBreadcrumbClick |
This function is used to react to the clicks that users can make on Web Portal’s breadcrumbs. The ID of the clicked item is passed to this callback so that you may react accordingly. |
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const callBackFns = {
onBreadcrumbClick: (id) => {
console.log(id); // prints the id of the breadcrumb element the user clicked on
}
};
IframeIntegrationLibrary.init(callBackFns).then(() => {
console.log(IframeIntegrationLibrary.getMode()); // prints mode it got from Web Portal
});
|
Set up a widget with or without settings
| Parameter |
Description |
Required |
callbackFns |
Callback functions that will be used to handle events from Web Portal
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { WidgetInitResult, IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
async ngOnInit(): Promise<void> {
const settings: WidgetInitResult<BaseStaticSettings> = await IframeIntegrationLibrary.initWidget<BaseStaticSettings>();
console.log(settings.staticSettings);
}
async ngOnInit(): Promise<void> {
const settings: WidgetInitResult<BaseStaticSettings, ExampleWidgetSettings> = await IframeIntegrationLibrary.initWidget<BaseStaticSettings, ExampleWidgetSettings>({
onConfigChanged: (userSettings) => {
console.log(userSettings);
},
onFilterChanged: () => {},
});
console.log(settings.staticSettings);
console.log(settings.userSettings);
}
|
This function is used to set up a widget settings instance, including what is returned when widget settings are queried about setting state. It should be implemented when a widget requires more than the default settings, such as width and height.
| Parameter |
Description |
Required |
callbackFns |
Callback functions that will be used to handle events from Web Portal
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { WidgetConfiguration, IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
async ngOnInit(): Promise<void> {
const settings: WidgetConfiguration<BaseStaticSettings, ExampleWidgetSettings> = await IframeIntegrationLibrary.initWidgetSettings<BaseStaticSettings, ExampleWidgetSettings>({
onGetWidgetConfigRequest: () => //return form data here,
});
console.log(settings.userSettings);
console.log(settings.staticSettings);
}
|
This function returns the mode in which the module view is currently being used. Depending on the mode, different features are available (see the "Available for" column of this documentation or use 'isFeatureAvailable' of the iframe integration library).
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const currentMode = IframeIntegrationLibrary.getMode();
console.log(currentMode); // depending where it is being used, view, embedded-view, dialog, widget, widget-settings
|
Returns a boolean value, indicating if a feature from IframeIntegrationLibrary is available or not.
| Parameter |
Description |
Required |
feature |
The feature to check for availability
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const isEmbedViewAvailable = IframeIntegrationLibrary.isFeatureAvailable('embedView');
console.log(isEmbedViewAvailable); // true if mode === view, else false
|
Inform portal about the current breadcrumbs that should be present in the header of portal. Web Portal will maintain its own breadcrumbs, a module is able to extend it with its own. The full history of the breadcrumbs should always be provided in terms of the module, as they will overwrite what is presented in the portal. If an empty list is given, the breadcrumbs will be reset to the state that is within the portal, and the module’s breadcrumbs will be removed.
| Parameter |
Description |
Required |
label |
Label that will be used within the portal header
|
|
id |
ID that will be used for callback identifier when a user clicks on the breadcrumb. A listener must be set during the init of the iframeintegrationlibrary to fully utilize this function.
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, Breadcrumb } from '@bci-portal/iframe-integration';
const breadcrumbs: Breadcrumb[] = [
{
label: 'Page',
id: '123',
},
{
label: 'Sub Page',
id: '456',
}
];
const breadcrumbData = { breadcrumbs };
IframeIntegrationLibrary.setBreadcrumbs(breadcrumbData);
|
Return a user setting value defined by any module. Asynchronously returned as a promise, so that caching mechanisms are transparent for the SCS UIs.
Note that this method is deprecated. Please use getUserProfile instead.
| Parameter |
Description |
Required |
key |
-
bci.system.language
-
bci.system.timezone
-
bci.system.timeformat
-
bci.system.timeformatiso
-
bci.system.dateformat
-
bci.system.dateformatiso
-
bci.system.autologouttime
-
bci.system.firstdayofweek
-
bci.system.timezoneoffset
-
bci.dashboard.recentSearches
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.getUserSettings('bci.system.dateformatiso').then((userSetting) =>
console.log(userSetting);
);
|
Returns the profile of the currently logged in user.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, UserProfile } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.getUserProfile().then((userProfile: UserProfile) =>
console.log(userProfile);
);
|
Return the cookie settings that the user has chosen in the cookie dialog.
User settings and other data that is not technically necessary are only to be stored to local storage/cookie if the comfort cookie setting is set to true!
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, CookieSettings } from '@bci-portal/iframe-integration';
const cookieSettings: CookieSettings = await IframeIntegrationLibrary.getCookieSettings();
console.log(cookieSettings);
Example Cookie Settings
{
marketing: true,
comfort: false, // Deprecated: Same value as convenience.
convenience: false,
analysis: true
}
|
Returns an observable that one can observe to be informed about cookie settings changes.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.getCookieSettings$().subscribe((cookieSettings) => {
console.log('privacy settings changed: ' + cookieSettings);
});
|
Emit a message to the user e.g. if a update was successful or new data was received.
| Parameter |
Description |
Required |
eventClass |
-
info
-
success
-
warning
-
error
Determines the icon to be displayed in the toast
|
|
title |
The Message to be displayed in the toast
|
|
description |
|
|
link |
Currently not implemented. An additional link to a view that produced the error or the warning
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.showMessage('Ticket created successfully', 'success', 'description');
|
Displays a banner with the passed text and returns a banner id.
| Parameter |
Description |
Required |
bannerClass |
|
|
text |
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const bannerId = await IframeIntegrationLibrary.showBanner('Banner Message', 'info');
|
Hides a banner which is shown previously with showBanner
function.
| Parameter |
Description |
Required |
bannerId |
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.hideBanner(bannerId);
|
The context concept can be used to show data contributed by other modules for a given context.
| Parameter |
Description |
Required |
type |
-
DATA
-
LINK
-
ACTION
-
DIALOG_VIEW
-
EMBEDDED_VIEW
|
|
name |
Unique identifier for context.
|
|
version |
Version of context’s specification.
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, Context } from '@bci-portal/iframe-integration';
const contextContributions: Context[] = await IframeIntegrationLibrary.getContextContribution('DATA', 'NEXEED_MDM_FACILITY_BASED_KPI', '1.0');
|
getDataForContextContribution
The context contribution data can be used by modules (context consumers)
to get the data from the context contributor.
The default timeout to try and get context contribution data is set to
3s and Web Portal will reject the promise if it didn’t receive the data by
this time.
The caller of the method has to handle the reject scenario as well.
| Parameter |
Description |
Required |
contributionId |
Unique id of the contribution. You can get the contributionId with getContextContribution
|
|
urlSelector |
|
|
placeholderParams |
Key-value pair of placeholder name and its value
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const placeholderParams: Record<string, string> = { 'facilityId': '9434ebcd-c740-4376-962d-5556896e68b1' };
const data: any = await IframeIntegrationLibrary.getDataForContextContribution('8de4a4ed-0e45-4315-94b1-9fbc1f6e60b1','meta', placeholderParams);
Note: the data returned depends on the context contributor
|
getDataForContextContributionResponseFromIframe
The ContextContributionDataResponseFromIframe can be used by
modules (context contributors) to give the data back to Web Portal
| Parameter |
Description |
Required |
callbackId |
callbackid is set in iframe src by Web Portal. While
responding back with data to Web Portal, this callback id
needs to be sent back to correlate request and response
|
|
responseData |
Data depends on the contributor
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library usage for metadata response
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
let data = {
callbackId: '12335',
responseData: {
label: "string",
description: "string"
}
};
IframeIntegrationLibrary.getDataForContextContributionResponseFromIframe(data);
|
Displays a context menu next to a certain html element. The context menu
will contain links to all SCS views that provide actions for the given context.
| Parameter |
Description |
Required |
htmlElement |
The HTML element next to which the context menu should be displayed
|
|
context |
|
|
contextParams |
|
|
Configuring the SCS views from a consumer side, see
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const htmlElement = document.querySelector('button');
IframeIntegrationLibrary.showContextMenu(htmlElement , 'device', { deviceId: '42' });
|
Returns true when no actions are registered for the given context and the context menu would be empty.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
const isMenuEmptyForContextDevice = await IframeIntegrationLibrary.isContextMenuEmpty( 'device');
|
Enable Browser fullscreen. Returns status of
operation (successful or not). It is the only way to trigger browser
fullscreen as allowfullscreen attribute is not set on IFrame.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.enableBrowserFullscreen();
|
Disable Browser fullscreen and returns status of
operation (successful or not).
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.disableBrowserFullscreen();
|
isBrowserFullscreenEnabled
Returns if browser is in fullscreen mode or not.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.isBrowserFullscreenEnabled().then((isFullscreen) => {
console.log('isBrowserFullscreenEnabled: ' + isFullscreen);
});
|
isBrowserFullscreenEnabled$
Returns an observable that one can observe to be informed about browser fullscreen enabled changes.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.isBrowserFullscreenEnabled$().subscribe((enabled) => {
console.log('isBrowserFullscreenEnabled: ' + enabled);
});
|
Enables Web Portal fullscreen and returns the status of operation (successful or
not).
Web Portal fullscreen is a maximized mode, where Web Portal hides the navigation
sidebar, the header and the footer. The supergraphic stays visible on
top.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.enablePortalFullscreen();
|
Disables Web Portal fullscreen and returns status of operation (successful or
not).
Web Portal fullscreen is a maximized mode, where Web Portal hides the navigation
sidebar, the header and the footer. The supergraphic stays visible on top.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.disablePortalFullscreen();
|
isPortalFullscreenEnabled
Returns if Web Portal is in fullscreen mode or not.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.isPortalFullscreenEnabled().then((isFullscreen) => {
console.log('isPortalFullscreenEnabled: ' + isFullscreen);
});
|
isPortalFullscreenEnabled$
Returns an observable that one can observe to be informed about portal fullscreen enabled changes.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.isPortalFullscreenEnabled$().subscribe((enabled) => {
console.log('isPortalFullscreenEnabled: ' + enabled);
});
|
getDashboardWidgetsMetaData
Returns available widget metadata to
modules which integrate via Iframe
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, WidgetMetaData } from '@bci-portal/iframe-integration';
const widgetMetaData: WidgetMetaData[] = await IframeIntegrationLibrary.getDashboardWidgetsMetaData();
[
{
"id": "52bd60c3-e8ea-4111-bd4a-18f76fc809a8",
"catalog": {
"title": "Markdown IFrame Widget",
"description": "Markdown iframe widget",
"categoryId": "cat_others",
"imageUrl": "/portal-enigma/assets/img/preview-markdown.png"
},
"widgetType": "IFrame",
"configuration": {
"availableWidths": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"availableHeights": [1, 2, 3, 4, 5, 6, 7]
},
"settings": {
"widgetUrl": "/iframe-widget/#/widgets/noteswidget?isWidget=true&&tenantId=##tenantId##",
"widgetConfigUrl": "/iframe-widget/#/widgets/noteswidgetsettings?isWidget=true"
}
},
{
"id": "99bd60c3-e8ea-4111-bd4a-18f76fc809a8",
"catalog": {
"title": "test IFrame Widget",
"description": "test iframe widget",
"categoryId": "cat_others",
"imageUrl": "/portal-enigma/assets/img/preview-markdown.png"
},
"widgetType": "iframe",
"configuration": {
"availableWidths": [3, 6, 9, 12],
"availableHeights": [2, 4, 6]
},
"settings": {
"widgetUrl": "/portal-enigma/assets/mocks/iframe-test.html?tenantId=##tenantId##",
"widgetConfigUrl": "/portal-enigma/assets/mocks/iframe-test.html?tenantId=##tenantId##"
}
}
]
|
Show an iframe view from another module
| Parameter |
Description |
Required |
context |
an embedded view context which should be shown
|
|
iframe |
an iframe element that will be populated with the provided context
|
|
params |
a key value pair object that is used to fill placeholders in the iframe url.
|
|
How placeholders are treated
Such placeholders are considered mandatory and if not provided Web Portal will
simply do nothing.
const pathValue = '/##deviceId##/process/chart';
const contextParams = {};
const replaceResult = '/##deviceId##/process/chart';
Placeholder in the query parameters
Such placeholders are considered optional and if not provided are
removed from the URL.
const pathValue = '/ticket?priority=##priority##&severity=##severity##';
const contextParams = { severity: 'medium' };
const replaceResult = '/ticket?severity=medium';
Values for not existing placeholders
Web Portal ignores all values that are provided and no placeholder is
present.
const pathValue = '/##deviceId##/process/chart';
const contextParams = { toolId: 1234};
const replaceResult = '/##deviceId##/process/chart';
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, Context } from '@bci-portal/iframe-integration';
const contexts: Context[] = await IframeIntegrationLibrary.getContextContribution("EMBEDDED_VIEW", "<name of context>", "<context version>");
const htmlElement = document.querySelector('iframe');
IframeIntegrationLibrary.embedView(contexts[0], htmlElement, { key: "value" });
|
Listen for events from an embedded view that is loaded into the page.
| Parameter |
Description |
Required |
parentWindow |
reference to the window object of the page the embedded
view is hosted in
|
|
embeddedViewIframe |
an iframe element reference to the embedded view
which events will be listened to
|
|
customEventHandler |
optional event handler that will be used to handle
events that are custom to the embedded view (events not specified in
embeddedView table)
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
customEventHandler = (messageEvent) => {
const eventName = messageEvent.data.name;
switch(eventName) {
case "someEventName": {
console.log(messageEvent.data);
break;
}
default: {
console.error('unsupported event from embedded view');
}
}
}
const htmlElement = document.querySelector('iframe');
const embeddedViewListener = IframeIntegrationLibrary.listenToEmbeddedView(this.window, htmlElement, customEventHandler.bind(this));
embeddedViewListener.unsubscribe() // stop listening to events from embedded view
|
Send an event to the embedded view, optionally data can be included
| Parameter |
Description |
Required |
embeddedViewIframe |
embedded iframe element to send the event to
|
|
name |
|
|
value |
a key value pair object that will be sent to the embedded view
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.sendEventToEmbeddedView(iframe, 'dataFromHost', { key: 'value' });
IframeIntegrationLibrary.sendEventToEmbeddedView(iframe, 'dataFromHost');
|
Request Web Portal to navigate to given contribution of type link by its id
| Parameter |
Description |
Required |
linkId |
contribution id of the link contribution to navigate to
|
|
parameters |
parameters to be passed into the path of the link contribution
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, Context } from '@bci-portal/iframe-integration';
const contexts: Context[] = await IframeIntegrationLibrary.getContextContribution('LINK', 'NEXEED_REPORTING_MANAGEMENT_REPORT_LINK', '1.0');
const context = contexts[0];
const parameterMap: Record<string, string> = {
prop: 'Some parameter'
};
IframeIntegrationLibrary.requestBrowseToLink(context.contributionId, parameterMap);
});
|
informHostViewWithCallback
Used to send a custom event where you expect a reply from the host
view
| Parameter |
Description |
Required |
name |
|
|
data |
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
id = 'someid';
const dataToHostView: Record<string, unknown> = {
id: this.id,
};
IframeIntegrationLibrary.informHostViewWithCallback('embeddedviewevent', dataToHostView).then((data) => console.log(data));
|
Used to send a custom event from an embedded view to its host view.
| Parameter |
Description |
Required |
name |
|
|
data |
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
id = 'someid';
const dataToHostView: Record<string, unknown> = {
id: this.id,
};
IframeIntegrationLibrary.informHostView('embeddedviewevent', dataToHostView);
|
Requests Web Portal to show a specific view in a dialog. showViewInDialog
returns a promise that is fulfilled with data provided by the view when
the dialog is closed. See closeDialog for an example on how to pass data
to the dialog opener.
| Parameter |
Description |
Required |
context |
A context of type 'DIALOG_VIEW' containing the url of the view to show.
|
|
dialogTitle |
A title for the dialog to show
|
|
viewParams |
A key value pair object that is used to fill placeholders in the view url.
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary, Context } from '@bci-portal/iframe-integration';
const contexts: Context[] = await IframeIntegrationLibrary.getContextContribution('DIALOG_VIEW', 'VIEW1', '1.0');
const context = contexts[0] as ContextDialogViewWithContribution;
const viewParams: Record<string, string> = {
key: 'value',
};
const data: DialogData | null = await IframeIntegrationLibrary.showViewInDialog(context , 'Title', viewParams);
console.log(dialogData);
|
Requests Web Portal to close the dialog where this view is at the moment shown in.
| Parameter |
Description |
Required |
data |
Some data that should be passed to the opener of the dialog
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.closeDialog({ key: 'value' });
|
Requests Web Portal to open or close the Side Navigation.
| Parameter |
Description |
Required |
openMenu |
Boolean to open or close the Side Navigation
|
|
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.setNavigationMenuState(false);
|
Returns an observable that one can observe to be informed about portal navigation requests. "explicitLeaveEventing" for the view needs to be enabled.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.navigationRequest$().subscribe(() => {
console.log('navigationRequest$'); // send back IframeIntegrationLibrary.performNavigation() or IframeIntegrationLibrary.cancelNavigation()
});
|
Used to inform portal to perform the planned navigation. This is a response to a navigationRequest$.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.navigationRequest$().subscribe(() => {
if (this.hasUnsavedChanges()) {
// maybe ask the user with a dialog if he really wants to leave or cancel
IframeIntegrationLibrary.cancelNavigation();
} else {
IframeIntegrationLibrary.performNavigation();
}
});
|
Used to inform portal to cancel the planned navigation. This is a response to a navigationRequest$.
|
View
EmbeddedView
Dialog View
Widget
WidgetSettings
ContextContribution
|
Iframe Integration Library
import { IframeIntegrationLibrary } from '@bci-portal/iframe-integration';
IframeIntegrationLibrary.navigationRequest$().subscribe(() => {
if (this.hasUnsavedChanges()) {
// maybe ask the user with a dialog if he really wants to leave or cancel
IframeIntegrationLibrary.cancelNavigation();
} else {
IframeIntegrationLibrary.performNavigation();
}
});
|