Skip to content

Commit

Permalink
chore: Update app.config.ts and package.json in legacyAppLoader
Browse files Browse the repository at this point in the history
- Remove unused import and code in app.config.ts
- Update dev:appLoader script in package.json
- Remove unused components in legacyAppLoader

Closes #issue-number
  • Loading branch information
Noggling committed Oct 22, 2024
1 parent 7e684b8 commit c66ef67
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 160 deletions.
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/tmp
/out-tsc
dist
appLegacyLoader.js

# dependencies
node_modules
Expand Down
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
Expand Up @@ -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/"
},
Expand Down
4 changes: 2 additions & 2 deletions client/apps/legacyAppLoader/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

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
Expand Up @@ -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<
Expand All @@ -67,7 +67,8 @@ export const useAppLoader = (appKey: string) => {
loadingText: string;
endpoints: {
client: Client;
fusion: Client;
portal: Client;
apps: Client;
};
}
>,
Expand Down

0 comments on commit c66ef67

Please sign in to comment.