Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legge til støtte for ansatt.nav.no domener #425

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ export interface Markup {
etterSokefelt?: string; // Gir muligheten for sende inn egen html som blir en del av dekoratøren
}

// Miljø. Foreløpig er kun q0 og q1 støttet.
// Miljø
export type Environment =
| 'q0'
| 'q1'
@@ -110,7 +110,7 @@ export type Environment =
| 'local'
| 'mock';

export type UrlFormat = 'LOCAL' | 'ADEO' | 'NAV_NO'; // UrlFormat. Brukes om proxy ikke er satt.
export type UrlFormat = 'LOCAL' | 'ADEO' | 'NAV_NO' | 'ANSATT'; // UrlFormat. Brukes om proxy ikke er satt & i url til websocket.
```

# Henvendelser
Original file line number Diff line number Diff line change
@@ -8,4 +8,4 @@ export type Environment =
| 'local'
| 'mock';

export type UrlFormat = 'LOCAL' | 'ADEO' | 'NAV_NO';
export type UrlFormat = 'LOCAL' | 'ADEO' | 'NAV_NO' | 'ANSATT';
10 changes: 10 additions & 0 deletions packages/internarbeidsflate-decorator-v3/src/utils/urlUtils.ts
Original file line number Diff line number Diff line change
@@ -61,6 +61,13 @@ const naisDomain = (environment: Environment) => {
return '.intern.dev.nav.no';
};

const ansattDomain = (environment: Environment) => {
if (environment === 'prod') {
return '.ansatt.nav.no';
}
return '.ansatt.dev.nav.no';
};

const modiaUrl = (
fnr: string | undefined | null,
path: string,
@@ -103,6 +110,7 @@ export const modiaContextHolderUrl = (
environment,
)}.adeo.no/modiacontextholder`;
case 'NAV_NO':
case 'ANSATT':
return `https://modiacontextholder${naisDomain(
environment,
)}/modiacontextholder`;
@@ -117,6 +125,8 @@ export const wsEventDistribusjon = (
switch (urlFormat) {
case 'LOCAL':
return 'ws://localhost:4000/ws/';
case 'ANSATT':
return `wss://modiaeventdistribution${ansattDomain(environment)}/ws/`;
default: {
if (environment === 'q2')
return `wss://modiaeventdistribution${naisDomain(environment)}/ws/`;