Skip to main content

Project Portal Readme

This document will help during Christopher's parental leave. It covers all possible scenarios, although we hope they won't happen.

Application Onboarding

There are various methods for onboarding applications, and the following documents will describe these processes.

v3.0.0

This describes the onboarding possess Project Portal after release of v3.0.0

If new landing page

note

If a new landing page is requested the how this should or could be implemented can be read here. New Landing Page

General

  • For anything related to service messages in the project portal please contact Fusion Core.
  • Context Selection, se context section or contact Fusion Core.
  • Navigation / Routing refer to context and portal by configuration in this doc site. Any changes done to navigation should be discussed wth Fusion Core and TDI Architects sins it may impact many.
  • Application loading. se application loading section, but should all be handled by Fusion Core
  • Portal Extensions / Actions, this will be revisited by UX and handled by core, but if there are bugs they should be handled.
    • Bookmarks
    • Service message
    • Help Service
    • My Tasks
    • Notifications
    • My Account
  • Portal Pages
    • Landing Page, can be handled by anyone.
    • Project Page, can be handled by anyone.
    • Facility Page, can be handled by anyone.
caution

The following repos of their packages should not be used in the Project Portal at all. if code is need form the it should be extracted and rewritten, pleas contact fusion core if this is needed.

RepoSummaryArea
fusion-apidepricated?frontend
fusion-componentsdepricated?frontend

There are reason to look in to fusion-api but this mainly applies when working on the legacyAppLoader.

Context Selection

The portal is set up to be context fist, by this i mean that the user will need to select a context before any applications are available. this has been described numerous times and i will no do in thi great detail here. for mor information read the context section under framework.

info

Any work needed on this should be consulted with lead developer at fusion core Odin Rochmann

Application loading

This section is explained more under the Application section. Applications are loaded in 2 different ways. this is to support the older fusion applications.

info

Any work needed on this should be a handled by some one in Fusion Core of the person working on it should consulting lead developer at fusion core Odin Rochmann

The new way of loading is heavily inspired by the application loading section that is done by the new Fusion CLI, that can be found here AppLoader.tsx all code for app loading can be found under client/packages/core/app the app loading in project portal has been structures a little different and all has been converted to hooks. main hook is use-app-loader.ts

New App Management

Fusion core is working on new App Management. when this is going live, the project portal may need some changes. This should mainly be web-server changes for proxy enjoins fore loading application bundles, but may need some changes in the app client. found oin the app-configurator.ts file.

const manifestMapper =
(basePath: string) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(value: any): AppManifest => {
const { appKey, appInformation, isLegacy } = value;
return { ...appInformation, entry: `${basePath}/api/bundles/${appKey}`, isLegacy };
};

const manifestMappers =
(basePath: string) =>
(value: any): AppManifest => {
const { key, name, version } = value;
return { ...value, key, name, version, entry: `${basePath}/api/bundles/${key}` };
};

export const appConfigurator =
(client: Client): AppConfigBuilderCallback =>
async (builder) => {
const serviceDiscovery = await builder.requireInstance('serviceDiscovery');
const http = await builder.requireInstance('http');
const portal = await serviceDiscovery.createClient('portal');
const portalClient = await http.createClient('portal-client');
builder.setAppClient({
getAppManifest: (query) => {
return portalClient.json$(`/api/onboarded-apps/${query.appKey}`, {
selector: async (res) => manifestMapper(client.baseUri)(await res.json()),
});
},
getAppManifests: () =>
portalClient.json$(`/api/fusion/apps`, {
selector: async (res) => (await res.json()).map(manifestMappers(client.baseUri)),
}),

getAppConfig: (query) => portal.json$(`/api/apps/${query.appKey}/config`),
});
};


application loading will need update. In the legacyAppLoader applications, in the LegacyAppContainer.ts file, in the #loadScript function.

  async #loadScript(appKey: string): Promise<void> {
return new Promise((resolve, reject) => {
const script = document.createElement("script");
script.async = true;
script.id = appKey;

document.head.appendChild(script);

script.addEventListener("load", () => resolve());
script.addEventListener("abort", () => reject());
script.addEventListener("error", () => reject());

// This url may / should change and yes i know its hack :P
script.src = `${window["clientBaseUri"]}/api/bundles/${appKey}.js`;
});
}

Landing pages

Landing pages code can be found under:

client/packages/portal-pages

The project portal has 3 pages, project-portal, project or facility. If any changes are needed here it should be straight forward to do any changes.

Core Components

When the the portal started supporting multiple contexts the two need module where introduced these can bee read more about under Fusion Framework custom modules. There are tree custom modules at the moment.

  • Menu
  • Portal Config
  • Telemetry
note

The modules are made for future concepts to be applied.

Portal Management

After some delays, reevaluating our portal administration approach has proven beneficial given changing requirements. Now, it's time to prioritize developing an effective portal administration tool.

info

The portal administration tool will be clearly outlined, detailing all its features and including user stories in its dedicated section.

Web Server

The project portal team handles all tasks related to the web server. Its primary responsibility is to host the HTML files for the website to be mounted on and manage the environment configuration for the portal. Additionally, the server facilitates proxy calls as necessary.