luigi
luigi copied to clipboard
apply context value replacement also to external links
It is possible to inject context property and other (i18n) values to viewUrls to make them dynamic.
For external link urls, only i18n is working, but not context value replacement.
Fiddle for reproducing:
Luigi.setConfig({
navigation: {
validWebcomponentUrls:['.*?'],
nodes: [{
pathSegment: 'home',
label: 'home',
context: {
someValue: 'random'
},
children: [{
pathSegment: 'overview',
label: 'Overview',
icon: 'home',
viewUrl: '/examples/microfrontends/multipurpose.html#/?foo={context.someValue}&lang={i18n.currentLocale}'
},{
label: 'External link',
externalLink: {
url: '/examples/microfrontends/multipurpose.html#/?foo={context.someValue}&lang={i18n.currentLocale}'
}
}]
}]
},
routing: {
useHashRouting: true
}
});
Current behaviour:
when clicking on "External link", new tab is opened with url https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html#/?foo={context.someValue}&lang=en
Expected behaviour:
when clicking on "External link", new tab is opened with url https://fiddle.luigi-project.io/examples/microfrontends/multipurpose.html#/?foo=random&lang=en
(jukebox - 985)
approach done in draft PR https://github.com/SAP/luigi/pull/2804 seems to be working, needs to be finalized according to DOD