From dc77df0b087d95bab7cf953e930a15b724231bde Mon Sep 17 00:00:00 2001 From: Ludvig Hozman Date: Wed, 25 Sep 2024 14:06:20 +0200 Subject: [PATCH] Faktisk bruk contextholder-next ved featuretoggle --- proxy-config-dev.json | 4 ++++ src/app/internarbeidsflatedecorator/useDecoratorConfig.tsx | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/proxy-config-dev.json b/proxy-config-dev.json index 7ba4a8e62..b711a65ef 100644 --- a/proxy-config-dev.json +++ b/proxy-config-dev.json @@ -16,6 +16,10 @@ "url": "http://modiacontextholder.personoversikt.svc.cluster.local", "scope": "api://dev-gcp.personoversikt.modiacontextholder/.default" }, + "modiacontextholder-next": { + "url": "http://modiacontextholder-next.personoversikt.svc.cluster.local", + "scope": "api://dev-gcp.personoversikt.modiacontextholder-next/.default" + }, "azure-api": { "url": "http://modiapersonoversikt-api.personoversikt.svc.cluster.local/modiapersonoversikt-api/rest", "scope": "api://dev-gcp.personoversikt.modiapersonoversikt-api/.default" diff --git a/src/app/internarbeidsflatedecorator/useDecoratorConfig.tsx b/src/app/internarbeidsflatedecorator/useDecoratorConfig.tsx index f8ecf1f28..2ecd5ffe8 100644 --- a/src/app/internarbeidsflatedecorator/useDecoratorConfig.tsx +++ b/src/app/internarbeidsflatedecorator/useDecoratorConfig.tsx @@ -81,6 +81,7 @@ function lagConfigV3( const urlFormat = getDomainFromHost(); const brukNyContext = getWindowFeature('contextholderNext'); + const contextProxy = brukNyContext ? 'modiacontextholder-next' : 'modiacontextholder'; return { appName: 'Modia personoversikt', @@ -106,10 +107,7 @@ function lagConfigV3( }, hotkeys: getHotkeys(), enableHotkeys: true, - proxy: import.meta.env.PROD - ? `https://${window.location.host}${import.meta.env.BASE_URL}proxy/modiacontextholder` - : ((import.meta.env.VITE_CONTEXTHOLDER_URL as string) ?? - `${import.meta.env.BASE_URL}proxy/modiacontextholder`), + proxy: (import.meta.env.VITE_CONTEXTHOLDER_URL as string) ?? `${import.meta.env.BASE_URL}proxy/${contextProxy}`, environment, urlFormat: import.meta.env.PROD ? urlFormat : 'LOCAL', websocketUrl: brukNyContext ? 'wss://modiacontextholder-next.intern.dev.nav.no/ws/' : undefined,