Skip to main content

Configuration for Project Portal

This documentation guides you through the configuration of the Fusion Framework for the Project Portal.

Getting Started​

To configure the Fusion Framework for Project Portal, we have created a createPortalFramework function. This function takes a PortalConfig object as a parameter and returns a configuration function (config: FusionConfigurator => void). The configuration function initializes and customizes the Fusion Framework modules according to your portal's needs.

import { FusionConfigurator } from '@equinor/fusion-framework';
// ... other imports

export function createPortalFramework(portalConfig: PortalConfig) {
return (config: FusionConfigurator) => {
// Configuration steps go here
};
}

Configuration Steps​

1. Logger Configuration​

We can adjust the logger level based on the provided configuration default is set to 0.

config.logger.level = (portalConfig.logger?.level as LoggerLevel) || 0;

2. Service Discovery Configuration​

Configure the Fusion Framework's service discovery module using the provided portal configuration. this is used to obtain and create http clients from fusion services.

config.configureServiceDiscovery(portalConfig.serviceDiscovery);

3. App Module Configuration​

Enable and configure the App module. read more about this under the App Module Configuration section in this site.

enableAppModule(config, appConfigurator(portalConfig.portalClient.client));

4. MSAL Configuration​

Here we configure MSAL (Microsoft Authentication Library) for authentication. providing client details and potions based on each environment.

config.configureMsal(portalConfig.msal.client, portalConfig.msal.options);

5. Ag-Grid Configuration (Optional)​

Here we enable Ag-Grid module if an Ag-Grid license key is provided. the license kay is provided in the radix environment settings and is only provided in production.

if (portalConfig.agGrid?.licenseKey) {
enableAgGrid(config, portalConfig.agGrid);
}
note

Fusion core team may look in to providing a service to obtain this, this will simplify the process of obtaining the license key, and manual updates won't be required as they are now. ::

6. Portal Client Configuration​

there wi add our Portal client to the configuration. This is configuration for the project portals own API.

addPortalClient(config, portalConfig.portalClient.client);

7. Application Insights Configuration (Optional)​

Here we enable Application Insights module if configured.

if (portalConfig.applicationInsights) {
enableTelemetry(config, {
// ... telemetry configuration
});
}

8. Signal-R Configuration​

Here we enable Signal-R modules for service messages and notifications.

enableSignalR(
config,
'portal',
signalRConfigurator({
// ... configuration for portal Signal-R
})
);

enableSignalR(
config,
'notifications',
signalRConfigurator({
// ... configuration for notifications Signal-R
})
);

9. Bookmark Configuration​

Here we enable and configure the Bookmark module.

enableBookmark(config, (builder) => {
builder.setSourceSystem(portalConfig.bookmarks);
});

10. Navigation Module Configuration​

This is enabling the Navigation module.

enableNavigation(config);

11. Additional Configuration (Optional)​

Include any additional configuration steps specific to your portal's requirements.

12. Show Information (Optional)​

I have never used this but if needed, log framework configuration completion.

if (showInfo) {
config.onConfigured(() => {
console.log('Framework configuration done');
});
}

13. Post-Initialization Actions​

Perform actions after the Fusion Framework has been initialized. we have som custom code here for context management see code itself.

config.onInitialized<[NavigationModule, TelemetryModule]>(async (fusion) => {
// ... post-initialization actions
});