diff --git a/.github/workflows/app.sykemelding-api.yml b/.github/workflows/app.sykemelding-api.yml index 13b32b61caa..10a312277dc 100644 --- a/.github/workflows/app.sykemelding-api.yml +++ b/.github/workflows/app.sykemelding-api.yml @@ -17,6 +17,7 @@ jobs: cluster: "dev-gcp" working-directory: "apps/sykemelding-api" deploy-tag: "#deploy-sykemelding-api" + deploy-tag-test: "#deploy-test-sykemelding-api" permissions: contents: read id-token: write diff --git a/.github/workflows/app.synt-sykemelding-api.yml b/.github/workflows/app.synt-sykemelding-api.yml index a9dd896a2d1..fa1c0105f66 100644 --- a/.github/workflows/app.synt-sykemelding-api.yml +++ b/.github/workflows/app.synt-sykemelding-api.yml @@ -19,6 +19,7 @@ jobs: with: working-directory: "apps/synt-sykemelding-api" deploy-tag: "#deploy-synt-sykemelding-api" + deploy-tag-test: "#deploy-test-synt-sykemelding-api" permissions: contents: read id-token: write diff --git a/.github/workflows/app.udi-stub.yml b/.github/workflows/app.udi-stub.yml index 839be1717ae..9422e05c872 100644 --- a/.github/workflows/app.udi-stub.yml +++ b/.github/workflows/app.udi-stub.yml @@ -1,4 +1,4 @@ -name: testnav-udi-stub +name: udi-stub on: push: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 68d139b3d80..16c25d9ff37 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,16 +1,9 @@ name: Integration Tests on: push: - branches: - - master paths: - 'apps/bruker-service/**' - 'apps/person-organisasjon-tilgang-service/**' - pull_request: - paths: - - 'apps/bruker-service/**' - - 'apps/person-organisasjon-tilgang-service/**' - types: [ ready_for_review, review_requested ] workflow_dispatch: jobs: diff --git a/.github/workflows/proxy.sykemelding-proxy.yml b/.github/workflows/proxy.sykemelding-proxy.yml new file mode 100644 index 00000000000..52ddc6f062c --- /dev/null +++ b/.github/workflows/proxy.sykemelding-proxy.yml @@ -0,0 +1,23 @@ +name: sykemelding-proxy + +on: + push: + paths: + - "plugins/**" + - "libs/reactive-core/**" + - "libs/reactive-proxy/**" + - "libs/security-token-service/**" + - "proxies/sykemelding-proxy/**" + - ".github/workflows/proxy.sykemelding-proxy.yml" + +jobs: + workflow: + uses: ./.github/workflows/common.workflow.backend.yml + with: + cluster: "dev-gcp" + working-directory: "proxies/sykemelding-proxy" + deploy-tag: "#deploy-proxy-sykemelding" + permissions: + contents: read + id-token: write + secrets: inherit diff --git a/README.md b/README.md index d49bd31bdfb..e706c96fbed 100644 --- a/README.md +++ b/README.md @@ -7,62 +7,16 @@ Info/lenker til Team Dollys interne verktøy finnes [her](https://navikt.github.io/testnorge/). ## Bygging/Kjøring -### Kjør lokalt - -**NB: `navtunnel` må kjøre, eller man må være logget inn med `naisdevice`** - -For å kunne hente ned alle avheningehter må det opprettes en Personal access tokens fra https://github.com/settings/tokens. Denne token må legges inn i system variabler NAV_TOKEN. - -Fra Mac -``` -/etc/profile -export NAV_TOKEN=xxxx-yyyy-zzzz -``` - -Gradle følger med prosjektet og `./gradlew build` vil derfor fungere. `gradle build` bruker lokalt installert Gradle. - - -### Utviklerimage -- Opprett Personal access tokens i Github og legg til token som systemvariabelen NAV_TOKEN (se forklaring over) -- Opprett `gradle.properties` under `C:/Users/%USERNAME%/.gradle` med innhold (bytt ut truststorepassord og -path): -``` -systemProp.http.proxyHost=webproxy-utvikler.nav.no -systemProp.http.proxyPort=8088 -systemProp.http.nonProxyHosts=localhost|127.0.0.1|*.local|*.adeo.no|*.nav.no|*.aetat.no|*.devillo.no|*.oera.no|*devel -systemProp.https.proxyHost=webproxy-utvikler.nav.no -systemProp.https.proxyPort=8088 -systemProp.https.nonProxyHosts=localhost|127.0.0.1|*.local|*.adeo.no|*.nav.no|*.aetat.no|*.devillo.no|*.oera.no|*devel -systemProp.javax.net.ssl.trustStorePassword=TRUSTSTORE_PASS -systemProp.javax.net.ssl.trustStore=TRUSTSTORE_PATH -``` -- Legg til sertifikat til truststore: https://plugins.gradle.org og https://repository-cdn.liferay.com/nexus/content/groups/public - - Åpne URL i nettleser - - Trykk på hengelås til venstre for URL og klikk på "Sertifikat" - - Velg fanen "Detaljer" og klikk "Kopier til fil". Last ned DER-kodet binær. Merk at sertifikatet får filformat .cer - - Sertifikat legges til TrustStore ved hjelp av kommandoen: - ``keytool -import -trustcacerts -alias ALIAS -file DIN_DOWNLOAD_DIR/SERTIFIKAT_FILNAVN.cer -keystore PATH_TIL_KEYSTORE/KEYSTORE_FILNAVN.jts`` -- Hvis punktene over ikke er tilstrekkelig og prosjektet sliter med å hente pakker fra maven, forsøk å legge til denne -under repositories i `java-conventions.gradle` (MERK! Denne må fjernes igjen før commit): -``` -maven { - url = uri('https://repo.adeo.no/repository/github-package-registry-navikt') - } -``` -## Dokumentasjon -Enhver applikasjon skal ha dokumentasjon i fila `/README.md`. Hver av disse filene må starte med -``` ---- -layout: default -title: min-app -parent: Applikasjoner ---- - -# min-app -[...] -``` -for å bli vist på riktig måte under https://navikt.github.io/testnorge. -README-filen skal beskrive kort hva appen er til, og hvordan den fungerer. Det er også fint om du beskriver kort -info om lokal kjøring osv. +> **Mac:** +> +> For å kjøre tester som bruker Testcontainers eller kjøre en applikasjon lokalt som krever en tjeneste kjørende i Docker så må disse miljøvariablene settes: +> +> `DOCKER_HOST=unix://${HOME}/.colima/default/docker.sock`\ +> `TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock`\ +> `TESTCONTAINERS_RYUK_DISABLED=true` + +### Lokal kjøring +Se `README.md` for hver enkelt applikasjon/proxy. Felles dokumentasjon ligger i [/docs](./docs). ## Migrering inn i monorepo diff --git a/apps/adresse-service/README.md b/apps/adresse-service/README.md index 1d2e674abdb..bb4f382f69c 100644 --- a/apps/adresse-service/README.md +++ b/apps/adresse-service/README.md @@ -1,22 +1,7 @@ # Adresse-service Adresse-service gir tilgang til adresser fra PDL. Søk kan gjøres på postnummer, kommunenummer, fritekstsøk, mm - -## Swagger -Swagger finnes under [/swagger](https://testnav-adresse-service.intern.dev.nav.no/swagger) -endepunktet til -applikasjonen. ## Lokal kjøring -Ha naisdevice kjørende og kjør AdresseServiceApplicationStarter med følgende argumenter: -``` --Dspring.cloud.vault.token=[kopier token fra vault] --Dspring.profiles.active=local ---add-opens java.base/java.lang=ALL-UNNAMED -``` - -### Utviklerimage -I utviklerimage brukes ikke naisdevice og du må legge til følgende ekstra argumenter: -``` --Djavax.net.ssl.trustStore=[path til lokal truststore] --Djavax.net.ssl.trustStorePassword=[passord til lokal truststore] -``` +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) \ No newline at end of file diff --git a/apps/adresse-service/build.gradle b/apps/adresse-service/build.gradle index bdf5ed3cd78..3bcd193a8e1 100644 --- a/apps/adresse-service/build.gradle +++ b/apps/adresse-service/build.gradle @@ -14,7 +14,6 @@ dependencies { implementation "no.nav.testnav.libs:servlet-core" implementation "no.nav.testnav.libs:servlet-security" implementation "no.nav.testnav.libs:data-transfer-objects" - implementation "no.nav.testnav.libs:vault" implementation "org.springframework.boot:spring-boot-starter-security" implementation "org.springframework.boot:spring-boot-starter-web" diff --git a/apps/adresse-service/settings.gradle b/apps/adresse-service/settings.gradle index 4d35f0bf0f4..6a2058d2d50 100644 --- a/apps/adresse-service/settings.gradle +++ b/apps/adresse-service/settings.gradle @@ -10,7 +10,6 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java deleted file mode 100644 index b0a329e7ca7..00000000000 --- a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.testnav.apps.adresseservice.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("local") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/adresse-service/src/main/resources/application-local.yaml b/apps/adresse-service/src/main/resources/application-local.yaml index 7be8d69e501..4b75550d16b 100644 --- a/apps/adresse-service/src/main/resources/application-local.yaml +++ b/apps/adresse-service/src/main/resources/application-local.yaml @@ -1 +1,10 @@ -TOKEN_X_CLIENT_ID: dev-gcp:dolly:testnav-adresse-service \ No newline at end of file +TOKEN_X_CLIENT_ID: dev-gcp:dolly:testnav-adresse-service + +spring: + config: + import: "sm://" + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} \ No newline at end of file diff --git a/apps/adresse-service/src/main/resources/application.yaml b/apps/adresse-service/src/main/resources/application.yaml index e899f831d91..98dbbe9e7bf 100644 --- a/apps/adresse-service/src/main/resources/application.yaml +++ b/apps/adresse-service/src/main/resources/application.yaml @@ -11,7 +11,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} tokenx: issuer-uri: ${TOKEN_X_ISSUER} jwk-set-uri: ${TOKEN_X_JWKS_URI} diff --git a/apps/adresse-service/src/test/resources/application-test.properties b/apps/adresse-service/src/test/resources/application-test.properties deleted file mode 100644 index e5e55886152..00000000000 --- a/apps/adresse-service/src/test/resources/application-test.properties +++ /dev/null @@ -1 +0,0 @@ -TOKEN_X_ISSUER=dummy \ No newline at end of file diff --git a/apps/adresse-service/src/test/resources/application-test.yml b/apps/adresse-service/src/test/resources/application-test.yml new file mode 100644 index 00000000000..594f36142c8 --- /dev/null +++ b/apps/adresse-service/src/test/resources/application-test.yml @@ -0,0 +1,7 @@ +TOKEN_X_ISSUER: dummy + +spring: + cloud: + gcp: + secretmanager: + enabled: false diff --git a/apps/amelding-service/README.md b/apps/amelding-service/README.md index 923ec838ef6..70164b7baec 100644 --- a/apps/amelding-service/README.md +++ b/apps/amelding-service/README.md @@ -1,20 +1,6 @@ # Amelding-service Service for å sende syntetiske arbeidsmeldinger videre til oppsummerings-dokument-service. -## Swagger -Swagger finnes under [/swagger](https://testnav-amelding-service.intern.dev.nav.no/swagger) -endepunktet til -applikasjonen. - ## Lokal kjøring -For å kjøre lokalt (AMeldingServiceApplicationStarter) må active profile settes til `dev`. I tillegg, må cloud vault token -hentes fra Vault. Vault token hentes ved at man logger inn i Vault, trykker på nedtrekksmenyen oppe til høyre, og -trykker på "Copy token". - -Disse verdiene fylles deretter inn i VM Options på IDE: - -Run -> Edit Configurations -> VM Options - -``` --Dspring.cloud.vault.token=(Copy token fra Vault) --Dspring.profiles.active=dev -``` \ No newline at end of file +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) \ No newline at end of file diff --git a/apps/amelding-service/build.gradle b/apps/amelding-service/build.gradle index bd7beae1b48..7fbda466bb1 100644 --- a/apps/amelding-service/build.gradle +++ b/apps/amelding-service/build.gradle @@ -14,7 +14,6 @@ dependencies { implementation "no.nav.testnav.libs:security-core" implementation "no.nav.testnav.libs:reactive-core" implementation "no.nav.testnav.libs:reactive-security" - implementation "no.nav.testnav.libs:vault" implementation "no.nav.testnav.libs:commands" implementation "no.nav.testnav.libs:avro-schema" diff --git a/apps/amelding-service/settings.gradle b/apps/amelding-service/settings.gradle index 805045195b3..09582fbd408 100644 --- a/apps/amelding-service/settings.gradle +++ b/apps/amelding-service/settings.gradle @@ -12,7 +12,6 @@ includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java b/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java deleted file mode 100644 index 25a97458e07..00000000000 --- a/apps/amelding-service/src/main/java/no/nav/registre/testnav/ameldingservice/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.registre.testnav.ameldingservice.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("dev") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/amelding-service/src/main/resources/application-dev.yml b/apps/amelding-service/src/main/resources/application-dev.yml index 5dbf08bbfb3..e222fbad757 100644 --- a/apps/amelding-service/src/main/resources/application-dev.yml +++ b/apps/amelding-service/src/main/resources/application-dev.yml @@ -1,3 +1,11 @@ +spring: + config: + import: "sm://" + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} consumers: oppsummeringsdokument-service: diff --git a/apps/amelding-service/src/main/resources/application.yml b/apps/amelding-service/src/main/resources/application.yml index 1698ea6a87f..e90182fd21e 100644 --- a/apps/amelding-service/src/main/resources/application.yml +++ b/apps/amelding-service/src/main/resources/application.yml @@ -11,7 +11,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} springdoc: swagger-ui: diff --git a/apps/amelding-service/src/main/resources/bootstrap.yml b/apps/amelding-service/src/main/resources/bootstrap.yml deleted file mode 100644 index 0451449ca23..00000000000 --- a/apps/amelding-service/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,4 +0,0 @@ -spring: - cloud: - vault: - enabled: false \ No newline at end of file diff --git a/apps/amelding-service/src/test/resources/application-test.properties b/apps/amelding-service/src/test/resources/application-test.properties deleted file mode 100644 index e5e55886152..00000000000 --- a/apps/amelding-service/src/test/resources/application-test.properties +++ /dev/null @@ -1 +0,0 @@ -TOKEN_X_ISSUER=dummy \ No newline at end of file diff --git a/apps/amelding-service/src/test/resources/application-test.yml b/apps/amelding-service/src/test/resources/application-test.yml new file mode 100644 index 00000000000..aa8bfa92394 --- /dev/null +++ b/apps/amelding-service/src/test/resources/application-test.yml @@ -0,0 +1,7 @@ +TOKEN_X_ISSUER: dummy + +spring: + cloud: + gcp: + secretmanager: + enabled: false \ No newline at end of file diff --git a/apps/app-tilgang-analyse-service/README.md b/apps/app-tilgang-analyse-service/README.md index dafe47ea7ff..c5a0c41033d 100644 --- a/apps/app-tilgang-analyse-service/README.md +++ b/apps/app-tilgang-analyse-service/README.md @@ -10,24 +10,16 @@ Swagger finnes under [/swagger](https://testnav-app-tilgang-analyse-service.inte applikasjonen. ## Lokal kjøring +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) -### In Memmory DB -Ha naisdevice kjørende og kjør AppTilgangAnalyseServiceApplicationStarter med følgende argumenter: -``` --Dspring.cloud.vault.token=[kopier token fra vault] --Dspring.profiles.active=local -``` - -### GCP DB +En egen Spring profile _localdb_ er satt opp for å kjøre med proxy mot applikasjonens reelle DB. -Kjør opp `cloud_sql_proxy` +Kjør `cloud_sql_proxy` i bakgrunnen. ``` -./cloud_sql_proxy -instances=dolly-dev-ff83:europe-north1:testnav-app-tilgang-analyse-service=tcp:3306 +> cloud_sql_proxy -instances=dolly-dev-ff83:europe-north1:testnav-app-tilgang-analyse-service=tcp:3306 ``` - -Ha naisdevice kjørende og kjør AppTilgangAnalyseServiceApplicationStarter med følgende argumenter: +Start applikasjonen med Spring profile _localdb_ og definer DB_PASSORD (kan hentes fra pod). ``` --Dspring.cloud.vault.token=[kopier token fra vault] --Dspring.profiles.active=localdb -DDB_PASSWORD=[passord for testnav-app-tilgang-analyse-service-db] -``` \ No newline at end of file +``` diff --git a/apps/app-tilgang-analyse-service/build.gradle b/apps/app-tilgang-analyse-service/build.gradle index a5f907e8394..aabf1cef55e 100644 --- a/apps/app-tilgang-analyse-service/build.gradle +++ b/apps/app-tilgang-analyse-service/build.gradle @@ -13,7 +13,6 @@ dependencies { implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-core" implementation "no.nav.testnav.libs:reactive-security" - implementation "no.nav.testnav.libs:vault" implementation "org.springframework.boot:spring-boot-starter-data-r2dbc" implementation "org.springframework.boot:spring-boot-starter-security" diff --git a/apps/app-tilgang-analyse-service/settings.gradle b/apps/app-tilgang-analyse-service/settings.gradle index 8ff81fe0643..9dbb9e11e77 100644 --- a/apps/app-tilgang-analyse-service/settings.gradle +++ b/apps/app-tilgang-analyse-service/settings.gradle @@ -9,7 +9,6 @@ includeBuild "../../plugins/java" includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java b/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java deleted file mode 100644 index 7de354716ed..00000000000 --- a/apps/app-tilgang-analyse-service/src/main/java/no/nav/testnav/apps/apptilganganalyseservice/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.testnav.apps.apptilganganalyseservice.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile({"local", "localdb"}) -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/app-tilgang-analyse-service/src/main/resources/application-local.yml b/apps/app-tilgang-analyse-service/src/main/resources/application-local.yml index ace32b615a4..6e81acdc788 100644 --- a/apps/app-tilgang-analyse-service/src/main/resources/application-local.yml +++ b/apps/app-tilgang-analyse-service/src/main/resources/application-local.yml @@ -1,5 +1,13 @@ spring: + config: + import: "sm://" flyway: url: jdbc:h2:mem:testdb username: sa - password: \ No newline at end of file + password: + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} + diff --git a/apps/app-tilgang-analyse-service/src/main/resources/application-localdb.yml b/apps/app-tilgang-analyse-service/src/main/resources/application-localdb.yml index 7758f35c75d..baf2a030a5e 100644 --- a/apps/app-tilgang-analyse-service/src/main/resources/application-localdb.yml +++ b/apps/app-tilgang-analyse-service/src/main/resources/application-localdb.yml @@ -1,9 +1,16 @@ spring: + config: + import: "sm://" + flyway: + url: jdbc:postgresql://localhost:3306/testnav-app-tilgang-analyse-service-db + user: testnav-app-tilgang-analyse-service + password: ${DB_PASSWORD} r2dbc: url: r2dbc:postgresql://localhost:3306/testnav-app-tilgang-analyse-service-db username: testnav-app-tilgang-analyse-service password: ${DB_PASSWORD} - flyway: - url: jdbc:postgresql://localhost:3306/testnav-app-tilgang-analyse-service-db - username: testnav-app-tilgang-analyse-service - password: ${DB_PASSWORD} \ No newline at end of file + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} \ No newline at end of file diff --git a/apps/app-tilgang-analyse-service/src/main/resources/application.yml b/apps/app-tilgang-analyse-service/src/main/resources/application.yml index 3ec1b0c00ee..ebf58a884c3 100644 --- a/apps/app-tilgang-analyse-service/src/main/resources/application.yml +++ b/apps/app-tilgang-analyse-service/src/main/resources/application.yml @@ -1,9 +1,6 @@ AAD_ISSUER_URI: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b spring: - cloud: - vault: - enabled: false application: version: application.version.todo #TODO Finn ut hvordan denne kan settes fra gradle name: testnav-app-tilgang-analyse-service @@ -14,7 +11,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} tokenx: issuer-uri: ${TOKEN_X_ISSUER} jwk-set-uri: ${TOKEN_X_JWKS_URI} diff --git a/apps/app-tilgang-analyse-service/src/test/resources/application-test.yml b/apps/app-tilgang-analyse-service/src/test/resources/application-test.yml index 060eeae71e3..77a88244e60 100644 --- a/apps/app-tilgang-analyse-service/src/test/resources/application-test.yml +++ b/apps/app-tilgang-analyse-service/src/test/resources/application-test.yml @@ -1,9 +1,12 @@ DOLLY_READER_TOKEN: test +TOKEN_X_ISSUER: dummy spring: + cloud: + gcp: + secretmanager: + enabled: false flyway: url: jdbc:h2:mem:testdb username: sa - password: - -TOKEN_X_ISSUER: dummy \ No newline at end of file + password: \ No newline at end of file diff --git a/apps/arbeidsforhold-service/README.md b/apps/arbeidsforhold-service/README.md index 4aeb2e7829d..e25476ca6ec 100644 --- a/apps/arbeidsforhold-service/README.md +++ b/apps/arbeidsforhold-service/README.md @@ -1,19 +1,6 @@ # testnav-arbeidsforhold-service API for arbeidsforhold som hentes fra testnav-aareg-proxy. -## Swagger -Swagger finnes under [/swagger](https://testnav-arbeidsforhold-service.intern.dev.nav.no/swagger) -endepunktet til applikasjonen. - ## Lokal kjøring -Ha naisdevice kjørende og kjør ArbeidsforholdApiApplicationStarter med følgende argumenter: -``` --Dspring.cloud.vault.token=[kopier token fra vault] --Dspring.profiles.active=dev -``` - -### Utviklerimage -I utviklerimage brukes ikke naisdevice og du må legge til følgende ekstra argumenter: -``` --Djavax.net.ssl.trustStore=[path til lokal truststore] --Djavax.net.ssl.trustStorePassword=[passord til lokal truststore] -``` \ No newline at end of file +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) \ No newline at end of file diff --git a/apps/arbeidsforhold-service/build.gradle b/apps/arbeidsforhold-service/build.gradle index 9f7c5b47406..77cb3bf9c00 100644 --- a/apps/arbeidsforhold-service/build.gradle +++ b/apps/arbeidsforhold-service/build.gradle @@ -23,7 +23,6 @@ dependencies { implementation "no.nav.testnav.libs:security-core" implementation "no.nav.testnav.libs:servlet-core" implementation "no.nav.testnav.libs:servlet-security" - implementation "no.nav.testnav.libs:vault" implementation "org.springframework.boot:spring-boot-starter-web" implementation "org.springframework.boot:spring-boot-starter-oauth2-client" diff --git a/apps/arbeidsforhold-service/config.yml b/apps/arbeidsforhold-service/config.yml index 553ffc6f0b4..f5ead086d9d 100644 --- a/apps/arbeidsforhold-service/config.yml +++ b/apps/arbeidsforhold-service/config.yml @@ -28,6 +28,8 @@ spec: cluster: dev-gcp - application: testnav-synt-sykemelding-api cluster: dev-gcp + - application: testnav-synt-sykemelding-api-dev + cluster: dev-gcp outbound: external: - host: testnav-aareg-proxy.dev-fss-pub.nais.io diff --git a/apps/arbeidsforhold-service/settings.gradle b/apps/arbeidsforhold-service/settings.gradle index dfcdf5023f1..936af046ee4 100644 --- a/apps/arbeidsforhold-service/settings.gradle +++ b/apps/arbeidsforhold-service/settings.gradle @@ -12,7 +12,6 @@ includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-security' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/ArbeidsforholdApiApplicationStarter.java b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/ArbeidsforholdApiApplicationStarter.java index 5afc9f4e4fa..575e1cf149b 100644 --- a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/ArbeidsforholdApiApplicationStarter.java +++ b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/ArbeidsforholdApiApplicationStarter.java @@ -9,4 +9,4 @@ public class ArbeidsforholdApiApplicationStarter { public static void main(String[] args) { SpringApplication.run(ArbeidsforholdApiApplicationStarter.class, args); } -} \ No newline at end of file +} diff --git a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java deleted file mode 100644 index 0e6ad5ab37f..00000000000 --- a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.registre.testnorge.arbeidsforholdservice.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("dev") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/arbeidsforhold-service/src/main/resources/application-dev.yml b/apps/arbeidsforhold-service/src/main/resources/application-dev.yml new file mode 100644 index 00000000000..bea43da510a --- /dev/null +++ b/apps/arbeidsforhold-service/src/main/resources/application-dev.yml @@ -0,0 +1,8 @@ +spring: + config: + import: "sm://" + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} \ No newline at end of file diff --git a/apps/arbeidsforhold-service/src/main/resources/application.yml b/apps/arbeidsforhold-service/src/main/resources/application.yml index 1ede0997de3..9e816896986 100644 --- a/apps/arbeidsforhold-service/src/main/resources/application.yml +++ b/apps/arbeidsforhold-service/src/main/resources/application.yml @@ -10,7 +10,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} tokenx: issuer-uri: ${TOKEN_X_ISSUER} jwk-set-uri: ${TOKEN_X_JWKS_URI} @@ -27,10 +27,7 @@ consumers: namespace: dolly url: https://testnav-aareg-proxy.dev-fss-pub.nais.io cluster: dev-fss -spec: - azure: - application: - enabled: true + management: endpoints: enabled-by-default: true diff --git a/apps/arbeidsforhold-service/src/main/resources/bootstrap.yml b/apps/arbeidsforhold-service/src/main/resources/bootstrap.yml deleted file mode 100644 index ecb0a23c187..00000000000 --- a/apps/arbeidsforhold-service/src/main/resources/bootstrap.yml +++ /dev/null @@ -1 +0,0 @@ -spring.cloud.vault.enabled: false \ No newline at end of file diff --git a/apps/arbeidsforhold-service/src/test/resources/application-test.properties b/apps/arbeidsforhold-service/src/test/resources/application-test.properties deleted file mode 100644 index e5e55886152..00000000000 --- a/apps/arbeidsforhold-service/src/test/resources/application-test.properties +++ /dev/null @@ -1 +0,0 @@ -TOKEN_X_ISSUER=dummy \ No newline at end of file diff --git a/apps/arbeidsforhold-service/src/test/resources/application-test.yml b/apps/arbeidsforhold-service/src/test/resources/application-test.yml new file mode 100644 index 00000000000..aa8bfa92394 --- /dev/null +++ b/apps/arbeidsforhold-service/src/test/resources/application-test.yml @@ -0,0 +1,7 @@ +TOKEN_X_ISSUER: dummy + +spring: + cloud: + gcp: + secretmanager: + enabled: false \ No newline at end of file diff --git a/apps/batch-bestilling-service/README.md b/apps/batch-bestilling-service/README.md index f9327b1d9be..237fac92fba 100644 --- a/apps/batch-bestilling-service/README.md +++ b/apps/batch-bestilling-service/README.md @@ -1,18 +1,6 @@ # Batch-bestilling-service App for å sende inn et stort antall bestillinger mot backend over tid, for å ikke overbelaste Dolly -## Swagger -Swagger finnes under [/swagger](https://testnav-batch-bestilling-service.intern.dev.nav.no/swagger) -endepunktet til applikasjonen. - ## Lokal kjøring -Ha naisdevice kjørende og kjør MiljoerServiceApplicationStarter med følgende argumenter: -``` --Dspring.profiles.active=dev -``` - -### Utviklerimage -I utviklerimage brukes ikke naisdevice og du må legge til følgende ekstra argumenter: -``` --Djavax.net.ssl.trustStore=[path til lokal truststore] --Djavax.net.ssl.trustStorePassword=[passord til lokal truststore] -``` \ No newline at end of file +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) \ No newline at end of file diff --git a/apps/batch-bestilling-service/build.gradle b/apps/batch-bestilling-service/build.gradle index 129a68b9273..fd98618053d 100644 --- a/apps/batch-bestilling-service/build.gradle +++ b/apps/batch-bestilling-service/build.gradle @@ -18,7 +18,6 @@ dependencies { implementation "no.nav.testnav.libs:servlet-core" implementation "no.nav.testnav.libs:servlet-insecure-security" implementation "no.nav.testnav.libs:servlet-security" - implementation "no.nav.testnav.libs:vault" implementation "org.springframework.boot:spring-boot-starter-web" implementation "org.springframework.boot:spring-boot-starter-oauth2-client" diff --git a/apps/batch-bestilling-service/config.yml b/apps/batch-bestilling-service/config.yml index 47787f147c3..4ed5aacd8ee 100644 --- a/apps/batch-bestilling-service/config.yml +++ b/apps/batch-bestilling-service/config.yml @@ -47,8 +47,6 @@ spec: replicas: min: 1 max: 1 - vault: - enabled: true resources: requests: cpu: 200m diff --git a/apps/batch-bestilling-service/settings.gradle b/apps/batch-bestilling-service/settings.gradle index 2c9010e2117..c3664eb2a8d 100644 --- a/apps/batch-bestilling-service/settings.gradle +++ b/apps/batch-bestilling-service/settings.gradle @@ -13,7 +13,6 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/servlet-security' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java deleted file mode 100644 index efc8549b2a5..00000000000 --- a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.registre.testnorge.batchbestillingservice.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("dev") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/batch-bestilling-service/src/main/resources/application-dev.yml b/apps/batch-bestilling-service/src/main/resources/application-dev.yml index 646701de3d6..c3bbec56cd7 100644 --- a/apps/batch-bestilling-service/src/main/resources/application-dev.yml +++ b/apps/batch-bestilling-service/src/main/resources/application-dev.yml @@ -1,3 +1,12 @@ +spring: + config: + import: "sm://" + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} + consumers: dolly-backend: url: https://dolly-backend.intern.dev.nav.no \ No newline at end of file diff --git a/apps/batch-bestilling-service/src/main/resources/application.yml b/apps/batch-bestilling-service/src/main/resources/application.yml index 2c0f29cb9dd..5e056d09e77 100644 --- a/apps/batch-bestilling-service/src/main/resources/application.yml +++ b/apps/batch-bestilling-service/src/main/resources/application.yml @@ -1,9 +1,6 @@ AAD_ISSUER_URI: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b spring: - cloud: - vault: - enabled: false main: banner-mode: off application: @@ -15,7 +12,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} tokenx: issuer-uri: ${TOKEN_X_ISSUER} jwk-set-uri: ${TOKEN_X_JWKS_URI} diff --git a/apps/batch-bestilling-service/src/test/resources/application-test.properties b/apps/batch-bestilling-service/src/test/resources/application-test.properties deleted file mode 100644 index 483fe127f1f..00000000000 --- a/apps/batch-bestilling-service/src/test/resources/application-test.properties +++ /dev/null @@ -1 +0,0 @@ -TOKEN_X_ISSUER= dummy \ No newline at end of file diff --git a/apps/batch-bestilling-service/src/test/resources/application-test.yml b/apps/batch-bestilling-service/src/test/resources/application-test.yml new file mode 100644 index 00000000000..aa8bfa92394 --- /dev/null +++ b/apps/batch-bestilling-service/src/test/resources/application-test.yml @@ -0,0 +1,7 @@ +TOKEN_X_ISSUER: dummy + +spring: + cloud: + gcp: + secretmanager: + enabled: false \ No newline at end of file diff --git a/apps/brreg-stub/README.md b/apps/brreg-stub/README.md index 8603f36a855..221c8187996 100644 --- a/apps/brreg-stub/README.md +++ b/apps/brreg-stub/README.md @@ -15,9 +15,7 @@ For dokumentasjon av applikasjonen sine endepunkter: - `/api` - `WSDL: /ws` -## Deployment - -Applikasjonen deployes til dev-fss ved bruk av [Github Actions.](https://github.com/navikt/testnorge/actions) Nytt bygg trigges ved PR eller merge til master. - -Applikasjonen kan også startes opp lokalt ved å bruke LocalApplicationStarter +## Lokal kjøring +* [Generelt.](../../docs/local_general.md) +* [Lokal PostgreSQL.](../../docs/local_db.md) diff --git a/apps/brreg-stub/build.gradle b/apps/brreg-stub/build.gradle index a87ac6709a9..9c396b61094 100644 --- a/apps/brreg-stub/build.gradle +++ b/apps/brreg-stub/build.gradle @@ -46,7 +46,6 @@ dependencies { implementation "org.flywaydb:flyway-core" implementation "org.flywaydb:flyway-database-postgresql" - implementation "com.h2database:h2" implementation "wsdl4j:wsdl4j" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" @@ -56,7 +55,6 @@ dependencies { implementation "no.nav.common:util" implementation "no.nav.common:cxf:3.2023.10.17_06.55-4e30d96bba05" - implementation "com.h2database:h2" implementation "com.sun.xml.ws:jaxws-rt:$versions.jaxws" testImplementation "org.testcontainers:junit-jupiter" testImplementation "org.testcontainers:postgresql" diff --git a/apps/brreg-stub/src/main/java/no/nav/brregstub/BrregApplicationLauncher.java b/apps/brreg-stub/src/main/java/no/nav/brregstub/BrregApplicationLauncher.java index 12faa239d78..8b8c4d7295d 100644 --- a/apps/brreg-stub/src/main/java/no/nav/brregstub/BrregApplicationLauncher.java +++ b/apps/brreg-stub/src/main/java/no/nav/brregstub/BrregApplicationLauncher.java @@ -1,6 +1,6 @@ package no.nav.brregstub; -import no.nav.testnav.libs.servletcore.util.VaultUtil; +import no.nav.testnav.libs.vault.VaultUtils; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -9,10 +9,8 @@ public class BrregApplicationLauncher { public static void main(String[] args) { - - if ("prod".equals(System.getProperty("spring.profiles.active"))) { - VaultUtil.initCloudVaultToken(); - } + VaultUtils.initCloudVaultToken("prod"); SpringApplication.run(BrregApplicationLauncher.class, args); } + } diff --git a/apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java b/apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java deleted file mode 100644 index feb88f5e4b5..00000000000 --- a/apps/brreg-stub/src/main/java/no/nav/brregstub/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.brregstub.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("local") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/brreg-stub/src/main/resources/application-local.yaml b/apps/brreg-stub/src/main/resources/application-local.yaml index 228ab581635..445837b9c32 100644 --- a/apps/brreg-stub/src/main/resources/application-local.yaml +++ b/apps/brreg-stub/src/main/resources/application-local.yaml @@ -1,21 +1,13 @@ spring: datasource: - url: jdbc:h2:mem:testdb;MODE=PostgreSQL;DB_CLOSE_DELAY=-1 - driverClassName: org.h2.Driver - username: sa + url: jdbc:postgresql://localhost:5432/testnav-brregstub + username: postgres jpa: - database-platform: org.hibernate.dialect.H2Dialect show-sql: false hibernate: ddl-auto: create - h2: - console: - enabled: true - path: /h2-console cloud: vault: enabled: false - database: - enabled: false flyway: enabled: true \ No newline at end of file diff --git a/apps/brreg-stub/src/main/resources/application-prod.yaml b/apps/brreg-stub/src/main/resources/application-prod.yaml index 1ba9cd7cef9..f0277592973 100644 --- a/apps/brreg-stub/src/main/resources/application-prod.yaml +++ b/apps/brreg-stub/src/main/resources/application-prod.yaml @@ -17,6 +17,9 @@ spring: hibernate: dialect: org.hibernate.dialect.PostgreSQLDialect cloud: + gcp: + secretmanager: + enabled: false # Running in dev-fss. vault: host: vault.adeo.no port: 443 diff --git a/apps/brreg-stub/src/main/resources/application.yaml b/apps/brreg-stub/src/main/resources/application.yaml index f5cbfac1e91..de4ff173f11 100644 --- a/apps/brreg-stub/src/main/resources/application.yaml +++ b/apps/brreg-stub/src/main/resources/application.yaml @@ -1,8 +1,4 @@ spring: - jpa: - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect application: name: brreg-stub diff --git a/apps/brreg-stub/src/test/resources/application-test.yml b/apps/brreg-stub/src/test/resources/application-test.yml index e76cddc54d0..286163d0877 100644 --- a/apps/brreg-stub/src/test/resources/application-test.yml +++ b/apps/brreg-stub/src/test/resources/application-test.yml @@ -5,6 +5,9 @@ spring: enabled: false database: enabled: false + gcp: + secretmanager: + enabled: false datasource: url: jdbc:tc:postgresql:15:///test_database username: user @@ -12,9 +15,3 @@ spring: jpa: hibernate: ddl-auto: create - -azure: - app: - client: - id: dummy - secret: dummy diff --git a/apps/bruker-service/README.md b/apps/bruker-service/README.md index 5298493fda3..ca72b5293bf 100644 --- a/apps/bruker-service/README.md +++ b/apps/bruker-service/README.md @@ -3,23 +3,6 @@ Service som henter og validerer en ansatt fra en reell organisasjon og brukes for autensiering ved bruk av våre applikasjoner som har bankId innlogging. -## Swagger - -Swagger finnes under [/swagger](https://testnav-bruker-service.intern.dev.nav.no/swagger) -endepunktet til -applikasjonen. - ## Lokal kjøring - -For å kjøre lokalt (BrukerServiceApplicationStarter) må active profile settes til `local`. I tillegg, må cloud vault -token hentes fra Vault. Vault token hentes ved at man logger inn i Vault, trykker på nedtrekksmenyen oppe til høyre, og -trykker på "Copy token". - -Disse verdiene fylles deretter inn i VM Options på IDE: - -Run -> Edit Configurations -> VM Options - -``` --Dspring.cloud.vault.token=(Copy token fra Vault) --Dspring.profiles.active=local -``` +* [Generelt.](../../docs/local_general.md) diff --git a/apps/bruker-service/build.gradle b/apps/bruker-service/build.gradle index 6c67a5154dd..6b0d94a958e 100644 --- a/apps/bruker-service/build.gradle +++ b/apps/bruker-service/build.gradle @@ -25,7 +25,6 @@ sonarqube { dependencies { implementation "com.auth0:java-jwt:$versions.jwt" - implementation "no.nav.testnav.libs:vault" implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-core" implementation "no.nav.testnav.libs:reactive-security" diff --git a/apps/bruker-service/settings.gradle b/apps/bruker-service/settings.gradle index 55f05ce5ca5..dabd186654a 100644 --- a/apps/bruker-service/settings.gradle +++ b/apps/bruker-service/settings.gradle @@ -11,7 +11,6 @@ includeBuild '../../libs/integration-test' includeBuild '../../libs/reactive-core' includeBuild '../../libs/reactive-security' includeBuild '../../libs/security-core' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java b/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java deleted file mode 100644 index ef803603f38..00000000000 --- a/apps/bruker-service/src/main/java/no/nav/testnav/apps/brukerservice/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.testnav.apps.brukerservice.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("local") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/bruker-service/src/main/resources/application-virtual.yml b/apps/bruker-service/src/main/resources/application-virtual.yml index f0a38e20b8a..b45d934be91 100644 --- a/apps/bruker-service/src/main/resources/application-virtual.yml +++ b/apps/bruker-service/src/main/resources/application-virtual.yml @@ -1,4 +1,8 @@ spring: + cloud: + gcp: + secretmanager: + enabled: false security: oauth2: resourceserver: diff --git a/apps/bruker-service/src/main/resources/application.yml b/apps/bruker-service/src/main/resources/application.yml index 8e7c4794648..9f515a648c1 100644 --- a/apps/bruker-service/src/main/resources/application.yml +++ b/apps/bruker-service/src/main/resources/application.yml @@ -2,7 +2,7 @@ spring: application: version: application.version.todo name: testnav-bruker-service - desciption: Tjeneste for brukere + description: Tjeneste for brukere security: oauth2: resourceserver: diff --git a/apps/bruker-service/src/main/resources/bootstrap.yml b/apps/bruker-service/src/main/resources/bootstrap.yml deleted file mode 100644 index 0451449ca23..00000000000 --- a/apps/bruker-service/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,4 +0,0 @@ -spring: - cloud: - vault: - enabled: false \ No newline at end of file diff --git a/apps/bruker-service/src/test/resources/application-test.yml b/apps/bruker-service/src/test/resources/application-test.yml index 4b0268cd2f4..5ac5d4b6204 100644 --- a/apps/bruker-service/src/test/resources/application-test.yml +++ b/apps/bruker-service/src/test/resources/application-test.yml @@ -4,6 +4,10 @@ JWT_SECRET: DUMMY SUPER SECRET JWT KEY THAT IS NOT SECURE TOKEN_X_CLIENT_ID: test spring: + cloud: + gcp: + secretmanager: + enabled: false flyway: url: jdbc:h2:mem:testdb username: sa diff --git a/apps/budpro-service/README.md b/apps/budpro-service/README.md index 3b225d22d36..795a11f3dcd 100644 --- a/apps/budpro-service/README.md +++ b/apps/budpro-service/README.md @@ -1,17 +1,14 @@ Dette er en tjeneste laget for Team BudPro, for å generere NAV-ansatte og deres informasjon. -Startes lokalt på samme måte som alle andre. Spring profile `local`, definer `spring.cloud.vault.token` fra Vault. -Swagger på http://localhost:8080/swagger. Se endepunkter under `budpro-controller`. Andre endepunkter er for å liste ut definerte grunnverdier. +Startes lokalt på samme måte som alle andre. Spring profile `local`. Se endepunkter under `budpro-controller`. Andre endepunkter er for å liste ut definerte grunnverdier. Kun én integrasjon, med _generer-navn-service_. **Kilder:** +* [Kommuner](https://www.ssb.no/klass/klassifikasjoner/131) +* [Stillinger](https://www.ssb.no/arbeid-og-lonn/sysselsetting/artikler/yrkeskatalogen) +* [Organisasjonsenhet](https://confluence.adeo.no/display/PK/PK-6917?preview=%2F68215567%2F101614076%2FHR+ORGANISASJONSSTRUKTUR2.xls) -*Kommuner:* -> https://www.ssb.no/klass/klassifikasjoner/131 - -*Stillinger:* -> https://www.ssb.no/arbeid-og-lonn/sysselsetting/artikler/yrkeskatalogen - -*Organisasjonsenhet:* -> https://confluence.adeo.no/display/PK/PK-6917?preview=%2F68215567%2F101614076%2FHR+ORGANISASJONSSTRUKTUR2.xls \ No newline at end of file +## Lokal kjøring +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) \ No newline at end of file diff --git a/apps/budpro-service/build.gradle b/apps/budpro-service/build.gradle index 1746c789889..4fc43f98721 100644 --- a/apps/budpro-service/build.gradle +++ b/apps/budpro-service/build.gradle @@ -10,7 +10,6 @@ dependencies { implementation "no.nav.testnav.libs:servlet-core" implementation "no.nav.testnav.libs:servlet-insecure-security" implementation "no.nav.testnav.libs:servlet-security" - implementation "no.nav.testnav.libs:vault" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "org.springframework.boot:spring-boot-starter-oauth2-client" diff --git a/apps/budpro-service/settings.gradle b/apps/budpro-service/settings.gradle index 8c47d75f7c5..1c99b24ef24 100644 --- a/apps/budpro-service/settings.gradle +++ b/apps/budpro-service/settings.gradle @@ -13,7 +13,6 @@ includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' includeBuild '../../libs/servlet-insecure-security' includeBuild '../../libs/servlet-security' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java b/apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java deleted file mode 100644 index f1db761cd03..00000000000 --- a/apps/budpro-service/src/main/java/no/nav/dolly/budpro/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.dolly.budpro; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("local") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} diff --git a/apps/budpro-service/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/apps/budpro-service/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 85f8bbe8e52..303ccf6a7c6 100644 --- a/apps/budpro-service/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/apps/budpro-service/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -29,6 +29,6 @@ { "name": "spring.security.oauth2.resourceserver.aad.accepted-audience", "type": "java.lang.String", - "description": "Accepted audience for Azure AD, i.e. '${azure.app.client.id}, api://${azure.app.client.id}'." + "description": "Accepted audience for Azure AD, i.e. ' ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID}'." } ] } \ No newline at end of file diff --git a/apps/budpro-service/src/main/resources/application-local.yml b/apps/budpro-service/src/main/resources/application-local.yml index d934bb26140..10148a7de46 100644 --- a/apps/budpro-service/src/main/resources/application-local.yml +++ b/apps/budpro-service/src/main/resources/application-local.yml @@ -1,13 +1,11 @@ spring: - cloud: - vault: - host: vault.adeo.no - port: 443 + config: + import: "sm://" security: oauth2: resourceserver: aad: - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} management: endpoints: diff --git a/apps/budpro-service/src/main/resources/application.yml b/apps/budpro-service/src/main/resources/application.yml index dbaf3135de7..2f26a58b56d 100644 --- a/apps/budpro-service/src/main/resources/application.yml +++ b/apps/budpro-service/src/main/resources/application.yml @@ -1,16 +1,13 @@ AAD_ISSUER_URI: https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b spring: - cloud: - vault: - enabled: false security: oauth2: resourceserver: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api://${AZURE_APP_CLIENT_ID} management: endpoints: diff --git a/apps/budpro-service/src/test/resources/application-test.yml b/apps/budpro-service/src/test/resources/application-test.yml index e69de29bb2d..0aeb22a14f6 100644 --- a/apps/budpro-service/src/test/resources/application-test.yml +++ b/apps/budpro-service/src/test/resources/application-test.yml @@ -0,0 +1,5 @@ +spring: + cloud: + gcp: + secretmanager: + enabled: false \ No newline at end of file diff --git a/apps/dolly-backend/README.md b/apps/dolly-backend/README.md index 060a153a43d..1387ff52bc8 100644 --- a/apps/dolly-backend/README.md +++ b/apps/dolly-backend/README.md @@ -13,26 +13,8 @@ Applikasjonen legger også ved potensielle standard verdier som kreves i API vi trenger å ha noe forhold til under utfylling av bestilling. Noe data blir persistert i postgres db, som f.eks brukerne av Dolly, bestillingskriterier, hvem som har sendt de inn og status på disse. -## Utenfor utviklerimage - -https://dolly.ekstern.dev.nav.no/swagger-ui.html - -## Fra utviklerimage - -https://dolly-backend.intern.dev.nav.no/swagger-ui.html - -## Kjør lokalt -* Se [generell informasjon](../../docs/local_general.md). -* Applikasjonen er avhengig av en database i GCP, se [egen dokumentasjon](../../docs/gcp_db.md). -* Applikasjonen er avhengig av OpenSearch: -```aiexclude -> docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "plugins.security.disabled=true" -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD=YLAgOm}rz#o6#Aq" --name opensearch -d opensearchproject/opensearch:latest -``` -Legg merke til passord `YLAgOm}rz#o6#Aq` (tilfeldig [generert](https://www.strongpasswordgenerator.org/), men må være "sterkt" ellers vil ikke OpenSearch starte). - -**Mac:** For å kjøre tester og bygge appen lokalt må Docker (Colima kan brukes) kjøre og man er nødt til å sette disse miljøvariablene: -``` -DOCKER_HOST=unix://${HOME}/.colima/default/docker.sock -TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock -TESTCONTAINERS_RYUK_DISABLED=true -``` \ No newline at end of file +## Lokal kjøring +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) +* [Database i GCP.](../../docs/gcp_db.md) +* [OpenSearch.](../../docs/local_opensearch.md) diff --git a/apps/dolly-backend/build.gradle b/apps/dolly-backend/build.gradle index e54384a2308..b51dc1f0fb0 100644 --- a/apps/dolly-backend/build.gradle +++ b/apps/dolly-backend/build.gradle @@ -10,18 +10,13 @@ sonarqube { } dependencies { - implementation "com.google.cloud:spring-cloud-gcp-starter-secretmanager:$versions.gcpSecretManager" - implementation 'no.nav.testnav.libs:servlet-core' implementation 'no.nav.testnav.libs:servlet-security' implementation 'no.nav.testnav.libs:servlet-insecure-security' implementation 'no.nav.testnav.libs:security-core' - implementation 'no.nav.testnav.libs:database' - implementation 'no.nav.testnav.libs:vault' implementation 'no.nav.testnav.libs:data-transfer-objects' implementation 'no.nav.testnav.libs:data-transfer-search-objects' implementation 'no.nav.testnav.libs:reactive-core' - implementation 'no.nav.testnav.libs:vault' implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" diff --git a/apps/dolly-backend/config.test.yml b/apps/dolly-backend/config.test.yml index c99e52ac2e3..ed956306f6d 100644 --- a/apps/dolly-backend/config.test.yml +++ b/apps/dolly-backend/config.test.yml @@ -39,7 +39,9 @@ spec: - application: testnav-person-service - application: testnav-skattekort-service - application: testnav-sykemelding-api + - application: testnav-sykemelding-api-dev - application: testnav-synt-sykemelding-api + - application: testnav-synt-sykemelding-api-dev - application: testnav-tps-messaging-service - application: testnav-yrkesskade-proxy - application: testnorge-profil-api-dev diff --git a/apps/dolly-backend/settings.gradle b/apps/dolly-backend/settings.gradle index 33b2f7284fb..a2be1459e30 100644 --- a/apps/dolly-backend/settings.gradle +++ b/apps/dolly-backend/settings.gradle @@ -9,8 +9,6 @@ includeBuild "../../plugins/java" includeBuild '../../.github/workflows' includeBuild '../../libs/data-transfer-objects' includeBuild '../../libs/data-transfer-search-objects' -includeBuild '../../libs/database' -includeBuild '../../libs/vault' includeBuild '../../libs/reactive-core' includeBuild '../../libs/security-core' includeBuild '../../libs/servlet-core' diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java index 6af8668f777..f0ef428e58d 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java @@ -10,4 +10,4 @@ public static void main(String[] args) { SpringApplication.run(DollyBackendApplicationStarter.class, args); } -} \ No newline at end of file +} diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterConsumer.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterConsumer.java index af14b85f811..9dadced34e2 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterConsumer.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterConsumer.java @@ -69,14 +69,14 @@ public PensjonforvalterConsumer( .build(); } - @Timed(name = "providers", tags = {"operation", "pen_getMiljoer"}) + @Timed(name = "providers", tags = { "operation", "pen_getMiljoer" }) public Mono> getMiljoer() { return tokenService.exchange(serverProperties) .flatMap(token -> new HentMiljoerCommand(webClient, token.getTokenValue()).call()); } - @Timed(name = "providers", tags = {"operation", "popp_lagreInntekt"}) + @Timed(name = "providers", tags = { "operation", "popp_lagreInntekt" }) public Flux lagreInntekter(PensjonPoppInntektRequest pensjonPoppInntektRequest) { return tokenService.exchange(serverProperties) @@ -84,7 +84,7 @@ public Flux lagreInntekter(PensjonPoppInntektRequest p pensjonPoppInntektRequest).call()); } - @Timed(name = "providers", tags = {"operation", "popp_lagreGenerertInntekt"}) + @Timed(name = "providers", tags = { "operation", "popp_lagreGenerertInntekt" }) public Flux lagreGenererteInntekter(PensjonPoppGenerertInntektRequest pensjonPoppGenerertInntektRequest) { return tokenService.exchange(serverProperties) @@ -92,7 +92,7 @@ public Flux lagreGenererteInntekter(PensjonPoppGenerer pensjonPoppGenerertInntektRequest).call()); } - @Timed(name = "providers", tags = {"operation", "pen_opprettPerson"}) + @Timed(name = "providers", tags = { "operation", "pen_opprettPerson" }) public Flux opprettPerson(PensjonPersonRequest pensjonPersonRequest, Set miljoer) { @@ -102,7 +102,7 @@ public Flux opprettPerson(PensjonPersonRequest pensjon .doOnNext(response -> log.info("Opprettet person for {}: {}", pensjonPersonRequest.getFnr(), response)); } - @Timed(name = "providers", tags = {"operation", "pen_hentSamboer"}) + @Timed(name = "providers", tags = { "operation", "pen_hentSamboer" }) public Flux hentSamboer(String ident, String miljoe) { return tokenService.exchange(serverProperties) @@ -110,22 +110,23 @@ public Flux hentSamboer(String ident, String miljoe) { .doOnNext(response -> log.info("Pensjon samboer for {} i {} hentet {}", ident, miljoe, response)); } - @Timed(name = "providers", tags = {"operation", "pen_opprettSamboer"}) + @Timed(name = "providers", tags = { "operation", "pen_opprettSamboer" }) public Flux lagreSamboer(PensjonSamboerRequest pensjonSamboerRequest, String miljoe) { + log.info("Oppretter samboerskap i pensjon: {}", pensjonSamboerRequest); return tokenService.exchange(serverProperties) .flatMapMany(token -> new LagreSamboerCommand(webClient, pensjonSamboerRequest, miljoe, token.getTokenValue()).call()); } - @Timed(name = "providers", tags = {"operation", "pen_opprettSamboer"}) + @Timed(name = "providers", tags = { "operation", "pen_opprettSamboer" }) public Flux annullerSamboer(String periodeId, String miljoe) { return tokenService.exchange(serverProperties) .flatMapMany(token -> new AnnullerSamboerCommand(webClient, periodeId, miljoe, token.getTokenValue()).call()); } - @Timed(name = "providers", tags = {"operation", "pen_lagreAlderspensjon"}) + @Timed(name = "providers", tags = { "operation", "pen_lagreAlderspensjon" }) public Flux lagreAlderspensjon(AlderspensjonRequest request) { return tokenService.exchange(serverProperties) @@ -133,21 +134,21 @@ public Flux lagreAlderspensjon(AlderspensjonRequest re new LagreAlderspensjonCommand(webClient, token.getTokenValue(), request).call()); } - @Timed(name = "providers", tags = {"operation", "pen_lagreUforetrygd"}) + @Timed(name = "providers", tags = { "operation", "pen_lagreUforetrygd" }) public Flux lagreUforetrygd(PensjonUforetrygdRequest request) { return tokenService.exchange(serverProperties) .flatMapMany(token -> new LagreUforetrygdCommand(webClient, token.getTokenValue(), request).call()); } - @Timed(name = "providers", tags = {"operation", "pen_lagreTpForhold"}) + @Timed(name = "providers", tags = { "operation", "pen_lagreTpForhold" }) public Flux lagreTpForhold(PensjonTpForholdRequest pensjonTpForholdRequest) { return tokenService.exchange(serverProperties) .flatMapMany(token -> new LagreTpForholdCommand(webClient, token.getTokenValue(), pensjonTpForholdRequest).call()); } - @Timed(name = "providers", tags = {"operation", "pen_sletteTpForhold"}) + @Timed(name = "providers", tags = { "operation", "pen_sletteTpForhold" }) public void sletteTpForhold(List identer) { tokenService.exchange(serverProperties) @@ -159,21 +160,21 @@ public void sletteTpForhold(List identer) { .subscribe(response -> log.info("Slettet mot PESYS (tp) i alle miljoer")); } - @Timed(name = "providers", tags = {"operation", "pen_lagreTpYtelse"}) + @Timed(name = "providers", tags = { "operation", "pen_lagreTpYtelse" }) public Flux lagreTpYtelse(PensjonTpYtelseRequest pensjonTpYtelseRequest) { return tokenService.exchange(serverProperties) .flatMapMany(token -> new LagreTpYtelseCommand(webClient, token.getTokenValue(), pensjonTpYtelseRequest).call()); } - @Timed(name = "providers", tags = {"operation", "pen_lagrePensjpnsavtale"}) + @Timed(name = "providers", tags = { "operation", "pen_lagrePensjpnsavtale" }) public Flux lagrePensjonsavtale(PensjonsavtaleRequest pensjonsavtaleRequest) { return tokenService.exchange(serverProperties) .flatMapMany(token -> new LagrePensjonsavtaleCommand(webClient, pensjonsavtaleRequest, token.getTokenValue()).call()); } - @Timed(name = "providers", tags = {"operation", "pen_slettePensjpnsavtale"}) + @Timed(name = "providers", tags = { "operation", "pen_slettePensjpnsavtale" }) public void slettePensjonsavtale(List identer) { tokenService.exchange(serverProperties) @@ -183,7 +184,7 @@ public void slettePensjonsavtale(List identer) { .subscribe(resultat -> log.info("Slettet pensjonsavtaler (PEN), alle miljøer")); } - @Timed(name = "providers", tags = {"operation", "pen_hentVedtak"}) + @Timed(name = "providers", tags = { "operation", "pen_hentVedtak" }) public Flux hentVedtak(String ident, String miljoe) { return tokenService.exchange(serverProperties) @@ -192,14 +193,14 @@ public Flux hentVedtak(String ident, String miljoe) { ident, miljoe, response)); } - @Timed(name = "providers", tags = {"operation", "pen_lagreAfpOffentlig"}) + @Timed(name = "providers", tags = { "operation", "pen_lagreAfpOffentlig" }) public Flux lagreAfpOffentlig(AfpOffentligRequest afpOffentligRequest, String ident, String miljoe) { return tokenService.exchange(serverProperties) .flatMapMany(token -> new LagreAfpOffentligCommand(webClient, afpOffentligRequest, ident, miljoe, token.getTokenValue()).call()); } - @Timed(name = "providers", tags = {"operation", "pen_sletteAfpOffentlig"}) + @Timed(name = "providers", tags = { "operation", "pen_sletteAfpOffentlig" }) public void sletteAfpOffentlig(List identer) { tokenService.exchange(serverProperties) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategy.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategy.java index 4ee87c5f634..2347e2ff256 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategy.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategy.java @@ -13,7 +13,6 @@ import java.time.LocalDateTime; import java.util.Comparator; import java.util.List; -import java.util.Objects; import static java.util.Objects.nonNull; import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; @@ -35,12 +34,13 @@ public void mapAtoB(PensjonSivilstandWrapper sivilstander, List list, MappingCon .findFirst() .ifPresent(sivilstandSamboer -> { + var datoTom = nonNull(sivilstandSamboer.getSivilstandsdato()) ? + toLocalDate(sivilstandSamboer.getSivilstandsdato()) : + LocalDate.now(); var hovedperson = PensjonSamboerRequest.builder() .pidBruker(ident) .pidSamboer(sivilstandSamboer.getRelatertVedSivilstand()) - .datoFom(nonNull(sivilstandSamboer.getSivilstandsdato()) ? - toLocalDate(sivilstandSamboer.getSivilstandsdato()) : - LocalDate.now()) + .datoFom(datoTom) .datoTom(sivilstander.getSivilstander().stream() .sorted(Comparator.comparing(SivilstandDTO::getId).reversed()) .filter(sivilstand -> sivilstand.isGift() && @@ -49,7 +49,7 @@ public void mapAtoB(PensjonSivilstandWrapper sivilstander, List list, MappingCon sivilstand2.getId() < sivilstand.getId())) .map(sivilstand -> toLocalDate(nonNull(sivilstand.getSivilstandsdato()) ? sivilstand.getSivilstandsdato() : sivilstand.getBekreftelsesdato())) - .filter(Objects::nonNull) + .filter(localDate -> nonNull(localDate) && localDate.isAfter(datoTom)) .map(dato -> dato.minusDays(1)) .findFirst() .orElse(null)) @@ -68,7 +68,6 @@ public void mapAtoB(PensjonSivilstandWrapper sivilstander, List list, MappingCon } private static LocalDate toLocalDate(LocalDateTime localDateTime) { - return nonNull(localDateTime) ? localDateTime.toLocalDate() : null; } } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/SykemeldingClient.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/SykemeldingClient.java index c7714481e7c..07980a32425 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/SykemeldingClient.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/SykemeldingClient.java @@ -188,6 +188,7 @@ private void saveTransaksjonId(SykemeldingResponse sykemelding, Long bestillingI log.info("Lagrer transaksjon for {} i q1 ", sykemelding.getIdent()); + sykemelding.getSykemeldingRequest().setSykemeldingId(sykemelding.getMsgId()); transaksjonMappingService.save(TransaksjonMapping.builder() .ident(sykemelding.getIdent()) .bestillingId(bestillingId) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SykemeldingPostCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SykemeldingPostCommand.java index 06549e69549..14877f9a865 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SykemeldingPostCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SykemeldingPostCommand.java @@ -1,12 +1,13 @@ package no.nav.dolly.bestilling.sykemelding.command; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import no.nav.dolly.bestilling.sykemelding.domain.DetaljertSykemeldingRequest; import no.nav.dolly.bestilling.sykemelding.dto.SykemeldingResponse; +import no.nav.testnav.libs.dto.sykemelding.v1.SykemeldingResponseDTO; import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import no.nav.testnav.libs.securitycore.config.UserConstant; import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; @@ -16,6 +17,7 @@ import static no.nav.dolly.util.TokenXUtil.getUserJwt; +@Slf4j @RequiredArgsConstructor public class SykemeldingPostCommand implements Callable> { @@ -35,10 +37,10 @@ public Mono call() { .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .bodyValue(request) .retrieve() - .toBodilessEntity() - .timeout(Duration.ofMinutes(4)) + .bodyToMono(SykemeldingResponseDTO.class) .map(response -> SykemeldingResponse.builder() - .status(HttpStatus.valueOf(response.getStatusCode().value())) + .status(response.getStatus()) + .msgId(response.getSykemeldingId()) .ident(request.getPasient().getIdent()) .sykemeldingRequest(SykemeldingResponse.SykemeldingRequest.builder() .detaljertSykemeldingRequest(request) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SyntSykemeldingPostCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SyntSykemeldingPostCommand.java index 2b781fa2dc8..fcbfd4b5dac 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SyntSykemeldingPostCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/command/SyntSykemeldingPostCommand.java @@ -3,10 +3,10 @@ import lombok.RequiredArgsConstructor; import no.nav.dolly.bestilling.sykemelding.domain.SyntSykemeldingRequest; import no.nav.dolly.bestilling.sykemelding.dto.SykemeldingResponse; +import no.nav.testnav.libs.dto.sykemelding.v1.SykemeldingResponseDTO; import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import no.nav.testnav.libs.securitycore.config.UserConstant; import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; @@ -34,10 +34,10 @@ public Mono call() { .header(UserConstant.USER_HEADER_JWT, getUserJwt()) .bodyValue(sykemeldingRequest) .retrieve() - .toBodilessEntity() - .timeout(Duration.ofMinutes(4)) + .bodyToMono(SykemeldingResponseDTO.class) .map(response -> SykemeldingResponse.builder() - .status(HttpStatus.valueOf(response.getStatusCode().value())) + .status(response.getStatus()) + .msgId(response.getSykemeldingId()) .ident(sykemeldingRequest.getIdent()) .sykemeldingRequest(SykemeldingResponse.SykemeldingRequest.builder() .syntSykemeldingRequest(sykemeldingRequest) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/dto/SykemeldingResponse.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/dto/SykemeldingResponse.java index 9126e4bff3c..2575ecc536c 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/dto/SykemeldingResponse.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/sykemelding/dto/SykemeldingResponse.java @@ -18,6 +18,7 @@ public class SykemeldingResponse { private HttpStatus status; private String avvik; private SykemeldingRequest sykemeldingRequest; + private String msgId; private String ident; @Data @@ -27,6 +28,7 @@ public class SykemeldingResponse { @JsonInclude(JsonInclude.Include.NON_EMPTY) public static class SykemeldingRequest { + private String sykemeldingId; private SyntSykemeldingRequest syntSykemeldingRequest; private DetaljertSykemeldingRequest detaljertSykemeldingRequest; } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/config/LocalConfig.java b/apps/dolly-backend/src/main/java/no/nav/dolly/config/LocalConfig.java deleted file mode 100644 index 00c3ffa14e7..00000000000 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/config/LocalConfig.java +++ /dev/null @@ -1,17 +0,0 @@ -package no.nav.dolly.config; - -import no.nav.testnav.libs.database.config.FlywayConfiguration; -import no.nav.testnav.libs.database.config.VaultHikariConfiguration; -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("local") -@Import({ - FlywayConfiguration.class, - VaultHikariConfiguration.class -}) -public class LocalConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java index 91b2382e5cb..d2466162e2e 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/command/KodeverkGetCommand.java @@ -4,6 +4,7 @@ import no.nav.testnav.libs.dto.kodeverkservice.v1.KodeverkDTO; import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; import reactor.util.retry.Retry; @@ -31,6 +32,10 @@ public Mono call() { .header(HttpHeaders.AUTHORIZATION, "Bearer " + token) .retrieve() .bodyToMono(KodeverkDTO.class) + .map(kodeverket -> { + kodeverket.setStatus(HttpStatus.OK); + return kodeverket; + }) .doOnError(WebClientFilter::logErrorMessage) .onErrorResume(error -> Mono.just(KodeverkDTO.builder() .kodeverknavn(kodeverk) diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/errorhandling/ErrorStatusDecoder.java b/apps/dolly-backend/src/main/java/no/nav/dolly/errorhandling/ErrorStatusDecoder.java index 893a8f55d12..466a74505e3 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/errorhandling/ErrorStatusDecoder.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/errorhandling/ErrorStatusDecoder.java @@ -102,10 +102,10 @@ public String getStatusMessage(String json) { if (json.contains("{")) { try { Map status = objectMapper.readValue(json, Map.class); - if (status.containsKey(ERROR) && isNotBlank((String) status.get(ERROR))) { - builder.append("error=").append(status.get(ERROR)).append("; "); - } else if (status.containsKey(MESSAGE) && isNotBlank((String) status.get(MESSAGE))) { + if (status.containsKey(MESSAGE) && isNotBlank((String) status.get(MESSAGE))) { builder.append("message=").append(encodeStatus((String) status.get(MESSAGE))).append("; "); + } else if (status.containsKey(ERROR) && isNotBlank((String) status.get(ERROR))) { + builder.append("error=").append(status.get(ERROR)).append("; "); } else if (status.containsKey(MELDING) && isNotBlank((String) status.get(MELDING))) { builder.append(encodeStatus((String) status.get(MELDING))); } else if (status.containsKey(DETAILS) && status.get(DETAILS) instanceof List) { diff --git a/apps/dolly-backend/src/main/resources/application-dev.yaml b/apps/dolly-backend/src/main/resources/application-dev.yaml index 6bef737e63a..a64b00aaada 100644 --- a/apps/dolly-backend/src/main/resources/application-dev.yaml +++ b/apps/dolly-backend/src/main/resources/application-dev.yaml @@ -22,3 +22,9 @@ consumers: testnav-pdl-forvalter: name: testnav-pdl-forvalter-dev url: http://testnav-pdl-forvalter-dev.dolly.svc.cluster.local + testnav-sykemelding-api: + name: testnav-sykemelding-api-dev + url: http://testnav-sykemelding-api-dev.dolly.svc.cluster.local + testnav-synt-sykemelding-api: + name: testnav-synt-sykemelding-api-dev + url: http://testnav-synt-sykemelding-api-dev.dolly.svc.cluster.local \ No newline at end of file diff --git a/apps/dolly-backend/src/main/resources/application-local.yaml b/apps/dolly-backend/src/main/resources/application-local.yaml index e4ec31e8b75..e4f1a7387b8 100644 --- a/apps/dolly-backend/src/main/resources/application-local.yaml +++ b/apps/dolly-backend/src/main/resources/application-local.yaml @@ -6,16 +6,17 @@ dolly: spring: cache: type: none - cloud: - gcp: - secretmanager: - project-id: dolly-dev-ff83 config: import: "sm://" datasource: url: jdbc:postgresql://localhost:5432/testnav-dolly-backend-local username: testnav-dolly-backend-local password: ${sm://testnav-dolly-backend-local} + security: + oauth2: + resourceserver: + aad: + accepted-audience: ${sm://azure-app-client-id}, api://${sm://azure-app-client-id} management: endpoints: @@ -54,9 +55,11 @@ consumers: testnav-organisasjon-service: url: https://testnav-organisasjon-service.intern.dev.nav.no testnav-synt-sykemelding-api: - url: https://testnav-synt-sykemelding-api.intern.dev.nav.no + name: testnav-synt-sykemelding-api-dev + url: https://testnav-synt-sykemelding-api-dev.intern.dev.nav.no testnav-sykemelding-api: - url: http://testnav-sykemelding-api.intern.dev.nav.no + name: testnav-sykemelding-api-dev + url: https://testnav-sykemelding-api-dev.intern.dev.nav.no testnav-miljoer-service: url: https://testnav-miljoer-service.intern.dev.nav.no testnav-arbeidsplassencv-proxy: diff --git a/apps/dolly-backend/src/main/resources/application.yaml b/apps/dolly-backend/src/main/resources/application.yaml index aedde1793b4..6caad4f8bde 100644 --- a/apps/dolly-backend/src/main/resources/application.yaml +++ b/apps/dolly-backend/src/main/resources/application.yaml @@ -24,9 +24,6 @@ server: max-http-request-header-size: 128KB spring: - cloud: - vault: - enabled: false main: allow-bean-definition-overriding: true flyway: @@ -50,7 +47,7 @@ spring: aad: issuer-uri: ${AAD_ISSUER_URI}/v2.0 jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys - accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id} + accepted-audience: ${AZURE_APP_CLIENT_ID}, api:// ${AZURE_APP_CLIENT_ID} jackson: parser: include-source-in-location: true diff --git a/apps/dolly-backend/src/test/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategyTest.java b/apps/dolly-backend/src/test/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategyTest.java index ea8246abfcb..87c07825032 100644 --- a/apps/dolly-backend/src/test/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategyTest.java +++ b/apps/dolly-backend/src/test/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonSamboerMappingStrategyTest.java @@ -21,6 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.hasProperty; +import static org.hamcrest.Matchers.nullValue; @ExtendWith(MockitoExtension.class) @SuppressWarnings("unchecked") @@ -28,7 +29,13 @@ class PensjonSamboerMappingStrategyTest { private static final String IDENT_1 = "11111111111"; private static final String IDENT_2 = "22222222222"; + private static final String IDENT_3 = "33333333333"; + private static final String IDENT_4 = "44444444444"; private static final LocalDateTime SIVILSTAND_DATO = LocalDateTime.now(); + private static final LocalDateTime SIVILSTAND_DATO_EARLIEST = LocalDateTime.of(2000, 10, 10, 0, 0); + private static final LocalDateTime SIVILSTAND_DATO_MIDDLE = LocalDateTime.of(2010, 10, 10, 0, 0); + private static final LocalDateTime SIVILSTAND_DATO_LATEST = LocalDateTime.of(2020, 10, 10, 0, 0); + private MapperFacade mapperFacade; @@ -42,6 +49,30 @@ private static SivilstandDTO buildSivilstand() { .build(); } + private static List buildMultipleSivilstand() { + + var sivilstandOne = SivilstandDTO.builder() + .id(1) + .type(SivilstandDTO.Sivilstand.SAMBOER) + .relatertVedSivilstand(IDENT_2) + .sivilstandsdato(SIVILSTAND_DATO_EARLIEST) + .build(); + var sivilstandTwo = SivilstandDTO.builder() + .id(2) + .type(SivilstandDTO.Sivilstand.GIFT) + .relatertVedSivilstand(IDENT_3) + .sivilstandsdato(SIVILSTAND_DATO_MIDDLE) + .build(); + var sivilstandThree = SivilstandDTO.builder() + .id(3) + .type(SivilstandDTO.Sivilstand.SAMBOER) + .relatertVedSivilstand(IDENT_4) + .sivilstandsdato(SIVILSTAND_DATO_LATEST) + .build(); + + return List.of(sivilstandOne, sivilstandTwo, sivilstandThree); + } + @BeforeEach void setup() { mapperFacade = MapperTestUtils.createMapperFacadeForMappingStrategy(new LocalDateCustomMapping(), @@ -142,4 +173,27 @@ void mapSamboerOgSenereGift_OK() { hasProperty("datoTom", is(equalTo(SIVILSTAND_DATO.toLocalDate().plusYears(1).minusDays(1)))), hasProperty("registrertAv", is(equalTo("Dolly")))))); } + + + @Test + void mapMultipleSivilstand_OK() { + + var context = new MappingContext.Factory().getContext(); + context.setProperty("ident", IDENT_1); + var resultat = (List) mapperFacade.map(PensjonSivilstandWrapper.builder() + .sivilstander(buildMultipleSivilstand()) + .build(), List.class, context); + + assertThat(resultat, containsInAnyOrder( + allOf(hasProperty("pidBruker", is(equalTo(IDENT_1))), + hasProperty("pidSamboer", is(equalTo(IDENT_4))), + hasProperty("datoFom", is(equalTo(SIVILSTAND_DATO_LATEST.toLocalDate()))), + hasProperty("datoTom", nullValue()), + hasProperty("registrertAv", is(equalTo("Dolly")))), + allOf(hasProperty("pidBruker", is(equalTo(IDENT_4))), + hasProperty("pidSamboer", is(equalTo(IDENT_1))), + hasProperty("datoFom", is(equalTo(SIVILSTAND_DATO_LATEST.toLocalDate()))), + hasProperty("datoTom", nullValue()), + hasProperty("registrertAv", is(equalTo("Dolly")))))); + } } \ No newline at end of file diff --git a/apps/dolly-backend/src/test/resources/application-test.yaml b/apps/dolly-backend/src/test/resources/application-test.yaml index 08d2e05cd35..2af37395a12 100644 --- a/apps/dolly-backend/src/test/resources/application-test.yaml +++ b/apps/dolly-backend/src/test/resources/application-test.yaml @@ -8,12 +8,6 @@ jira: username: dummy password: dummy -azure: - app: - client: - id: dummy - secret: dummy - open: search: uri: dummy @@ -90,8 +84,6 @@ spring: gcp: secretmanager: enabled: false - vault: - enabled: false datasource: type: org.springframework.jdbc.datasource.SimpleDriverDataSource url: jdbc:tc:postgresql:15:///dollyDB?TC_REUSABLE=true diff --git a/apps/dolly-frontend/README.md b/apps/dolly-frontend/README.md index f48b71a9c19..86d5113c8b2 100644 --- a/apps/dolly-frontend/README.md +++ b/apps/dolly-frontend/README.md @@ -4,11 +4,9 @@ Prosjekt for å opprette og konfigurere personer knyttet til fellesregistrene i ## Dokumentasjon -### Swagger - -Swagger finnes under /swagger-ui.html - ## Lokal kjøring +* [Generelt.](../../docs/local_general.md) +* [Secret Manager.](../../docs/local_secretmanager.md) ### Javascript @@ -26,59 +24,6 @@ generate new token (må ha read:packages og repo tilgang) .npmrc filen skal ligge i brukermappen (cd ~) din, hvis den ikke finnes der må du opprette den. -### Java - -For å kjøre lokalt (DollyFrontendApplicationStarter) må active profile settes til `local`. I tillegg, må cloud vault -token -hentes fra Vault. Vault token hentes ved at man logger inn i Vault, trykker på nedtrekksmenyen oppe til høyre, og -trykker på "Copy token". - -Disse verdiene fylles deretter inn i VM Options på IDE: - -Run -> Edit Configurations -> VM Options - -``` --Dspring.cloud.vault.token=(Copy token fra Vault) --Dspring.profiles.active=local -``` - -#### Utviklerimage - -For å kunne gjøre kall mot NAIS apper fra utviklerimage, må nav truststore settes opp og følgende verdier må -også legges til i VM Options: - -``` --Djavax.net.ssl.trustStore=C:\path\to\truststore --Djavax.net.ssl.trustStorePassword=(Passord) -``` - -##### Legge til sertifikat i truststore: - -Dersom det dukker opp RunTimeException under oppstart kan det være at du mangler sertifikat i din truststore. - -Sertifikat kan hentes -fra [Microsoft Login Cert](https://login.microsoftonline.com/62366534-1ec3-4962-8869-9b5535279d0b/login) (Ignorer -feilmeldingen om POST) - -For Mac: - -- Trykk på hengelåsen til venstre for URL og klikk deretter på sertifikat - -![Microsoft Sertifikat](../../docs/applications/dolly/assets/microsoft_keychain.png) - -- Klikk på pilen ved siden av detaljer og bla helt ned - -![Sertifikat Detaljer](../../docs/applications/dolly/assets/cert_details.png) - -- Ved å trykke på linken vil sertifikat lastes ned og man kan deretter legge denne til i Truststore ved hjelp av - kommandoen: - -``` -keytool -import -trustcacerts -alias MicrosoftLoginCert -file DIN_DOWNLOAD_DIR/DigiCertSHA2SecureServerCA.crt -keystore PATH_TIL_DIN_KEYSTORE.jts -``` - -![Sertifikat Download](../../docs/applications/dolly/assets/cert_download.png) - ### Kjøre Redis lokalt Evt last ned colima og kjør diff --git a/apps/dolly-frontend/build.gradle b/apps/dolly-frontend/build.gradle index eac576f67e8..0e3f47ecbd3 100644 --- a/apps/dolly-frontend/build.gradle +++ b/apps/dolly-frontend/build.gradle @@ -17,6 +17,8 @@ configurations { } dependencies { + implementation "io.grpc:grpc-netty:$versions.grpc" + implementation "no.nav.testnav.libs:data-transfer-objects" implementation "no.nav.testnav.libs:reactive-core" implementation "no.nav.testnav.libs:reactive-frontend" @@ -24,7 +26,6 @@ dependencies { implementation "no.nav.testnav.libs:reactive-security" implementation "no.nav.testnav.libs:reactive-session-security" implementation "no.nav.testnav.libs:security-core" - implementation "no.nav.testnav.libs:vault" // Session implementation "redis.clients:jedis:5.1.2" diff --git a/apps/dolly-frontend/settings.gradle b/apps/dolly-frontend/settings.gradle index 43a27cdf7f7..aff0f7d00e4 100644 --- a/apps/dolly-frontend/settings.gradle +++ b/apps/dolly-frontend/settings.gradle @@ -15,7 +15,6 @@ includeBuild '../../libs/reactive-security' includeBuild '../../libs/reactive-session-security' includeBuild '../../libs/security-core' includeBuild '../../libs/security-core' -includeBuild '../../libs/vault' develocity { buildScan { diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java deleted file mode 100644 index 8e2b997adb5..00000000000 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/config/LocalVaultConfig.java +++ /dev/null @@ -1,10 +0,0 @@ -package no.nav.dolly.web.config; - -import no.nav.testnav.libs.vault.AbstractLocalVaultConfiguration; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; - -@Configuration -@Profile("local") -public class LocalVaultConfig extends AbstractLocalVaultConfiguration { -} \ No newline at end of file diff --git a/apps/dolly-frontend/src/main/js/package-lock.json b/apps/dolly-frontend/src/main/js/package-lock.json index 573f54271c3..80940c5d35d 100644 --- a/apps/dolly-frontend/src/main/js/package-lock.json +++ b/apps/dolly-frontend/src/main/js/package-lock.json @@ -1,12 +1,12 @@ { "name": "dolly", - "version": "3.0.46", + "version": "3.0.47", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dolly", - "version": "3.0.46", + "version": "3.0.47", "license": "ISC", "dependencies": { "@grafana/faro-react": "^1.11.0", @@ -3269,9 +3269,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.3.tgz", - "integrity": "sha512-EzxVSkIvCFxUd4Mgm4xR9YXrcp976qVaHnqom/Tgm+vU79k4vV4eYTjmRvGfeoW8m9LVcsAy/lGjcgVegKEhLQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.4.tgz", + "integrity": "sha512-2Y3JT6f5MrQkICUyRVCw4oa0sutfAsgaSsb0Lmmy1Wi2y7X5vT9Euqw4gOsCyy0YfKURBg35nhUKZS4mDcfULw==", "cpu": [ "arm" ], @@ -3283,9 +3283,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.3.tgz", - "integrity": "sha512-LJc5pDf1wjlt9o/Giaw9Ofl+k/vLUaYsE2zeQGH85giX2F+wn/Cg8b3c5CDP3qmVmeO5NzwVUzQQxwZvC2eQKw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.4.tgz", + "integrity": "sha512-wzKRQXISyi9UdCVRqEd0H4cMpzvHYt1f/C3CoIjES6cG++RHKhrBj2+29nPF0IB5kpy9MS71vs07fvrNGAl/iA==", "cpu": [ "arm64" ], @@ -3297,9 +3297,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.3.tgz", - "integrity": "sha512-OuRysZ1Mt7wpWJ+aYKblVbJWtVn3Cy52h8nLuNSzTqSesYw1EuN6wKp5NW/4eSre3mp12gqFRXOKTcN3AI3LqA==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz", + "integrity": "sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==", "cpu": [ "arm64" ], @@ -3311,9 +3311,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.3.tgz", - "integrity": "sha512-xW//zjJMlJs2sOrCmXdB4d0uiilZsOdlGQIC/jjmMWT47lkLLoB1nsNhPUcnoqyi5YR6I4h+FjBpILxbEy8JRg==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.4.tgz", + "integrity": "sha512-o9bH2dbdgBDJaXWJCDTNDYa171ACUdzpxSZt+u/AAeQ20Nk5x+IhA+zsGmrQtpkLiumRJEYef68gcpn2ooXhSQ==", "cpu": [ "x64" ], @@ -3325,9 +3325,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.3.tgz", - "integrity": "sha512-58E0tIcwZ+12nK1WiLzHOD8I0d0kdrY/+o7yFVPRHuVGY3twBwzwDdTIBGRxLmyjciMYl1B/U515GJy+yn46qw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.4.tgz", + "integrity": "sha512-NBI2/i2hT9Q+HySSHTBh52da7isru4aAAo6qC3I7QFVsuhxi2gM8t/EI9EVcILiHLj1vfi+VGGPaLOUENn7pmw==", "cpu": [ "arm64" ], @@ -3339,9 +3339,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.3.tgz", - "integrity": "sha512-78fohrpcVwTLxg1ZzBMlwEimoAJmY6B+5TsyAZ3Vok7YabRBUvjYTsRXPTjGEvv/mfgVBepbW28OlMEz4w8wGA==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.4.tgz", + "integrity": "sha512-wYcC5ycW2zvqtDYrE7deary2P2UFmSh85PUpAx+dwTCO9uw3sgzD6Gv9n5X4vLaQKsrfTSZZ7Z7uynQozPVvWA==", "cpu": [ "x64" ], @@ -3353,9 +3353,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.3.tgz", - "integrity": "sha512-h2Ay79YFXyQi+QZKo3ISZDyKaVD7uUvukEHTOft7kh00WF9mxAaxZsNs3o/eukbeKuH35jBvQqrT61fzKfAB/Q==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.4.tgz", + "integrity": "sha512-9OwUnK/xKw6DyRlgx8UizeqRFOfi9mf5TYCw1uolDaJSbUmBxP85DE6T4ouCMoN6pXw8ZoTeZCSEfSaYo+/s1w==", "cpu": [ "arm" ], @@ -3367,9 +3367,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.3.tgz", - "integrity": "sha512-Sv2GWmrJfRY57urktVLQ0VKZjNZGogVtASAgosDZ1aUB+ykPxSi3X1nWORL5Jk0sTIIwQiPH7iE3BMi9zGWfkg==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.4.tgz", + "integrity": "sha512-Vgdo4fpuphS9V24WOV+KwkCVJ72u7idTgQaBoLRD0UxBAWTF9GWurJO9YD9yh00BzbkhpeXtm6na+MvJU7Z73A==", "cpu": [ "arm" ], @@ -3381,9 +3381,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.3.tgz", - "integrity": "sha512-FPoJBLsPW2bDNWjSrwNuTPUt30VnfM8GPGRoLCYKZpPx0xiIEdFip3dH6CqgoT0RnoGXptaNziM0WlKgBc+OWQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.4.tgz", + "integrity": "sha512-pleyNgyd1kkBkw2kOqlBx+0atfIIkkExOTiifoODo6qKDSpnc6WzUY5RhHdmTdIJXBdSnh6JknnYTtmQyobrVg==", "cpu": [ "arm64" ], @@ -3395,9 +3395,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.3.tgz", - "integrity": "sha512-TKxiOvBorYq4sUpA0JT+Fkh+l+G9DScnG5Dqx7wiiqVMiRSkzTclP35pE6eQQYjP4Gc8yEkJGea6rz4qyWhp3g==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.4.tgz", + "integrity": "sha512-caluiUXvUuVyCHr5DxL8ohaaFFzPGmgmMvwmqAITMpV/Q+tPoaHZ/PWa3t8B2WyoRcIIuu1hkaW5KkeTDNSnMA==", "cpu": [ "arm64" ], @@ -3409,9 +3409,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.3.tgz", - "integrity": "sha512-v2M/mPvVUKVOKITa0oCFksnQQ/TqGrT+yD0184/cWHIu0LoIuYHwox0Pm3ccXEz8cEQDLk6FPKd1CCm+PlsISw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.4.tgz", + "integrity": "sha512-FScrpHrO60hARyHh7s1zHE97u0KlT/RECzCKAdmI+LEoC1eDh/RDji9JgFqyO+wPDb86Oa/sXkily1+oi4FzJQ==", "cpu": [ "ppc64" ], @@ -3423,9 +3423,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.3.tgz", - "integrity": "sha512-LdrI4Yocb1a/tFVkzmOE5WyYRgEBOyEhWYJe4gsDWDiwnjYKjNs7PS6SGlTDB7maOHF4kxevsuNBl2iOcj3b4A==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.4.tgz", + "integrity": "sha512-qyyprhyGb7+RBfMPeww9FlHwKkCXdKHeGgSqmIXw9VSUtvyFZ6WZRtnxgbuz76FK7LyoN8t/eINRbPUcvXB5fw==", "cpu": [ "riscv64" ], @@ -3437,9 +3437,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.3.tgz", - "integrity": "sha512-d4wVu6SXij/jyiwPvI6C4KxdGzuZOvJ6y9VfrcleHTwo68fl8vZC5ZYHsCVPUi4tndCfMlFniWgwonQ5CUpQcA==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.4.tgz", + "integrity": "sha512-PFz+y2kb6tbh7m3A7nA9++eInGcDVZUACulf/KzDtovvdTizHpZaJty7Gp0lFwSQcrnebHOqxF1MaKZd7psVRg==", "cpu": [ "s390x" ], @@ -3451,9 +3451,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.3.tgz", - "integrity": "sha512-/6bn6pp1fsCGEY5n3yajmzZQAh+mW4QPItbiWxs69zskBzJuheb3tNynEjL+mKOsUSFK11X4LYF2BwwXnzWleA==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz", + "integrity": "sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==", "cpu": [ "x64" ], @@ -3465,9 +3465,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.3.tgz", - "integrity": "sha512-nBXOfJds8OzUT1qUreT/en3eyOXd2EH5b0wr2bVB5999qHdGKkzGzIyKYaKj02lXk6wpN71ltLIaQpu58YFBoQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz", + "integrity": "sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==", "cpu": [ "x64" ], @@ -3479,9 +3479,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.3.tgz", - "integrity": "sha512-ogfbEVQgIZOz5WPWXF2HVb6En+kWzScuxJo/WdQTqEgeyGkaa2ui5sQav9Zkr7bnNCLK48uxmmK0TySm22eiuw==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.4.tgz", + "integrity": "sha512-yOpVsA4K5qVwu2CaS3hHxluWIK5HQTjNV4tWjQXluMiiiu4pJj4BN98CvxohNCpcjMeTXk/ZMJBRbgRg8HBB6A==", "cpu": [ "arm64" ], @@ -3493,9 +3493,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.3.tgz", - "integrity": "sha512-ecE36ZBMLINqiTtSNQ1vzWc5pXLQHlf/oqGp/bSbi7iedcjcNb6QbCBNG73Euyy2C+l/fn8qKWEwxr+0SSfs3w==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.4.tgz", + "integrity": "sha512-KtwEJOaHAVJlxV92rNYiG9JQwQAdhBlrjNRp7P9L8Cb4Rer3in+0A+IPhJC9y68WAi9H0sX4AiG2NTsVlmqJeQ==", "cpu": [ "ia32" ], @@ -3507,9 +3507,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.3.tgz", - "integrity": "sha512-vliZLrDmYKyaUoMzEbMTg2JkerfBjn03KmAw9CykO0Zzkzoyd7o3iZNam/TpyWNjNT+Cz2iO3P9Smv2wgrR+Eg==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.4.tgz", + "integrity": "sha512-3j4jx1TppORdTAoBJRd+/wJRGCPC0ETWkXOecJ6PPZLj6SptXkrXcNqdj0oclbKML6FkQltdz7bBA3rUSirZug==", "cpu": [ "x64" ], @@ -3712,9 +3712,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", - "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", + "version": "22.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", + "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", "license": "MIT", "dependencies": { "undici-types": "~6.19.8" @@ -4850,9 +4850,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001683", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001683.tgz", - "integrity": "sha512-iqmNnThZ0n70mNwvxpEC2nBJ037ZHZUoBI5Gorh1Mw6IlEAZujEoU1tXA628iZfzm7R9FvFzxbfdgml82a3k8Q==", + "version": "1.0.30001684", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001684.tgz", + "integrity": "sha512-G1LRwLIQjBQoyq0ZJGqGIJUXzJ8irpbjHLpVRXDvBEScFJ9b17sgK6vlx0GAJFE21okD7zXl08rRRUfq6HdoEQ==", "dev": true, "funding": [ { @@ -6287,9 +6287,9 @@ } }, "node_modules/file-selector": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-2.1.0.tgz", - "integrity": "sha512-ZuXAqGePcSPz4JuerOY06Dzzq0hrmQ6VGoXVzGyFI1npeOfBgqGIKKpznfYWRkSLJlXutkqVC5WvGZtkFVhu9Q==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-2.1.1.tgz", + "integrity": "sha512-pJVY80PuSiHbnYEZ0gZYQf15x0z/lkeIF1yn95yRC/Usb43343ewXtMClQ9GLPvPm4/SscX4zvQz9QhCAyLqlg==", "dev": true, "license": "MIT", "dependencies": { @@ -7253,13 +7253,16 @@ } }, "node_modules/is-finalizationregistry": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", - "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz", + "integrity": "sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8291,9 +8294,9 @@ "license": "MIT" }, "node_modules/msw": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/msw/-/msw-2.6.5.tgz", - "integrity": "sha512-PnlnTpUlOrj441kYQzzFhzMzMCGFT6a2jKUBG7zSpLkYS5oh8Arrbc0dL8/rNAtxaoBy0EVs2mFqj2qdmWK7lQ==", + "version": "2.6.6", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.6.6.tgz", + "integrity": "sha512-npfIIVRHKQX3Lw4aLWX4wBh+lQwpqdZNyJYB5K/+ktK8NhtkdsTxGK7WDrgknozcVyRI7TOqY6yBS9j2FTR+YQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -9763,19 +9766,19 @@ } }, "node_modules/reflect.getprototypeof": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", - "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz", + "integrity": "sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.23.1", + "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.4", - "globalthis": "^1.0.3", - "which-builtin-type": "^1.1.3" + "gopd": "^1.0.1", + "which-builtin-type": "^1.1.4" }, "engines": { "node": ">= 0.4" @@ -9950,9 +9953,9 @@ } }, "node_modules/rollup": { - "version": "4.27.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.3.tgz", - "integrity": "sha512-SLsCOnlmGt9VoZ9Ek8yBK8tAdmPHeppkw+Xa7yDlCEhDTvwYei03JlWo1fdc7YTfLZ4tD8riJCUyAgTbszk1fQ==", + "version": "4.27.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.4.tgz", + "integrity": "sha512-RLKxqHEMjh/RGLsDxAEsaLO3mWgyoU6x9w6n1ikAzet4B3gI2/3yP6PWY2p9QzRTh6MfEIXB3MwsOY0Iv3vNrw==", "dev": true, "license": "MIT", "dependencies": { @@ -9966,24 +9969,24 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.27.3", - "@rollup/rollup-android-arm64": "4.27.3", - "@rollup/rollup-darwin-arm64": "4.27.3", - "@rollup/rollup-darwin-x64": "4.27.3", - "@rollup/rollup-freebsd-arm64": "4.27.3", - "@rollup/rollup-freebsd-x64": "4.27.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.27.3", - "@rollup/rollup-linux-arm-musleabihf": "4.27.3", - "@rollup/rollup-linux-arm64-gnu": "4.27.3", - "@rollup/rollup-linux-arm64-musl": "4.27.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.27.3", - "@rollup/rollup-linux-riscv64-gnu": "4.27.3", - "@rollup/rollup-linux-s390x-gnu": "4.27.3", - "@rollup/rollup-linux-x64-gnu": "4.27.3", - "@rollup/rollup-linux-x64-musl": "4.27.3", - "@rollup/rollup-win32-arm64-msvc": "4.27.3", - "@rollup/rollup-win32-ia32-msvc": "4.27.3", - "@rollup/rollup-win32-x64-msvc": "4.27.3", + "@rollup/rollup-android-arm-eabi": "4.27.4", + "@rollup/rollup-android-arm64": "4.27.4", + "@rollup/rollup-darwin-arm64": "4.27.4", + "@rollup/rollup-darwin-x64": "4.27.4", + "@rollup/rollup-freebsd-arm64": "4.27.4", + "@rollup/rollup-freebsd-x64": "4.27.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.27.4", + "@rollup/rollup-linux-arm-musleabihf": "4.27.4", + "@rollup/rollup-linux-arm64-gnu": "4.27.4", + "@rollup/rollup-linux-arm64-musl": "4.27.4", + "@rollup/rollup-linux-powerpc64le-gnu": "4.27.4", + "@rollup/rollup-linux-riscv64-gnu": "4.27.4", + "@rollup/rollup-linux-s390x-gnu": "4.27.4", + "@rollup/rollup-linux-x64-gnu": "4.27.4", + "@rollup/rollup-linux-x64-musl": "4.27.4", + "@rollup/rollup-win32-arm64-msvc": "4.27.4", + "@rollup/rollup-win32-ia32-msvc": "4.27.4", + "@rollup/rollup-win32-x64-msvc": "4.27.4", "fsevents": "~2.3.2" } }, @@ -10890,22 +10893,22 @@ } }, "node_modules/tldts": { - "version": "6.1.63", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.63.tgz", - "integrity": "sha512-YWwhsjyn9sB/1rOkSRYxvkN/wl5LFM1QDv6F2pVR+pb/jFne4EOBxHfkKVWvDIBEAw9iGOwwubHtQTm0WRT5sQ==", + "version": "6.1.64", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.64.tgz", + "integrity": "sha512-ph4AE5BXWIOsSy9stpoeo7bYe/Cy7VfpciIH4RhVZUPItCJmhqWCN0EVzxd8BOHiyNb42vuJc6NWTjJkg91Tuw==", "dev": true, "license": "MIT", "dependencies": { - "tldts-core": "^6.1.63" + "tldts-core": "^6.1.64" }, "bin": { "tldts": "bin/cli.js" } }, "node_modules/tldts-core": { - "version": "6.1.63", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.63.tgz", - "integrity": "sha512-H1XCt54xY+QPbwhTgmxLkepX0MVHu3USfMmejiCOdkMbRcP22Pn2FVF127r/GWXVDmXTRezyF3Ckvhn4Fs6j7Q==", + "version": "6.1.64", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.64.tgz", + "integrity": "sha512-uqnl8vGV16KsyflHOzqrYjjArjfXaU6rMPXYy2/ZWoRKCkXtghgB4VwTDXUG+t0OTGeSewNAG31/x1gCTfLt+Q==", "dev": true, "license": "MIT" }, @@ -10971,9 +10974,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz", - "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.1.tgz", + "integrity": "sha512-5RU2/lxTA3YUZxju61HO2U6EoZLvBLtmV2mbTvqyu4a/7s7RmJPT+1YekhMVsQhznRWk/czIwDUg+V8Q9ZuG4w==", "dev": true, "license": "MIT", "engines": { @@ -11074,9 +11077,9 @@ } }, "node_modules/type-fest": { - "version": "4.27.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.27.0.tgz", - "integrity": "sha512-3IMSWgP7C5KSQqmo1wjhKrwsvXAtF33jO3QY+Uy++ia7hqvgSK6iXbbg5PbDBc1P2ZbNEDgejOrN4YooXvhwCw==", + "version": "4.28.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.28.0.tgz", + "integrity": "sha512-jXMwges/FVbFRe5lTMJZVEZCrO9kI9c8k0PA/z7nF3bo0JSCCLysvokFjNPIUK/itEMas10MQM+AiHoHt/T/XA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -11144,18 +11147,18 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", - "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-proto": "^1.0.3", "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" }, "engines": { "node": ">= 0.4" @@ -11165,9 +11168,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", "bin": { @@ -11689,17 +11692,18 @@ } }, "node_modules/which-builtin-type": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.4.tgz", - "integrity": "sha512-bppkmBSsHFmIMSl8BO9TbsyzsvGjVoppt8xUiGzwiu/bhDCGxnpOKCxgqj6GuyHE0mINMDecBFPlOm2hzY084w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.0.tgz", + "integrity": "sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA==", "dev": true, "license": "MIT", "dependencies": { + "call-bind": "^1.0.7", "function.prototype.name": "^1.1.6", "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", "is-date-object": "^1.0.5", - "is-finalizationregistry": "^1.0.2", + "is-finalizationregistry": "^1.1.0", "is-generator-function": "^1.0.10", "is-regex": "^1.1.4", "is-weakref": "^1.0.2", diff --git a/apps/dolly-frontend/src/main/js/package.json b/apps/dolly-frontend/src/main/js/package.json index 41ca4f91f38..846ac1e1cc0 100644 --- a/apps/dolly-frontend/src/main/js/package.json +++ b/apps/dolly-frontend/src/main/js/package.json @@ -1,6 +1,6 @@ { "name": "dolly", - "version": "3.0.46", + "version": "3.0.47", "type": "module", "description": "", "main": "index.js", diff --git a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/StegVelger.tsx b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/StegVelger.tsx index 5454eb33afd..9adb83942f8 100644 --- a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/StegVelger.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/StegVelger.tsx @@ -47,13 +47,15 @@ export const StegVelger = ({ initialValues, onSubmit }) => { const mutate = useMatchMutate() + const validationPaths = Object.keys(DollyValidation?.fields) + const isLastStep = () => step === STEPS.length - 1 const handleNext = () => { - formMethods.trigger().then((valid) => { + formMethods.trigger(validationPaths).then(() => { const errorFelter = Object.keys(formMethods.formState.errors) const kunEnvironmentError = errorFelter.length === 1 && errorFelter[0] === 'environments' const kunGruppeIdError = errorFelter.length === 1 && errorFelter[0] === 'gruppeId' - if (!valid && step === 1 && !kunEnvironmentError && !kunGruppeIdError) { + if (errorFelter.length > 0 && step === 1 && !kunEnvironmentError && !kunGruppeIdError) { console.warn('Feil i form, stopper navigering videre') console.error(formMethods.formState.errors) errorContext?.setShowError(true) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdToggle.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdToggle.tsx index df1df4f056e..7e1e8648c4a 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdToggle.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdToggle.tsx @@ -23,17 +23,21 @@ const ToggleArbeidsgiver = styled(ToggleGroup)` const DisabledToggleArbeidsgiver = styled(ToggleGroup)` display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + :hover { background-color: white; cursor: default; } + &&& { button { color: #aab0ba; } + .navds-toggle-group__button[aria-checked='true'] { background-color: #aab0ba; color: white; + :hover { background-color: #aab0ba; cursor: default; @@ -119,7 +123,7 @@ export const ArbeidsforholdToggle = ({ ) .filter((arbeidsforhold: any) => !_.isEmpty(arbeidsforhold)) if (!_.isEmpty(dupliserteAktiveArbeidsforhold)) { - formMethods.setError(`${path}.arbeidsgiver.orgnummer`, { + formMethods.setError(`manual.${path}.arbeidsgiver.orgnummer`, { message: `Identen har allerede pågående arbeidsforhold i org: ${dupliserteAktiveArbeidsforhold.toString()}`, }) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsgiverIdent.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsgiverIdent.tsx index 4abda6260cc..8bee26dad1d 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsgiverIdent.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsgiverIdent.tsx @@ -27,10 +27,11 @@ export const ArbeidsgiverIdent = ({ if (result?.identNavigerTil) { formMethods.setValue(path, personnummer, { shouldTouch: true }) formMethods.trigger(path) + formMethods.clearErrors(`manual.${path}`) formMethods.clearErrors(path) setSuccess(true) } else { - formMethods.setError(path, { message: 'Fant ikke arbeidsgiver-ident' }) + formMethods.setError(`manual.${path}`, { message: 'Fant ikke arbeidsgiver-ident' }) } } }, [result, errorNaviger]) @@ -39,6 +40,7 @@ export const ArbeidsgiverIdent = ({ setSuccess(false) const personnr = event.target.value formMethods.setValue(path, '123', { shouldTouch: true }) + formMethods.clearErrors(`manual.${path}`) formMethods.trigger(path) setPersonnummer(personnr) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/alderspensjon/form/Form.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/alderspensjon/form/Form.tsx index bfb3918d36c..51dd5055471 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/alderspensjon/form/Form.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/alderspensjon/form/Form.tsx @@ -159,7 +159,13 @@ export const AlderspensjonForm = () => { const gjeldendeAdresse = adresseUtenTilDato || _get(formMethods.getValues(), 'pdldata.person.bostedsadresse')?.reduce((prev, curr) => { - if (!prev.gyldigTilOgMed || !curr.gyldigTilOgMed) return null + if ( + !prev.gyldigTilOgMed || + !curr.gyldigTilOgMed || + curr.gyldigTilOgMed?.isValid?.() === false || + prev.gyldigTilOgMed?.isValid?.() === false + ) + return null return isAfter(parseISO(prev.gyldigTilOgMed), parseISO(curr.gyldigTilOgMed)) ? prev : curr }) return !gjeldendeAdresse || !gjeldendeAdresse?.adressetype diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/inntektstub/form/partials/virksomhetToggle.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/inntektstub/form/partials/virksomhetToggle.tsx index f86a8ad4db4..2de8288db7e 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/inntektstub/form/partials/virksomhetToggle.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/inntektstub/form/partials/virksomhetToggle.tsx @@ -72,6 +72,7 @@ export const VirksomhetToggle = ({ path }: ArbeidsforholdToggleProps) => { setTypeArbeidsgiver(value) formMethods.setValue(virksomhetPath, '') formMethods.setValue(opplysningspliktigPath, '') + formMethods.clearErrors(`manual.${path}`) formMethods.clearErrors(path) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/GenerertInntektForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/GenerertInntektForm.tsx index b2e24847831..e036e62a877 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/GenerertInntektForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/GenerertInntektForm.tsx @@ -36,18 +36,19 @@ export const GenerertInntektForm = ({ gyldigFraOgMedAar, formMethods }) => { ) const handleGenerer = () => { - formMethods.clearErrors(pensjonGenererPath) + formMethods.clearErrors(`manual.${pensjonGenererPath}`) + formMethods.clearErrors(`${pensjonGenererPath}`) trigger(pensjonGenererPath) .then((values) => { if (!values) { - formMethods.setError(`${pensjonGenererPath}.generer.tomAar`, { + formMethods.setError(`manual.${pensjonGenererPath}.generer.tomAar`, { message: 'Velg et gyldig år', }) } formMethods.setValue(`${pensjonGenererPath}.inntekter`, values?.data?.arInntektGList) }) .catch(() => { - formMethods.setError(`${pensjonGenererPath}.generer.tomAar`, { + formMethods.setError(`manual.${pensjonGenererPath}.generer.tomAar`, { message: 'Velg et gyldig år', }) }) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/sigrunstubPensjonsgivende/form/PensjonsgivendeInntektForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/sigrunstubPensjonsgivende/form/PensjonsgivendeInntektForm.tsx index 93db703bbc6..fc86b544780 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/sigrunstubPensjonsgivende/form/PensjonsgivendeInntektForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/sigrunstubPensjonsgivende/form/PensjonsgivendeInntektForm.tsx @@ -61,7 +61,9 @@ const createInntektForm = (kodeverk, skatteordning, path, formMethods) => { export const PensjonsgivendeInntektForm = ({ path, formMethods, kodeverk, skatteordning }) => { const newEntry = getInitialInntekt(kodeverk, skatteordning) - const inntektError = _.get(formMethods.formState.errors, path)?.message + const inntektError = + _.get(formMethods.formState.errors, path)?.message || + _.get(formMethods.formState.errors, `manual${path}`)?.message return ( { - return ( - !sykemeldingData || - sykemeldingData?.length < 1 || - sykemeldingData?.every((miljoData) => !miljoData.data) - ) + return ( + !sykemeldingData || + sykemeldingData?.length < 1 || + sykemeldingData?.every((miljoData) => !miljoData.data) + ) } export const sjekkManglerSykemeldingBestilling = (sykemeldingBestilling) => { - return !sykemeldingBestilling || sykemeldingBestilling?.length < 1 + return !sykemeldingBestilling || sykemeldingBestilling?.length < 1 } -const VisningAvBestilling = ({ bestillinger }) => { - if (!bestillinger) { - return null - } - - return bestillinger?.map((bestilling: SykemeldingSynt | SykemeldingDetaljert, idx: number) => { - if (!bestilling.erGjenopprettet) { - const syntSykemelding = _.get(bestilling, 'data.sykemelding.syntSykemelding') - const detaljertSykemelding = _.get(bestilling, 'data.sykemelding.detaljertSykemelding') - - return syntSykemelding ? ( - - ) : detaljertSykemelding ? ( - - ) : null - } - }) +const VisningAvBestilling = ({bestillinger}) => { + if (!bestillinger) { + return null + } + + return bestillinger?.map((bestilling: SykemeldingSynt | SykemeldingDetaljert, idx: number) => { + if (!bestilling.erGjenopprettet) { + const syntSykemelding = _.get(bestilling, 'data.sykemelding.syntSykemelding') + const detaljertSykemelding = _.get(bestilling, 'data.sykemelding.detaljertSykemelding') + + return syntSykemelding ? ( + + ) : detaljertSykemelding ? ( + + ) : null + } + }) } -const VisningAvTransaksjonsId = ({ data }) => { - if (!data) { - return null - } - - const syntSykemelding = _.get(data, 'syntSykemeldingRequest') - const detaljertSykemelding = _.get(data, 'detaljertSykemeldingRequest') - - return syntSykemelding ? ( - - ) : detaljertSykemelding ? ( - - ) : null +const VisningAvTransaksjonsId = ({data}) => { + if (!data) { + return null + } + + const syntSykemelding = _.get(data, 'syntSykemeldingRequest') + const detaljertSykemelding = _.get(data, 'detaljertSykemeldingRequest') + const sykemeldingId = _.get(data, 'sykemeldingId') + + if (syntSykemelding) { + syntSykemelding['sykemeldingId'] = sykemeldingId + return + } + if (detaljertSykemelding) { + detaljertSykemelding['sykemeldingId'] = sykemeldingId + return < DetaljertSykemelding sykemelding={detaljertSykemelding}/> + } } export const SykemeldingVisning = ({ - data, - loading, - bestillingIdListe, - tilgjengeligMiljoe, - bestillinger, -}: Sykemelding) => { - const { bestilteMiljoer } = useBestilteMiljoer(bestillingIdListe, 'SYKEMELDING') - - if (loading) { - return - } - - if (!data && !bestillinger) { - return null - } - - const manglerFagsystemData = - sjekkManglerSykemeldingData(data) && sjekkManglerSykemeldingBestilling(bestillinger) - - const miljoerMedData = data?.map((miljoData) => miljoData.data && miljoData.miljo) - const errorMiljoer = bestilteMiljoer?.filter((miljo) => !miljoerMedData?.includes(miljo)) - - const forsteMiljo = data?.find((miljoData) => miljoData?.data)?.miljo - - const filteredData = - tilgjengeligMiljoe && data?.filter((item) => tilgjengeligMiljoe.includes(item.miljo)) - - return ( -
- - {manglerFagsystemData ? ( - - Fant ikke sykemelding-data på person - - ) : sjekkManglerSykemeldingData(data) ? ( - - ) : ( - - - - )} -
- ) + data, + loading, + bestillingIdListe, + tilgjengeligMiljoe, + bestillinger, + }: Sykemelding) => { + const {bestilteMiljoer} = useBestilteMiljoer(bestillingIdListe, 'SYKEMELDING') + + if (loading) { + return + } + + if (!data && !bestillinger) { + return null + } + + const manglerFagsystemData = + sjekkManglerSykemeldingData(data) && sjekkManglerSykemeldingBestilling(bestillinger) + + const miljoerMedData = data?.map((miljoData) => miljoData.data && miljoData.miljo) + const errorMiljoer = bestilteMiljoer?.filter((miljo) => !miljoerMedData?.includes(miljo)) + + const forsteMiljo = data?.find((miljoData) => miljoData?.data)?.miljo + + const filteredData = + tilgjengeligMiljoe && data?.filter((item) => tilgjengeligMiljoe.includes(item.miljo)) + + return ( +
+ + {manglerFagsystemData ? ( + + Fant ikke sykemelding-data på person + + ) : sjekkManglerSykemeldingData(data) ? ( + + ) : ( + + + + )} +
+ ) } SykemeldingVisning.filterValues = (bestillinger: Array, ident: string) => { - if (!bestillinger) { - return null - } - - return bestillinger.filter( - (bestilling: any) => - bestilling.data?.sykemelding && erGyldig(bestilling.id, 'SYKEMELDING', ident), - ) + if (!bestillinger) { + return null + } + + return bestillinger.filter( + (bestilling: any) => + bestilling.data?.sykemelding && erGyldig(bestilling.id, 'SYKEMELDING', ident), + ) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/DetaljertSykemelding.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/DetaljertSykemelding.tsx index 68b98a77b40..4fe1c7172eb 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/DetaljertSykemelding.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/DetaljertSykemelding.tsx @@ -1,100 +1,119 @@ import * as React from 'react' -import { formatStringDates, oversettBoolean } from '@/utils/DataFormatter' -import { TitleValue } from '@/components/ui/titleValue/TitleValue' -import { Bidiagnoser } from './Bidiagnoser' -import { Perioder } from './Perioder' -import { ArbeidKodeverk } from '@/config/kodeverk' -import { SykemeldingDetaljert } from '@/components/fagsystem/sykdom/SykemeldingTypes' +import {formatStringDates, oversettBoolean} from '@/utils/DataFormatter' +import {TitleValue} from '@/components/ui/titleValue/TitleValue' +import {Bidiagnoser} from './Bidiagnoser' +import {Perioder} from './Perioder' +import {ArbeidKodeverk} from '@/config/kodeverk' +import { + SykemeldingDetaljert +} from '@/components/fagsystem/sykdom/SykemeldingTypes' import styled from 'styled-components' export const SykemeldingKategori = styled.div` - width: 100%; - h4 { - margin-top: 5px; - margin-bottom: 15px; - } + width: 100%; + + h4 { + margin-top: 5px; + margin-bottom: 15px; + } ` -export const DetaljertSykemelding = ({ sykemelding, idx }: SykemeldingDetaljert) => { - return ( -
- -
- - - -
- <> - -

Diagnose

-
-
- - -
- - - <> - -

Helsepersonell

-
-
- - - - -
- - <> - -

Arbeidsgiver

-
-
- - - -
- - - <> - -

Detaljer

-
-
- - - - -
- -
-
- ) +export const DetaljertSykemelding = ({ + sykemelding, + idx + }: SykemeldingDetaljert) => { + console.log('sykemelding', sykemelding) + return ( +
+ +
+ + + +
+ <> + +

Diagnose

+
+
+ + +
+ + + <> + +

Helsepersonell

+
+
+ + + + +
+ + <> + +

Arbeidsgiver

+
+
+ + + +
+ + + <> + +

Detaljer

+
+
+ + + + + +
+ +
+
+ ) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/SyntSykemelding.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/SyntSykemelding.tsx index f67334cee4c..2c19e33f8b8 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/SyntSykemelding.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/sykdom/visning/partials/SyntSykemelding.tsx @@ -8,5 +8,9 @@ export const SyntSykemelding = ({ sykemelding, idx }: SykemeldingSynt) => ( + ) diff --git a/apps/dolly-frontend/src/main/js/src/components/inntektStub/validerInntekt/index.tsx b/apps/dolly-frontend/src/main/js/src/components/inntektStub/validerInntekt/index.tsx index b706fddff0f..e53826e7653 100644 --- a/apps/dolly-frontend/src/main/js/src/components/inntektStub/validerInntekt/index.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/inntektStub/validerInntekt/index.tsx @@ -96,6 +96,7 @@ const InntektStub = ({ inntektPath }) => { formMethods.getValues(`${inntektPath}.${name}`) !== undefined ) { formMethods.setValue(`${inntektPath}.${name}`, undefined) + formMethods.clearErrors(`manual.${inntektPath}.${name}`) formMethods.clearErrors(`${inntektPath}.${name}`) } } @@ -107,6 +108,7 @@ const InntektStub = ({ inntektPath }) => { if (isObjectEmptyDeep(tilleggsinformasjon)) { formMethods.setValue(`${inntektPath}.tilleggsinformasjon`, undefined) + formMethods.clearErrors(`manual.${inntektPath}.tilleggsinformasjon`) formMethods.clearErrors(`${inntektPath}.tilleggsinformasjon`) } } diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx index d91b1881cff..be2062d8add 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/datepicker/Datepicker.tsx @@ -17,55 +17,51 @@ import { convertInputToDate } from '@/components/ui/form/DateFormatUtils' registerLocale('nb', locale_nb) export const DollyDatepicker = (props: any) => { - const format = props.format || 'DD.MM.YYYY' + const { + excludeDates, + disabled, + onChange, + minDate = subYears(new Date(), 125), + name, + label, + maxDate = addYears(new Date(), 5), + format, + } = props + const dateFormat = format || 'DD.MM.YYYY' const formMethods = useFormContext() - const existingValue = formMethods.watch(props.name) + const existingValue = formMethods.watch(name) const [showDatepicker, setShowDatepicker] = useState(false) - const [input, setInput] = useState(existingValue ? formatDate(existingValue, format) : '') - const [errorMessage, setErrorMessage] = useState('') + const [input, setInput] = useState(existingValue ? formatDate(existingValue, dateFormat) : '') const getDatepickerProps = useCallback(() => { return useDatepicker({ - fromDate: props.minDate || subYears(new Date(), 125), - toDate: props.maxDate || addYears(new Date(), 5), - disabled: props.excludeDates, + fromDate: minDate, + toDate: maxDate, + disabled: excludeDates, }) - }, [props.minDate, props.maxDate, props.excludeDates, input]) + }, [minDate, maxDate, excludeDates, input]) const { datepickerProps, setSelected } = getDatepickerProps() useEffect(() => { const date = convertInputToDate(existingValue) - setInput(date?.isValid?.() ? formatDate(date, format) : existingValue) - formMethods.trigger(props.name).then(() => { + setInput(date?.isValid?.() ? formatDate(date, dateFormat) : existingValue) + formMethods.trigger(`manual.${name}`).then(() => { validateDate(date) }) }, []) - useEffect(() => { - if (errorMessage) { - formMethods.setError(props.name, { - type: 'invalid-date', - message: errorMessage, - }) - } else { - formMethods.clearErrors(props.name) - } - }, [errorMessage]) - const validateDate = (date) => { - if (!date || date.isValid?.()) { - setErrorMessage(null) - formMethods.clearErrors(props.name) - } else if (date.isAfter?.(props.maxDate) || date.isBefore?.(props.minDate)) { - setErrorMessage('Dato utenfor gyldig periode') - formMethods.setError(props.name, { + if (date?.isAfter?.(maxDate) || date?.isBefore?.(minDate)) { + formMethods.setError(`manual.${name}`, { type: 'invalid-date', message: 'Dato utenfor gyldig periode', }) + } else if (!date || date.isValid?.()) { + formMethods.clearErrors(`manual.${name}`) + formMethods.clearErrors(name) } else { - setErrorMessage('Ugyldig dato-format') - formMethods.setError(props.name, { + formMethods.setError(`manual.${name}`, { type: 'invalid-date-format', message: 'Ugyldig dato-format', }) @@ -74,12 +70,12 @@ export const DollyDatepicker = (props: any) => { const setFormDate = (date) => { const formDate = date.isValid?.() ? date.toDate() : date - props.onChange?.(formDate) + onChange?.(formDate) const dateStr = formDate?.toISOString?.().substring?.(0, 19) - formMethods.setValue(props.name, dateStr || date, { + formMethods.setValue(name, dateStr || date, { shouldTouch: true, }) - formMethods.trigger(props.name).then(() => { + formMethods.trigger(`manual.${name}`).then(() => { validateDate(date) }) } @@ -94,7 +90,8 @@ export const DollyDatepicker = (props: any) => { } setFormDate(date) - setInput(formatDate(date, format)) + setInput(formatDate(date, dateFormat)) + validateDate(date) } const DateInput = ( @@ -108,11 +105,11 @@ export const DollyDatepicker = (props: any) => { setInput(value) }} onBlur={handleInputBlur} - isDisabled={props.disabled} + isDisabled={disabled} input={input} icon={'calendar'} datepickerOnclick={() => { - if (!props.disabled) { + if (!disabled) { setShowDatepicker((prev) => !prev) } }} @@ -121,7 +118,7 @@ export const DollyDatepicker = (props: any) => { return ( -