Skip to content

Commit

Permalink
chore: Update app.config.ts and package.json in legacyAppLoader (#822)
Browse files Browse the repository at this point in the history
Co-authored-by: Noggling <Noggling@users.noreply.github.com>
Noggling and Noggling authored Oct 22, 2024
1 parent 7e684b8 commit 0d4055d
Showing 9 changed files with 36 additions and 160 deletions.
7 changes: 7 additions & 0 deletions .changeset/pr-822-2137562008.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

---
"fusion-project-portal": patch
---
- Remove unused import and code in app.config.ts
- Update dev:appLoader script in package.json
- Remove unused components in legacyAppLoader
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
/tmp
/out-tsc
dist
appLegacyLoader.js

# dependencies
node_modules
44 changes: 21 additions & 23 deletions client/apps/legacyAppLoader/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import { mergeAppConfigs, defineAppConfig } from '@equinor/fusion-framework-cli';
export default defineAppConfig((_env, { base }) =>
mergeAppConfigs(
{},
{
environment: {
endpoints: {
client: {
baseUri: 'https://backend-fusion-project-portal-test.radix.equinor.com',
defaultScopes: ['api://02f3484c-cad0-4d1d-853d-3a9e604b38f3/access_as_user'],
},
portal: {
baseUri: 'https://fusion-s-portal-ci.azurewebsites.net',
defaultScopes: ['5a842df8-3238-415d-b168-9f16a6a6031b/.default'],
},
},
fusionEnv: 'ci',
loadingText: 'Loading',
appKey: 'handover-garden',
basename: 'localhost:3000/apps/handover-garden/',
import { defineAppConfig } from '@equinor/fusion-framework-cli';
export default defineAppConfig((_env) => ({
environment: {
endpoints: {
client: {
baseUri: 'https://backend-fusion-project-portal-test.radix.equinor.com',
defaultScopes: ['api://02f3484c-cad0-4d1d-853d-3a9e604b38f3/access_as_user'],
},
}
)
);
portal: {
baseUri: 'https://fusion-s-portal-ci.azurewebsites.net',
defaultScopes: ['5a842df8-3238-415d-b168-9f16a6a6031b/.default'],
},
apps: {
defaultScopes: ['5a842df8-3238-415d-b168-9f16a6a6031b/.default'],
},
},
fusionEnv: 'ci',
loadingText: 'Loading',
appKey: 'project-control-and-analysis',
basename: 'localhost:3000/apps/project-control-and-analysis/',
},
}));
2 changes: 1 addition & 1 deletion client/apps/legacyAppLoader/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"prebuild": "rm -f ../../packages/portal-client/src/assets/appLegacyLoader.js",
"build:appLoader": "fusion-framework-cli app build && mv ./dist/app-bundle.js ../../packages/portal-client/src/assets/appLegacyLoader.js",
"build:resources": "tsc && vite build",
"dev:appLoader": "fusion-framework-cli app dev -c vite.config.js",
"dev:appLoader": "fusion-framework-cli app dev",
"docker": "cd .. && sh docker-script.sh app-react",
"update:fusion": "ncu -i -f /fusion/"
},
4 changes: 2 additions & 2 deletions client/apps/legacyAppLoader/src/config.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ interface Client {
export const configure: AppModuleInitiator<
[NavigationModule],
Fusion<unknown>,
{ config: { environment: { endpoints: { client: Client; portal: Client; fusion: Client } } } }
{ config: { environment: { endpoints: { client: Client; portal: Client; apps: Client } } } }
> = (configurator, { env, fusion }) => {
configurator.configureHttpClient('portal-client', env.config?.environment.endpoints.client);
configurator.configureHttpClient('portal', env.config?.environment.endpoints.portal);
@@ -22,7 +22,7 @@ export const configure: AppModuleInitiator<
// configurator.logger.level = 4;
configurator.configureHttpClient('app', {
baseUri: new URL('/apps-proxy/', location.origin).href,
defaultScopes: env.config?.environment.endpoints.fusion.defaultScopes,
defaultScopes: env.config?.environment.endpoints.apps.defaultScopes,
});

enableAppModule(configurator);

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 4 additions & 3 deletions client/packages/core/src/app/hooks/use-app-loader.ts
Original file line number Diff line number Diff line change
@@ -53,11 +53,11 @@ export const useAppLoader = (appKey: string) => {
environment: {
appKey,
env: getFusionLegacyEnvIdentifier(),

loadingText: 'Loading',
endpoints: {
client: getLegacyClientConfig(),
fusion: getLegacyFusionConfig(),
portal: getLegacyFusionConfig(),
apps: getLegacyFusionConfig(),
},
},
} as AppConfig<
@@ -67,7 +67,8 @@ export const useAppLoader = (appKey: string) => {
loadingText: string;
endpoints: {
client: Client;
fusion: Client;
portal: Client;
apps: Client;
};
}
>,

0 comments on commit 0d4055d

Please sign in to comment.