TIP: For learning and testing purposes, use the Luigi Fiddle page where you can configure a sample Luigi application.
The configuration file contains a section called Settings where you can configure additional Luigi options.
This is an example of how settings parameters can be used:
settings: {
hideNavigation: false
backdropDisabled : false,
header: { object / function / Promise
logo: 'path/to/image.png',
title: 'Luigi Demo',
favicon: 'path/to/favicon.ico'
},
featureToggles : {
queryStringParam: 'ft'
},
sideNavFooterText: 'MyLovelyApp 1.0.0',
sideNavCompactMode: false,
customTranslationImplementation: () => {
return {
getTranslation: (key, interpolations, locale) => {
return translatedText;
}
};
},
customSandboxRules: ['allow-downloads-without-user-activation'],
allowRules: ['microphone'],
appLoadingIndicator: {
hideAutomatically: true
},
thirdPartyCookieCheck = {
//disabled: true,
//thirdPartyCookieScriptLocation: 'https://domain/init.html',
thirdPartyCookieErrorHandling: () => {
const alert = {
text: 'Third Party Cookies are not enabled. Please check your browser settings.',
type: 'warning'
};
Luigi.ux().showAlert(alert);
}
},
theming = {
themes: () => [
{ id: 'light', name: 'Light Theme' },
{ id: 'dark', name: 'Dark Theme' }
],
defaultTheme: 'light'
}
}
Below is a list of the parameters you can use in the settings: Luigi configuration section.
allowRules: ['microphone', 'camera']. Be aware that this mechanism requires the browser to support Feature Policy.true.simple or Fiori3. You can set it to true. In that case, the default values Expand navigation and Collapse navigation will be rendered.
It is also possible to customize the values. In that case burgerTooltip will be an object with definable properties.
burgerTooltip = {
navExpanded: 'Collapse navigation',
navCollapsed: 'Expand navigation'
};
settings and openFromClient as parameters. It must either return a promise which gets resolved when the alert is dismissed, or false if the default Luigi alert should be shown.Luigi.setConfig({
...,
settings: {
customAlertHandler: ()=>{
return new Promise((resolve, reject) => {
//custom alert implementation
});
}
}
})
{
getTranslation: (key, interpolations, locale) => {
// should return translation of the 'key' in the 'locale' or current locale
}
}
Take a look at our i18n section for an implementation suggestion.
NOTE: You can translate Luigi internal messages by providing translation for these keys.
collapsible, you can set this parameter to true in order to expand the category when navigating to one of its children.?ft=name. You will need this value set before using the feature toggle functionality.alt attribute to the logo image. header: { object / function / Promise
logo: 'path/to/image.png',
altText: 'alternative text'
},
true. This means that top navigation is hidden and only the left-side navigation is visible.false, which means the navigation is enabled..ico extension, and 16x16px or 32x32px dimensions. header: { object / function / Promise
favicon: 'path/to/favicon.ico'
},
header: { object / function / Promise
logo: 'path/to/image.png'
},
true.false, meaning that padding for the Shellbar Component will stay the same as inherited from the .fd-shellbar class. header: { object / function / Promise
responsiveShellbarPaddings: true
},
header: { object / function / Promise
title: 'Luigi Demo'
},
true. This means that top, side, and tab navigation is no longer visible and you can implement your own navigation UI.false, which means the navigation is enabled.iframe is the iframe DOM element. It is not yet added to the DOM tree, but all attributes are already set.viewGroup is the view group associated with this iframe, if applicable.navigationNode is the navigation node associated with this iframe. NOTE: the interceptor is called only once per iframe creation. If two or more navigation nodes share the same iframe (because they belong to the same view group) the interceptor is called with the first navigated node only.microFrontendType, which is main, modal, split-view, drawer or usersettings depending on where it is going to be rendered.{
iframeCreationInterceptor: (iframe, viewGroup, navigationNode, microFrontendType) => {
if (microFrontendType !== 'modal')
iframe.allowFullscreen = true;
}
}
simple displays basic profile menu list of entities.Fiori3 displays renewed profile menu layout according to the Fiori 3 styleguides. It contains the avatar of a user, if applicable, and additional description. since: v1.14.0vega displays renewed profile menu layout according to the Vega styleguides. since: v2.23.0simple layout will be used as a default one.simple displays the button on the left side of the top navigation regardless of the browser window´s size.simpleMobileOnly displays the button on the left side of the top navigation when the browser window is narrower than 600px.semiCollapsible displays the arrow button at the bottom of the left side navigation. Once you click the button, the navigation shows up or collapses.Fiori3 displays the button on the left side of the top navigation. Once you click the button, the navigation shows up or collapses.button renders a button tag.Vega layout even when the left navigation is collapsed.Vega design guidelines. Must be set to vega.::.{
label: 'Node',
category: {
id: 'myCat',
label: 'My Category',
collapsible: true,
icon: 'home'
},
pathSegment: 'node',
viewUrl: 'https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html',
}, {
label: 'Node1',
category: {
id: 'myCat::subCat',
label: 'My Subcategory',
collapsible: true,
icon: 'group'
},
pathSegment: 'node1',
viewUrl: 'https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html',
context: {
title: 'node1',
content: 'Click on "Modify Config" at the bottom right and play around with your Luigi configuration'
}
}, {
label: 'Node2',
category: 'myCat::subCat',
pathSegment: 'node2',
viewUrl: 'https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html',
context: {
title: 'node2',
content: 'Click on "Modify Config" at the bottom right and play around with your Luigi configuration'
}
}
themes: ['light', 'dark', 'sap_horizon'].true, Fiori theming variables are applied to all scrollbars in luigi core app.fiori to get all CSS variables from the fiori theme, or an object with a property called file where you can declare your own CSS variables. The variables should be defined in a JSON file which starts with a root key. An example of how a CSS variables file should look like can be found here.theming: {
themes: () => [
{ id: 'light', name: 'Fiori3 Light' },
{ id: 'dark', name: 'Fiori3 Dark' },
{ id: 'sap_horizon', name: 'Morning Horizon' }
],
defaultTheme: 'light',
nodeViewURLDecorator: {
queryStringParameter: {
keyName: 'sap-theme',
// optional
value: themeId => {
return themeId;
}
}
}
}
NOTE: The Horizon theme stylesheet needs to be included. In the HEAD section of your application's
index.htmlfile, add:
<link rel="stylesheet" href="<PATH/TO/LUIGI/PACKAGE/luigi_horizon.css" />
unsavedChangesHandler can be implemented as an alternative to the standard unsaved changes modal. The function must return a promise."settings:{
unsavedChangesHandler: () => {
return Luigi.ux().showConfirmationModal({
type: 'information',
header: "Unsaved Changes",
body: "You have unsaved changes. Do you want to <b>leave</b>?",
buttonConfirm: "Yes",
buttonDismiss: "No"
});
}
}
wc - the web component DOM element. It is not yet added to the DOM tree, but all attributes are already set.currentNode - the navigation node.extendedContext - extended settings about the current node.nodeId - an ID which is set on the web component object in your config, or, if not defined, a generated id from Luigi.isSpecialMf - allows you to specify whether the web component is rendered in a modal, splitView or drawer. false by default.You can check whether the user's browser supports third-party cookies by defining a thirdPartyCookieCheck object which expects a function called thirdPartyCookieErrorHandling, optional disabled and thirdPartyCookiesScriptLocation parameters. When thirdPartyCookiesScriptLocation is set, the Luigi Core application checks third-party cookie support only once and not on every micro frontend call. If it is not set, the Luigi Core application checks third-party cookie support whenever a micro frontend is loaded.
To detect whether the user's browser supports the mechanism, use the script in the third-party-cookies catalog. Deploy this file on a domain different from your main application's and set thirdPartyCookieScriptLocation to the init.html file. During initialization, Luigi detects cookies support and produces an alert if cookies are disabled in the user's browser.
Luigi.ux().showAlert({}).