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 f0ef428e58d..6af8668f777 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/aareg/AaregClient.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java index 9333c6fe6b2..dedf69d338d 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java @@ -88,6 +88,12 @@ public Flux gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly return Flux.empty(); } + @Override + public void release(List identer) { + + // Sletting av arbeidsforhold er pt ikke støttet + } + private ClientFuture futurePersist(BestillingProgress progress, String status) { return () -> { @@ -97,12 +103,6 @@ private ClientFuture futurePersist(BestillingProgress progress, String status) { }; } - @Override - public void release(List identer) { - - // Sletting av arbeidsforhold er pt ikke støttet - } - private Mono sendArbeidsforhold(RsDollyUtvidetBestilling bestilling, DollyPerson dollyPerson, Set miljoer, boolean isOpprettEndre) { diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java index ea4f68fb40a..13b414a9952 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/PensjonforvalterClient.java @@ -13,6 +13,7 @@ import no.nav.dolly.bestilling.pensjonforvalter.domain.AlderspensjonSoknadRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.AlderspensjonVedtakRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPersonRequest; +import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppGenerertInntektRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppInntektRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonSamboerRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonSamboerResponse; @@ -155,6 +156,10 @@ public Flux gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly dollyPerson.getIdent(), bestilteMiljoer.get()) .map(response -> POPP_INNTEKTSREGISTER + decodeStatus(response, dollyPerson.getIdent())), + lagreGenerertInntekt(pensjon, + dollyPerson.getIdent(), bestilteMiljoer.get()) + .map(response -> POPP_INNTEKTSREGISTER + decodeStatus(response, dollyPerson.getIdent())), + lagreTpForhold(pensjon, dollyPerson.getIdent(), bestilteMiljoer.get()) .map(response -> TP_FORHOLD + decodeStatus(response, dollyPerson.getIdent())), @@ -464,6 +469,22 @@ private Flux lagreInntekt(PensjonData pensjonData, Str })); } + private Flux lagreGenerertInntekt(PensjonData pensjonData, String ident, + Set miljoer) { + + return Flux.just(pensjonData) + .filter(PensjonData::hasGenerertInntekt) + .map(PensjonData::getGenerertInntekt) + .flatMap(generertInntekt -> Flux.fromIterable(miljoer) + .flatMap(miljoe -> { + + var request = mapperFacade.map(generertInntekt, PensjonPoppGenerertInntektRequest.class); + request.setFnr(ident); + request.setMiljoer(List.of(miljoe)); + return pensjonforvalterConsumer.lagreGenererteInntekter(request); + })); + } + private Mono lagreTpForhold(PensjonData pensjonData, String ident, Set miljoer) { 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 d2f8fbfca78..459dd8ad21c 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 @@ -7,6 +7,7 @@ import no.nav.dolly.bestilling.pensjonforvalter.command.HentMiljoerCommand; import no.nav.dolly.bestilling.pensjonforvalter.command.HentSamboerCommand; import no.nav.dolly.bestilling.pensjonforvalter.command.LagreAlderspensjonCommand; +import no.nav.dolly.bestilling.pensjonforvalter.command.LagreGenerertPoppInntektCommand; import no.nav.dolly.bestilling.pensjonforvalter.command.LagrePensjonsavtaleCommand; import no.nav.dolly.bestilling.pensjonforvalter.command.LagrePoppInntektCommand; import no.nav.dolly.bestilling.pensjonforvalter.command.LagreSamboerCommand; @@ -18,6 +19,7 @@ import no.nav.dolly.bestilling.pensjonforvalter.command.SletteTpForholdCommand; import no.nav.dolly.bestilling.pensjonforvalter.domain.AlderspensjonRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPersonRequest; +import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppGenerertInntektRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppInntektRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonSamboerRequest; import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonSamboerResponse; @@ -77,6 +79,14 @@ public Flux lagreInntekter(PensjonPoppInntektRequest p pensjonPoppInntektRequest).call()); } + @Timed(name = "providers", tags = { "operation", "popp_lagreGenerertInntekt" }) + public Flux lagreGenererteInntekter(PensjonPoppGenerertInntektRequest pensjonPoppGenerertInntektRequest) { + + return tokenService.exchange(serverProperties) + .flatMapMany(token -> new LagreGenerertPoppInntektCommand(webClient, token.getTokenValue(), + pensjonPoppGenerertInntektRequest).call()); + } + @Timed(name = "providers", tags = { "operation", "pen_opprettPerson" }) public Flux opprettPerson(PensjonPersonRequest pensjonPersonRequest, Set miljoer) { diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreGenerertPoppInntektCommand.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreGenerertPoppInntektCommand.java new file mode 100644 index 00000000000..b51f514dca0 --- /dev/null +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/command/LagreGenerertPoppInntektCommand.java @@ -0,0 +1,73 @@ +package no.nav.dolly.bestilling.pensjonforvalter.command; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppGenerertInntektRequest; +import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonforvalterResponse; +import no.nav.testnav.libs.reactivecore.utils.WebClientFilter; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.netty.http.client.HttpClientRequest; +import reactor.util.retry.Retry; + +import java.time.Duration; +import java.util.concurrent.Callable; + +import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER; +import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID; +import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID; +import static no.nav.dolly.util.CallIdUtil.generateCallId; +import static no.nav.dolly.util.RequestTimeout.REQUEST_DURATION; +import static org.springframework.http.HttpHeaders.AUTHORIZATION; + +@Slf4j +@RequiredArgsConstructor +public class LagreGenerertPoppInntektCommand implements Callable> { + + private static final String POPP_INNTEKTSKJEMA_URL = "/api/v1/inntektskjema"; + + private final WebClient webClient; + private final String token; + private final PensjonPoppGenerertInntektRequest pensjonPoppGenerertInntektRequest; + + public Flux call() { + + var callId = generateCallId(); + log.info("Popp lagre generert inntekt {}, callId: {}", pensjonPoppGenerertInntektRequest, callId); + return webClient + .post() + .uri(uriBuilder -> uriBuilder + .path(POPP_INNTEKTSKJEMA_URL) + .build()) + .httpRequest(httpRequest -> { + HttpClientRequest reactorRequest = httpRequest.getNativeRequest(); + reactorRequest.responseTimeout(Duration.ofSeconds(REQUEST_DURATION)); + }) + .header(AUTHORIZATION, "Bearer " + token) + .header(HEADER_NAV_CALL_ID, callId) + .header(HEADER_NAV_CONSUMER_ID, CONSUMER) + .bodyValue(pensjonPoppGenerertInntektRequest) + .retrieve() + .bodyToFlux(PensjonforvalterResponse.class) + .doOnError(WebClientFilter::logErrorMessage) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(5)) + .filter(WebClientFilter::is5xxException)) + .onErrorResume(error -> + Mono.just(PensjonforvalterResponse.builder() + .status(pensjonPoppGenerertInntektRequest.getMiljoer().stream() + .map(miljoe -> PensjonforvalterResponse.ResponseEnvironment.builder() + .miljo(miljoe) + .response(PensjonforvalterResponse.Response.builder() + .httpStatus(PensjonforvalterResponse.HttpStatus.builder() + .status(WebClientFilter.getStatus(error).value()) + .reasonPhrase(WebClientFilter.getStatus(error).getReasonPhrase()) + .build()) + .message(WebClientFilter.getMessage(error)) + .path(POPP_INNTEKTSKJEMA_URL) + .build()) + .build()) + .toList()) + .build())); + } +} \ No newline at end of file diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/domain/PensjonPoppGenerertInntektRequest.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/domain/PensjonPoppGenerertInntektRequest.java new file mode 100644 index 00000000000..71e17eef3a3 --- /dev/null +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/domain/PensjonPoppGenerertInntektRequest.java @@ -0,0 +1,41 @@ +package no.nav.dolly.bestilling.pensjonforvalter.domain; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.ArrayList; +import java.util.List; + +import static java.util.Objects.isNull; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PensjonPoppGenerertInntektRequest { + + private String fnr; + private List inntekter; + private List miljoer; + + public List getMiljoer() { + + if (isNull(miljoer)) { + miljoer = new ArrayList<>(); + } + return miljoer; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class PoppGenerertInntektRequest { + + private Integer aar; + private Integer inntekt; + + } +} diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonGenerertInntektMappingStrategy.java b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonGenerertInntektMappingStrategy.java new file mode 100644 index 00000000000..a4d914c3e6c --- /dev/null +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/pensjonforvalter/mapper/PensjonGenerertInntektMappingStrategy.java @@ -0,0 +1,33 @@ +package no.nav.dolly.bestilling.pensjonforvalter.mapper; + +import ma.glasnost.orika.CustomMapper; +import ma.glasnost.orika.MapperFactory; +import ma.glasnost.orika.MappingContext; +import no.nav.dolly.bestilling.pensjonforvalter.domain.PensjonPoppGenerertInntektRequest; +import no.nav.dolly.domain.resultset.pensjon.PensjonData; +import no.nav.dolly.mapper.MappingStrategy; +import org.springframework.stereotype.Component; + +@Component +public class PensjonGenerertInntektMappingStrategy implements MappingStrategy { + + @Override + public void register(MapperFactory factory) { + + factory.classMap(PensjonData.PoppGenerertInntektWrapper.class, PensjonPoppGenerertInntektRequest.class) + .customize(new CustomMapper<>() { + @Override + public void mapAtoB(PensjonData.PoppGenerertInntektWrapper generertInntektWrapper, PensjonPoppGenerertInntektRequest request, MappingContext context) { + + request.setInntekter(generertInntektWrapper.getInntekter().stream().map(inntekt -> + PensjonPoppGenerertInntektRequest.PoppGenerertInntektRequest.builder() + .aar(inntekt.getAr()) + .inntekt(inntekt.getInntekt()) + .build()).toList()); + } + }) + .byDefault() + .register(); + + } +} diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/pensjon/PensjonData.java b/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/pensjon/PensjonData.java index 836e548a9b7..b220ba9d117 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/pensjon/PensjonData.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/domain/resultset/pensjon/PensjonData.java @@ -28,6 +28,9 @@ public class PensjonData { @Schema(description = "Inntekt i pensjonsopptjeningsregister (POPP)") private PoppInntekt inntekt; + @Schema(description = "Generert inntekt i pensjonsopptjeningsregister (POPP)") + private PoppGenerertInntektWrapper generertInntekt; + @Schema(description = "Data for tjenestepensjon (TP)") private List tp; @@ -45,6 +48,10 @@ public boolean hasInntekt() { return nonNull(inntekt); } + public boolean hasGenerertInntekt() { + return nonNull(generertInntekt); + } + @JsonIgnore public boolean hasTp() { return !getTp().isEmpty(); @@ -91,6 +98,12 @@ public enum TpYtelseType { UKJENT } + public enum UforeType {UNGUFOR, GIFT, ENSLIG} + + public enum BarnetilleggType {FELLESBARN, SAERKULLSBARN} + + public enum InntektType {ARBEIDSINNTEKT, NAERINGSINNTEKT, PENSJON_FRA_UTLANDET, UTENLANDS_INNTEKT, ANDRE_PENSJONER_OG_YTELSER} + @Data @Builder @NoArgsConstructor @@ -110,6 +123,67 @@ public static class PoppInntekt { private Boolean redusertMedGrunnbelop; } + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class PoppGenerertInntektWrapper { + + @Schema(description = "Verdier brukt til generering av inntekt") + private PoppGenerer generer; + + @Schema(description = "Genererte verdier for POPP inntekt") + private List inntekter; + + public List getInntekter() { + if (inntekter == null) { + inntekter = new ArrayList<>(); + } + return inntekter; + } + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class PoppGenerer { + + @Schema(description = "Fra og med år YYYY") + private Integer fomAar; + + @Schema(description = "Til og med år YYYY") + private Integer tomAar; + + @Schema(description = "Gjennomsnittlig grunnbeløp (G) per år") + private Float averageG; + + @Schema(description = "Gjennomsnittlig grunnbeløp (G) kan genereres til verdi under 1G") + private Boolean tillatInntektUnder1G; + } + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class PoppGenerertInntekt { + + @Schema(description = "Gjeldende år") + private Integer ar; + + @Schema(description = "Inntekt i hele kroner for året") + private Integer inntekt; + + @Schema(description = "Generert G-verdi for året") + private Float generatedG; + + @Schema(description = "Grunnbeløp for året") + private Boolean grunnbelop; + } + @Data @Builder @NoArgsConstructor @@ -288,10 +362,4 @@ public static class ForventetInntekt { private InntektType inntektType; private Integer belop; } - - public enum UforeType {UNGUFOR, GIFT, ENSLIG} - - public enum BarnetilleggType {FELLESBARN, SAERKULLSBARN} - - public enum InntektType {ARBEIDSINNTEKT, NAERINGSINNTEKT, PENSJON_FRA_UTLANDET, UTENLANDS_INNTEKT, ANDRE_PENSJONER_OG_YTELSER} } diff --git a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/DollyFrontendApplicationStarter.java b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/DollyFrontendApplicationStarter.java index 7f80ee3ec21..ad4d701c33f 100644 --- a/apps/dolly-frontend/src/main/java/no/nav/dolly/web/DollyFrontendApplicationStarter.java +++ b/apps/dolly-frontend/src/main/java/no/nav/dolly/web/DollyFrontendApplicationStarter.java @@ -134,4 +134,4 @@ private Function> createRoute(String segment, St .filters(filter, addUserJwtHeaderFilter()) ).uri(host); } -} \ 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 2ed2aee847d..05805c1532d 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.21", + "version": "3.0.23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dolly", - "version": "3.0.21", + "version": "3.0.23", "license": "ISC", "dependencies": { "@grafana/faro-react": "^1.1.2", @@ -14,7 +14,7 @@ "@navikt/ds-css-internal": "^3.4.3", "@navikt/ds-react-internal": "^3.4.3", "@popperjs/core": "^2.11.8", - "axios": "^1.1.3", + "axios": "^1.7.4", "classnames": "^2.3.1", "country-data-list": "^1.3.0", "date-fns": "^3.0.6", @@ -58,7 +58,7 @@ "@redux-devtools/extension": "^3.3.0", "@reduxjs/toolkit": "^2.2.1", "@types/lodash": "^4.14.182", - "@types/node": "^22.1.0", + "@types/node": "^22.3.0", "@types/react": "^18.2.22", "@types/react-datepicker": "^6.0.0", "@types/react-dom": "^18.0.6", @@ -68,12 +68,12 @@ "@types/react-syntax-highlighter": "^15.5.4", "@types/react-window": "^1.8.5", "@types/redux-actions": "^2.6.2", - "@typescript-eslint/eslint-plugin": "^7.0.1", - "@typescript-eslint/parser": "^7.0.1", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "@vitejs/plugin-react": "^4.0.0", "babel-plugin-styled-components": "^2.1.1", "dot-prop": "^9.0.0", - "eslint": "^8.57.0", + "eslint": "^9.9.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-react": "^7.31.11", "fetch-retry": "^6.0.0", @@ -90,7 +90,7 @@ "typescript": "^5.3.2", "vite": "^5.0.0", "vite-plugin-environment": "^1.1.3", - "vite-tsconfig-paths": "^4.0.0" + "vite-tsconfig-paths": "^5.0.1" } }, "node_modules/@ampproject/remapping": { @@ -1069,17 +1069,56 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.17.1.tgz", + "integrity": "sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -1087,7 +1126,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1105,16 +1144,13 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1133,27 +1169,24 @@ "node": "*" } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/@eslint/js": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.0.tgz", + "integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==", "dev": true, - "license": "(MIT OR CC0-1.0)", + "license": "MIT", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@floating-ui/core": { @@ -1309,46 +1342,6 @@ "react-hook-form": "^7.0.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "deprecated": "Use @eslint/config-array instead", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1363,13 +1356,19 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true, - "license": "BSD-3-Clause" + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", @@ -1470,16 +1469,16 @@ } }, "node_modules/@navikt/aksel-icons": { - "version": "6.14.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/6.14.0/3197aec65aa29e81caad6cb2c4030d1aa3cfca92", - "integrity": "sha512-L3A5erCGxcRcL7uGQhRrcatkSIe+LypUPerXdeCv5pvgHRxNrEnakJWhaFCYagfoFPgnjkV4pykenAr68WalnQ==", + "version": "6.16.0", + "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/6.16.0/ab339b42056db9cadf36315a5eeddf8658000b36", + "integrity": "sha512-qJ4VXEYkLGADYMfKKn+y2UzC86aC6hN4emwJpHhU0oJQy75K70uWFgpl0opcMSknKZgOR8mrQaAQke6QRjh4Ug==", "dev": true, "license": "MIT" }, "node_modules/@navikt/ds-css": { - "version": "6.14.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/6.14.0/c39c1cea64eaa5a57049baf2f837bf8c1fd91b39", - "integrity": "sha512-vIsHiLsew+xOrU5E8tHHTY+TYFJjZgshHUvxdF5b5Bd/uNBORqLHNhDPZIgtmXcwlflRqH58yCmtUkvf1aNMtQ==", + "version": "6.16.0", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/6.16.0/12339eae9f3f1e1a83906450c988005910bb5b46", + "integrity": "sha512-GdVAGurx4RCUDnY/R5Mtt7a4rpxV+aNnKUD2adYLD388MoLh/WGEYAml/YX1zEdPolSs2KjjnOw+rBI4IUCCrQ==", "dev": true, "license": "MIT" }, @@ -1501,16 +1500,16 @@ } }, "node_modules/@navikt/ds-react": { - "version": "6.14.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/6.14.0/0127b723f19f6fdcc1ec7a75b47b03f46938e04d", - "integrity": "sha512-w7284EsEAIv9ys1aLCJS2TC10BcmyLZVRjJPhAfpemAOzTAcfCT+cq5+dB0zHbEmK2Ok2VF2UtKbnkWtsypNQg==", + "version": "6.16.0", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/6.16.0/0989459528fc4698be5ae1fecefcf0e16c1b3fbf", + "integrity": "sha512-+GOvdGx5+qkHLJbcxpmoSbm19wsCuca3Gqv1bDpfXAH1ZbDi/cNMfGZS2dL5uOFeYf6ql9+isKoGj5tzFv3+cA==", "dev": true, "license": "MIT", "dependencies": { "@floating-ui/react": "0.25.4", "@floating-ui/react-dom": "^2.0.9", - "@navikt/aksel-icons": "^6.14.0", - "@navikt/ds-tokens": "^6.14.0", + "@navikt/aksel-icons": "^6.16.0", + "@navikt/ds-tokens": "^6.16.0", "clsx": "^2.1.0", "date-fns": "^3.0.0", "react-day-picker": "8.10.0" @@ -1634,9 +1633,9 @@ } }, "node_modules/@navikt/ds-tokens": { - "version": "6.14.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/6.14.0/4c63a82666b9af2a594571435b09c05c184f8627", - "integrity": "sha512-WbTRRr+zwKV0lLWVxbw80v7uMD1uFSFV1Www6K23g5kUsYD/JjfcH7q9EcE80Rr80yxNpG8szSZeyihoFCJ6LA==", + "version": "6.16.0", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/6.16.0/225411f2d34ca90ddf12f57716b2493614032a49", + "integrity": "sha512-y51UPQJNkAtPkTGmBD7uXOy3k+QyeNIODe8DzAcZYwulj4r2qqGy5oBrxE5urxW21WmN21WFvSxyDprXpqZmHg==", "dev": true, "license": "MIT" }, @@ -2329,9 +2328,9 @@ } }, "node_modules/@rc-component/trigger": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-2.2.0.tgz", - "integrity": "sha512-QarBCji02YE9aRFhZgRZmOpXBj0IZutRippsVBv85sxvG4FGk/vRxwAlkn3MS9zK5mwbETd86mAVg2tKqTkdJA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-2.2.1.tgz", + "integrity": "sha512-fuU11J8pOt6+U/tU6/CAv8wjCwGaNeRk9f5k8HQth7JBbJ6MMH62WhGycVW75VnXfBZgL/7kO+wbiO2Xc9U9sQ==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.2", @@ -2742,12 +2741,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "version": "22.3.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.3.0.tgz", + "integrity": "sha512-nrWpWVaDZuaVc5X84xJ0vNrLvomM205oQyLsRt7OHNZbSHslcWsvgFR7O7hire2ZonjLrWBbedmotmIlJDVd6g==", "license": "MIT", "dependencies": { - "undici-types": "~6.13.0" + "undici-types": "~6.18.2" } }, "node_modules/@types/parse-json": { @@ -2884,9 +2883,9 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", - "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", + "version": "4.4.11", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.11.tgz", + "integrity": "sha512-RM05tAniPZ5DZPzzNFP+DmrcOdD0efDUxMy3145oljWSl3x9ZV5vhme98gTxFrj2lhXvmGNnUiuDyJgY9IKkNA==", "license": "MIT", "dependencies": { "@types/react": "*" @@ -2935,32 +2934,32 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.1.0.tgz", + "integrity": "sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.1.0", + "@typescript-eslint/type-utils": "8.1.0", + "@typescript-eslint/utils": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -2969,27 +2968,27 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.1.0.tgz", + "integrity": "sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.1.0", + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/typescript-estree": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -2998,17 +2997,17 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.1.0.tgz", + "integrity": "sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -3016,27 +3015,24 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.1.0.tgz", + "integrity": "sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/typescript-estree": "8.1.0", + "@typescript-eslint/utils": "8.1.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^8.56.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -3044,13 +3040,13 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.1.0.tgz", + "integrity": "sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==", "dev": true, "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -3058,14 +3054,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.1.0.tgz", + "integrity": "sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/visitor-keys": "8.1.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -3074,7 +3070,7 @@ "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -3087,53 +3083,46 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.1.0.tgz", + "integrity": "sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@typescript-eslint/scope-manager": "8.1.0", + "@typescript-eslint/types": "8.1.0", + "@typescript-eslint/typescript-estree": "8.1.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.1.0.tgz", + "integrity": "sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/types": "8.1.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true, - "license": "ISC" - }, "node_modules/@vitejs/plugin-react": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.1.tgz", @@ -3509,9 +3498,9 @@ } }, "node_modules/axios": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", - "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -4255,16 +4244,16 @@ } }, "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, "engines": { - "node": ">=6.0.0" + "node": ">=0.10.0" } }, "node_modules/dom-helpers": { @@ -4294,9 +4283,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", - "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.7.tgz", + "integrity": "sha512-6FTNWIWMxMy/ZY6799nBlPtF1DFDQ6VQJ7yyDP27SJNt5lwtQ5ufqVvHylb3fdQefvRcgA3fKcFMJi9OLwBRNw==", "dev": true, "license": "ISC" }, @@ -4565,42 +4554,38 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.0.tgz", + "integrity": "sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.17.1", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.9.0", "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.0.2", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.1.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -4614,10 +4599,18 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -4677,19 +4670,6 @@ "concat-map": "0.0.1" } }, - "node_modules/eslint-plugin-react/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/eslint-plugin-react/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4714,9 +4694,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -4724,7 +4704,7 @@ "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -4820,20 +4800,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, + "license": "Apache-2.0", "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/has-flag": { @@ -4872,32 +4849,32 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/espree": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", + "integrity": "sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==", "dev": true, - "license": "(MIT OR CC0-1.0)", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.12.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, + "license": "Apache-2.0", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -5047,16 +5024,16 @@ "license": "MIT" }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/file-selector": { @@ -5109,18 +5086,17 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { @@ -5223,7 +5199,8 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true, - "license": "ISC" + "license": "ISC", + "optional": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -5356,6 +5333,7 @@ "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", + "optional": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5390,6 +5368,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5401,6 +5380,7 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", + "optional": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -5680,9 +5660,9 @@ } }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { @@ -5765,6 +5745,7 @@ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "license": "ISC", + "optional": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -5775,7 +5756,8 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "optional": true }, "node_modules/inline-style-prefixer": { "version": "7.0.1", @@ -7195,6 +7177,7 @@ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "license": "ISC", + "optional": true, "dependencies": { "wrappy": "1" } @@ -7323,6 +7306,7 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "license": "MIT", + "optional": true, "engines": { "node": ">=0.10.0" } @@ -8402,6 +8386,7 @@ "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "license": "ISC", + "optional": true, "dependencies": { "glob": "^7.1.3" }, @@ -9332,9 +9317,9 @@ } }, "node_modules/type-fest": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.23.0.tgz", - "integrity": "sha512-ZiBujro2ohr5+Z/hZWHESLz3g08BBdrdLMieYFULJO+tWc437sn8kQsWLJoZErY8alNhxre9K4p3GURAG11n+w==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.24.0.tgz", + "integrity": "sha512-spAaHzc6qre0TlZQQ2aA/nGMe+2Z/wyGk5Z+Ru2VUfdNwT6kWO6TjevOlpebsATEG1EIQ2sOiDszud3lO5mt/Q==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -9475,9 +9460,9 @@ } }, "node_modules/undici-types": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", - "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", + "version": "6.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.18.2.tgz", + "integrity": "sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ==", "license": "MIT" }, "node_modules/update-browserslist-db": { @@ -9654,9 +9639,9 @@ } }, "node_modules/vite-tsconfig-paths": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", - "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.0.1.tgz", + "integrity": "sha512-yqwv+LstU7NwPeNqajZzLEBVpUFU6Dugtb2P84FXuvaoYA+/70l9MHE+GYfYAycVyPSDYZ7mjOFuYBRqlEpTig==", "dev": true, "license": "MIT", "dependencies": { @@ -9882,7 +9867,8 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "optional": true }, "node_modules/xtend": { "version": "4.0.2", diff --git a/apps/dolly-frontend/src/main/js/package.json b/apps/dolly-frontend/src/main/js/package.json index e370151f613..4d441939fcf 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.21", + "version": "3.0.23", "type": "module", "description": "", "main": "index.js", @@ -22,7 +22,7 @@ "@navikt/ds-css-internal": "^3.4.3", "@navikt/ds-react-internal": "^3.4.3", "@popperjs/core": "^2.11.8", - "axios": "^1.1.3", + "axios": "^1.7.4", "classnames": "^2.3.1", "country-data-list": "^1.3.0", "date-fns": "^3.0.6", @@ -66,7 +66,7 @@ "@redux-devtools/extension": "^3.3.0", "@reduxjs/toolkit": "^2.2.1", "@types/lodash": "^4.14.182", - "@types/node": "^22.1.0", + "@types/node": "^22.3.0", "@types/react": "^18.2.22", "@types/react-datepicker": "^6.0.0", "@types/react-dom": "^18.0.6", @@ -76,12 +76,12 @@ "@types/react-syntax-highlighter": "^15.5.4", "@types/react-window": "^1.8.5", "@types/redux-actions": "^2.6.2", - "@typescript-eslint/eslint-plugin": "^7.0.1", - "@typescript-eslint/parser": "^7.0.1", + "@typescript-eslint/eslint-plugin": "^8.1.0", + "@typescript-eslint/parser": "^8.1.0", "@vitejs/plugin-react": "^4.0.0", "babel-plugin-styled-components": "^2.1.1", "dot-prop": "^9.0.0", - "eslint": "^8.57.0", + "eslint": "^9.9.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-react": "^7.31.11", "fetch-retry": "^6.0.0", @@ -98,7 +98,7 @@ "typescript": "^5.3.2", "vite": "^5.0.0", "vite-plugin-environment": "^1.1.3", - "vite-tsconfig-paths": "^4.0.0" + "vite-tsconfig-paths": "^5.0.1" }, "prettier": { "singleQuote": true, diff --git a/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/kriterier/BestillingKriterieMapper.tsx b/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/kriterier/BestillingKriterieMapper.tsx index 22c2250f7ed..a7c5be6d283 100644 --- a/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/kriterier/BestillingKriterieMapper.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/bestilling/sammendrag/kriterier/BestillingKriterieMapper.tsx @@ -1933,6 +1933,23 @@ const mapPensjon = (bestillingData, data, navEnheter) => { data.push(penPensjonsavtale) } + if (pensjonKriterier.generertInntekt) { + const generertPopp = { + header: 'Generert pensjonsgivende inntekt (POPP)', + items: [ + obj('Fra og med år', pensjonKriterier.generertInntekt.generer?.fomAar), + obj('Til og med år', pensjonKriterier.generertInntekt.generer?.tomAar), + obj('Gjennomsnitt G-verdi', pensjonKriterier.generertInntekt.generer.averageG), + obj( + 'Tillat inntekt under 1G', + oversettBoolean(pensjonKriterier.generertInntekt.generer.tillatInntektUnder1G), + ), + ], + } + + data.push(generertPopp) + } + if (pensjonKriterier.tp && pensjonKriterier.tp?.length > 0) { const hentTpOrdningNavn = (tpnr) => { if (Options('tpOrdninger')?.length) { diff --git a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/VisAttributt.tsx b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/VisAttributt.tsx index 7ba1786b1f4..8b931749563 100644 --- a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/VisAttributt.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/VisAttributt.tsx @@ -4,11 +4,13 @@ import { useFormContext } from 'react-hook-form' export const Vis = ({ attributt, children }) => { const { getValues } = useFormContext() const isChecked = (values, attributtPath) => { - // Ignore if values ikke er satt + // Ignorer hvis values ikke er satt if (_.isNil(attributtPath)) return false - // Strings er akseptert, men konverter til Array - if (!Array.isArray(attributtPath)) attributtPath = [attributtPath] + // Gjør om string til array hvis feil type + if (!Array.isArray(attributtPath)) { + attributtPath = [attributtPath] + } return attributtPath.some((v) => _.has(values, v)) } diff --git a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Pensjon.tsx b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Pensjon.tsx index c4b4a9621a6..f9d8661b38b 100644 --- a/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Pensjon.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Pensjon.tsx @@ -11,10 +11,10 @@ import { pensjonPath } from '@/components/fagsystem/pensjon/form/Form' import { genInitialAlderspensjonVedtak } from '@/components/fagsystem/alderspensjon/form/initialValues' import { BestillingsveilederContext } from '@/components/bestillingsveileder/BestillingsveilederContext' import { initialUforetrygd } from '@/components/fagsystem/uforetrygd/initialValues' -import { runningE2ETest } from '@/service/services/Request' import _ from 'lodash' import { alderspensjonPath } from '@/components/fagsystem/alderspensjon/form/Form' import { uforetrygdPath } from '@/components/fagsystem/uforetrygd/form/Form' +import { initialPensjonInntekt } from '@/components/fagsystem/aareg/form/initialValues' import { initialPensjonsavtale } from '@/components/fagsystem/pensjonsavtale/initalValues' export const PensjonPanel = ({ stateModifier, formValues }: any) => { @@ -122,6 +122,7 @@ PensjonPanel.heading = 'Pensjon' PensjonPanel.initialValues = ({ set, del, has }: any) => { const paths = { inntekt: 'pensjonforvalter.inntekt', + generertInntekt: 'pensjonforvalter.generertInntekt', tp: 'pensjonforvalter.tp', alderspensjon: 'pensjonforvalter.alderspensjon', uforetrygd: 'pensjonforvalter.uforetrygd', @@ -130,15 +131,9 @@ PensjonPanel.initialValues = ({ set, del, has }: any) => { return { inntekt: { label: 'Har inntekt', - checked: has(paths.inntekt), - add: () => - set(paths.inntekt, { - fomAar: new Date().getFullYear() - 10, - tomAar: runningE2ETest() ? new Date().getFullYear() : null, - belop: runningE2ETest() ? '12345' : '', - redusertMedGrunnbelop: true, - }), - remove: () => del(paths.inntekt), + checked: has(paths.inntekt) || has(paths.generertInntekt), + add: () => set(paths.inntekt, initialPensjonInntekt), + remove: () => del([paths.inntekt, paths.generertInntekt]), }, tp: { label: 'Har tjenestepensjonsforhold', diff --git a/apps/dolly-frontend/src/main/js/src/components/dollyKjede/DollyKjede.tsx b/apps/dolly-frontend/src/main/js/src/components/dollyKjede/DollyKjede.tsx index 8e7dbc00bd7..d898720cd3a 100644 --- a/apps/dolly-frontend/src/main/js/src/components/dollyKjede/DollyKjede.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/dollyKjede/DollyKjede.tsx @@ -76,10 +76,10 @@ export default ({ const [locked, setLocked] = useState(isLocked) const [paginationIndex, setPaginationIndex] = useState( - getInitialPaginationIndex(antallItems, maxShownItems) + getInitialPaginationIndex(antallItems, maxShownItems), ) const [centerIndices, setCenterIndices] = useState( - getCenterIndices(paginationIndex, antallItems, maxShownItems) + getCenterIndices(paginationIndex, antallItems, maxShownItems), ) useEffect(() => { diff --git a/apps/dolly-frontend/src/main/js/src/components/dollyKjede/KjedePagination.tsx b/apps/dolly-frontend/src/main/js/src/components/dollyKjede/KjedePagination.tsx index 2e13764a0d1..99c27cd7b13 100644 --- a/apps/dolly-frontend/src/main/js/src/components/dollyKjede/KjedePagination.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/dollyKjede/KjedePagination.tsx @@ -5,7 +5,7 @@ import './DollyKjede.less' export interface Props { selectedIndex: number - objectList: string[] + objectList: string[] | any centerIndices: number[] disabled: boolean handlePagination: (page: number) => void @@ -79,7 +79,7 @@ export default ({ index={objectList.length - 1} selected={selectedIndex === objectList.length - 1} disabled={disabled} - text={objectList[objectList.length - 1]} + text={objectList[objectList.length - 1]?.ar || objectList[objectList.length - 1]} onClick={handleClick} /> )} diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/initialValues.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/initialValues.tsx index 2df2822bb29..ef8c1e677be 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/initialValues.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/initialValues.tsx @@ -1,4 +1,5 @@ import subYears from 'date-fns/subYears' +import { runningE2ETest } from '@/service/services/Request' export const initialForenkletOppgjoersordningOrg = { arbeidsgiver: { @@ -88,6 +89,21 @@ export const initialPeriode = { periode: [], } +export const initialPensjonInntekt = { + fomAar: new Date().getFullYear() - 10, + tomAar: runningE2ETest() ? new Date().getFullYear() : null, + belop: runningE2ETest() ? '12345' : '', + redusertMedGrunnbelop: true, +} + +export const initialPensjonGenerertInntekt = { + generer: { + fomAar: new Date().getFullYear() - 10, + averageG: 1.5, + tillatInntektUnder1G: false, + }, +} + export const initialAmelding = [ { maaned: null, diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/ameldingForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/ameldingForm.tsx index 5d98b187c10..ab5840afcbb 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/ameldingForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/ameldingForm.tsx @@ -26,7 +26,7 @@ interface AmeldingFormProps { warningMessage?: any } -const KjedeContainer = styled.div` +export const KjedeContainer = styled.div` display: flex; flex-direction: row; align-items: center; diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/Form.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/Form.tsx index 6df1da3fb3d..0342088df59 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/Form.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/Form.tsx @@ -2,26 +2,35 @@ import { Vis } from '@/components/bestillingsveileder/VisAttributt' import Panel from '@/components/ui/panel/Panel' import { erForsteEllerTest, panelError } from '@/components/ui/form/formUtils' import { validation } from '@/components/fagsystem/pensjon/form/validation' -import { Kategori } from '@/components/ui/form/kategori/Kategori' -import { FormSelect } from '@/components/ui/form/inputs/select/Select' -import { getYearRangeOptions } from '@/utils/DataFormatter' -import { FormTextInput } from '@/components/ui/form/inputs/textInput/TextInput' -import { FormCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox' -import React, { useContext } from 'react' +import React, { useContext, useState } from 'react' import StyledAlert from '@/components/ui/alert/StyledAlert' -import _ from 'lodash' import { BestillingsveilederContext } from '@/components/bestillingsveileder/BestillingsveilederContext' import { useFormContext } from 'react-hook-form' +import { ToggleGroup } from '@navikt/ds-react' +import { + initialPensjonGenerertInntekt, + initialPensjonInntekt, +} from '@/components/fagsystem/aareg/form/initialValues' +import { FyllInnInntektForm } from '@/components/fagsystem/pensjon/form/FyllInnInntektForm' +import { GenerertInntektForm } from '@/components/fagsystem/pensjon/form/GenerertInntektForm' export const pensjonPath = 'pensjonforvalter.inntekt' +export const pensjonGenererPath = 'pensjonforvalter.generertInntekt' const hjelpetekst = 'Hvis nedjuster med grunnbeløp er valgt skal beløp angis som årsbeløp i dagens kroneverdi, ' + 'og vil nedjusteres basert på snitt grunnbeløp i inntektsåret.' +const inputValg = { generertInntekt: 'generer', fyllInnInntekt: 'fyllInn' } + export const PensjonForm = () => { const formMethods = useFormContext() const opts = useContext(BestillingsveilederContext) + const [inputType, setInputType] = useState( + formMethods.getValues(pensjonGenererPath) + ? inputValg.generertInntekt + : inputValg.fyllInnInntekt, + ) const { nyBestilling, nyBestillingFraMal } = opts?.is function kalkulerIdentFyltSyttenAar() { @@ -38,19 +47,21 @@ export const PensjonForm = () => { const syttenFraOgMedAar = kalkulerIdentFyltSyttenAar() const minAar = new Date().getFullYear() - 17 - const valgtAar = formMethods.watch(`${pensjonPath}.fomAar`) + const valgtAar = + inputType === inputValg.fyllInnInntekt + ? formMethods.watch(`${pensjonPath}.fomAar`) + : formMethods.watch(`${pensjonGenererPath}.generer.fomAar`) return ( - + - {/*// @ts-ignore*/} - {!_.has(formMethods.getValues(), 'pdldata.opprettNyPerson.alder') && + {!formMethods.getValues('pdldata.opprettNyPerson.alder') && valgtAar < minAar && (nyBestilling || nyBestillingFraMal) && ( @@ -58,32 +69,41 @@ export const PensjonForm = () => { personen får gyldig alder kan denne settes ved å huke av for "Alder" på forrige side. )} - -
- - - - + { + const isGenerertInntekt = value === inputValg.generertInntekt + const activePath = isGenerertInntekt ? pensjonGenererPath : pensjonPath + const inactivePath = isGenerertInntekt ? pensjonPath : pensjonGenererPath + const currentInitialValues = isGenerertInntekt + ? initialPensjonGenerertInntekt + : initialPensjonInntekt - -
-
+ formMethods.setValue(activePath, currentInitialValues) + formMethods.setValue(inactivePath, undefined) + setInputType(value) + }} + defaultValue={ + formMethods.getValues(pensjonGenererPath) + ? inputValg.generertInntekt + : inputValg.fyllInnInntekt + } + style={{ margin: '5px 0 5px', backgroundColor: '#ffffff' }} + > + + Fyll inn inntekt + + + Generer inntekt + + + {inputType === inputValg.fyllInnInntekt && ( + + )} + {inputType === inputValg.generertInntekt && ( + + )}
) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/FyllInnInntektForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/FyllInnInntektForm.tsx new file mode 100644 index 00000000000..8ebd35c9202 --- /dev/null +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/FyllInnInntektForm.tsx @@ -0,0 +1,40 @@ +import { Kategori } from '@/components/ui/form/kategori/Kategori' +import { FormSelect } from '@/components/ui/form/inputs/select/Select' +import { getYearRangeOptions } from '@/utils/DataFormatter' +import { FormTextInput } from '@/components/ui/form/inputs/textInput/TextInput' +import { FormCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox' +import React from 'react' +import { pensjonPath } from '@/components/fagsystem/pensjon/form/Form' + +export const FyllInnInntektForm = ({ syttenFraOgMedAar }) => { + return ( + +
+ + + + + + + +
+
+ ) +} 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 new file mode 100644 index 00000000000..4744ad91790 --- /dev/null +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/GenerertInntektForm.tsx @@ -0,0 +1,189 @@ +import { Kategori } from '@/components/ui/form/kategori/Kategori' +import { FormSelect } from '@/components/ui/form/inputs/select/Select' +import { getYearRangeOptions } from '@/utils/DataFormatter' +import { FormTextInput } from '@/components/ui/form/inputs/textInput/TextInput' +import React, { useEffect } from 'react' +import { FormCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox' +import Panel from '@/components/ui/panel/Panel' +import { FormDollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' +import { pensjonGenererPath } from '@/components/fagsystem/pensjon/form/Form' +import styled from 'styled-components' +import NavButton from '@/components/ui/button/NavButton/NavButton' +import { ErrorMessage } from '@hookform/error-message' +import { usePensjonFacadeGenerer } from '@/utils/hooks/usePensjon' + +const getTittel = (data) => { + const inntektsaar = data?.map((inntekt) => inntekt.ar) + const foerste = Math.min(...inntektsaar) + const siste = Math.max(...inntektsaar) + return `Genererte inntekter (${foerste} - ${siste})` +} + +const StyledButton = styled(NavButton)` + margin: 0 10px 15px 2px; +` + +const StyledPanel = styled.div` + width: 790px; +` + +export const GenerertInntektForm = ({ syttenFraOgMedAar, formMethods }) => { + const formInntekter = formMethods.watch(`${pensjonGenererPath}.inntekter`) + const genererTOM = formMethods.watch(`${pensjonGenererPath}.generer.tomAar`) + const genererFOM = formMethods.watch(`${pensjonGenererPath}.generer.fomAar`) + const { pensjonResponse, trigger } = usePensjonFacadeGenerer( + formMethods.watch(`${pensjonGenererPath}.generer`), + ) + + const handleGenerer = () => { + formMethods.clearErrors(pensjonGenererPath) + trigger() + .then((values) => { + if (!values) { + formMethods.setError(`${pensjonGenererPath}.generer.tomAar`, { + message: 'Velg et gyldig år', + }) + } + formMethods.setValue(`${pensjonGenererPath}.inntekter`, values?.data?.arInntektGList) + }) + .catch(() => { + formMethods.setError(`${pensjonGenererPath}.generer.tomAar`, { + message: 'Velg et gyldig år', + }) + }) + formMethods.trigger(`${pensjonGenererPath}.generer.tomAar`) + } + + useEffect(() => { + trigger() + }, []) + + useEffect(() => { + if ((!formInntekter || formInntekter?.length === 0) && pensjonResponse) { + formMethods.setValue(`${pensjonGenererPath}.inntekter`, pensjonResponse.arInntektGList) + } + }, [pensjonResponse]) + + return ( + +
+ + + + + + + + +
+ + Generer + +
+ + {formMethods.formState.errors && ( + ( +

{message}

+ )} + /> + )} + + {formInntekter?.length > 0 && ( + + + + {(path: string, idx: number) => ( +
+ { + formMethods.setValue(`${path}.generatedG`, 0) + formMethods.setValue(`${path}.grunnbelop`, 0) + }} + useControlled={true} + /> + + + +
+ )} +
+
+
+ )} +
+
+ ) +} diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/validation.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/validation.tsx index 2c37aae7643..c93ca5653f8 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/validation.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pensjon/form/validation.tsx @@ -1,6 +1,6 @@ import * as Yup from 'yup' import _ from 'lodash' -import { ifPresent, requiredNumber } from '@/utils/YupValidations' +import { ifPresent, requiredNumber, requiredString } from '@/utils/YupValidations' import { TjenestepensjonForm } from '@/components/fagsystem/tjenestepensjon/form/Form' import { AlderspensjonForm } from '@/components/fagsystem/alderspensjon/form/Form' import { UforetrygdForm } from '@/components/fagsystem/uforetrygd/form/Form' @@ -196,6 +196,21 @@ export const validation = { redusertMedGrunnbelop: Yup.boolean(), }), ), + generertInntekt: ifPresent( + '$pensjonforvalter.generertInntekt', + Yup.object({ + generer: Yup.object({ + tomAar: validTomDateTest(requiredNumber).required('Velg et gyldig år'), + }), + inntekter: Yup.array() + .of( + Yup.object({ + inntekt: requiredString, + }), + ) + .required('Generer minst én inntekt'), + }), + ), ...PensjonsavtaleForm.validation, ...TjenestepensjonForm.validation, ...AlderspensjonForm.validation, 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 c5f47d82e7f..7077259335d 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 @@ -49,12 +49,7 @@ const createInntektForm = (kodeverk, skatteordning, path) => { } if (value === 'Date') { return ( - + ) } return ( diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/fieldArray/DollyFieldArray.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/fieldArray/DollyFieldArray.tsx index 8194652a769..70368c19d61 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/fieldArray/DollyFieldArray.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/fieldArray/DollyFieldArray.tsx @@ -223,22 +223,35 @@ export const FormDollyFieldArray = ({ maxReachedDescription = null, buttonText = null, errorText = null, + removeAllEntries = false, }) => { const formMethods = useFormContext() - const { append, update, fields, remove } = useFieldArray({ + const { append, replace, fields, remove, insert } = useFieldArray({ control: formMethods.control, name: name, }) + const values = formMethods.watch(name) useEffect(() => { - // Noen ganger blir formet oppdatert utenfra via setValue, + const differentLength = values?.length !== fields?.length + + const fieldsWithoutId = fields?.map(({ id, ...rest }) => rest) + // Sjekker om det er noen forskjeller mellom values (form) og gjeldende fields + const differentValues = JSON.stringify(values) !== JSON.stringify(fieldsWithoutId) + + // Noen ganger blir formet oppdatert utenfra // da vil denne sjekken sørge for at vi oppdaterer fields også - if (formMethods.watch(name).length !== fields.length) { - formMethods.watch(name).forEach((entry, idx) => { - update(idx, entry) - }) + if (differentLength || differentValues) { + replace(values) + } + }, [fields, values]) + + useEffect(() => { + if (removeAllEntries && fields.length > 0) { + fields.forEach((_, idx) => remove(idx)) } - }, [fields]) + }, [removeAllEntries]) + const addNewEntry = () => { handleNewEntry ? handleNewEntry() : append(newEntry) formMethods.trigger(name) diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/FormFieldInput.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/FormFieldInput.tsx index e5ff84f41b3..1f2760673b1 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/FormFieldInput.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/form/inputs/textInput/FormFieldInput.tsx @@ -1,5 +1,3 @@ -import _ from 'lodash' - import { DollyTextInput } from '@/components/ui/form/inputs/textInput/TextInput' import { useFormContext } from 'react-hook-form' @@ -12,14 +10,11 @@ type Props = { } export default ({ name, useOnChange = false, useControlled = false, ...props }: Props) => { - const { getValues } = useFormContext() + const { watch } = useFormContext() + const value = watch(name) return useControlled ? ( - + ) : ( - + ) } diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/IconItem.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/IconItem.tsx index 5c48c08536b..61742c6d1c4 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/IconItem.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/IconItem.tsx @@ -1,8 +1,9 @@ import Icon from '@/components/ui/icon/Icon' import './IconItem.less' +import { Button } from '@navikt/ds-react' -const IconItem: ({ +export const IconItem = ({ className, icon, fontSize, @@ -10,10 +11,10 @@ const IconItem: ({ className: string icon: string fontSize?: string -}) => JSX.Element = ({ className, icon, fontSize }) => ( +}) => (
- +
) - -export default IconItem diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/index.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/index.tsx index 1a7fc3d82ba..4bdb2063141 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/index.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/icon/IconItem/index.tsx @@ -1,5 +1,5 @@ import './IconItem.less' -import IconItem from './IconItem' +import { IconItem } from '@/components/ui/icon/IconItem/IconItem' const WomanIconItem = () => ( diff --git a/apps/dolly-frontend/src/main/js/src/utils/SjekkBestillingFagsystem.tsx b/apps/dolly-frontend/src/main/js/src/utils/SjekkBestillingFagsystem.tsx index 0e6d3895eab..f6dd969e4b8 100644 --- a/apps/dolly-frontend/src/main/js/src/utils/SjekkBestillingFagsystem.tsx +++ b/apps/dolly-frontend/src/main/js/src/utils/SjekkBestillingFagsystem.tsx @@ -51,7 +51,7 @@ export const harTpBestilling = (bestillingerFagsystemer) => { export const harPoppBestilling = (bestillingerFagsystemer) => { let popp = false bestillingerFagsystemer?.forEach((i) => { - if (i?.pensjonforvalter?.inntekt) { + if (i?.pensjonforvalter?.inntekt || i?.pensjonforvalter?.generertInntekt) { popp = true } }) diff --git a/apps/dolly-frontend/src/main/js/src/utils/hooks/useAdresseSoek.tsx b/apps/dolly-frontend/src/main/js/src/utils/hooks/useAdresseSoek.tsx index 170c01e896a..bb1950470f7 100644 --- a/apps/dolly-frontend/src/main/js/src/utils/hooks/useAdresseSoek.tsx +++ b/apps/dolly-frontend/src/main/js/src/utils/hooks/useAdresseSoek.tsx @@ -28,7 +28,7 @@ type MatrikkelAdresseRequest = { const getQueryParms = (request: any) => { const keys = Object.keys(request).filter( - (key: keyof Request) => request[key] && request[key] !== '' + (key: keyof Request) => request[key] && request[key] !== '', ) if (keys.length === 0) { return '' @@ -45,7 +45,7 @@ const getMatrikkeladresserUrl = (request: any) => export const useAdresser = (request: AdresseRequest, antall: number = 10) => { const { data, isLoading, error } = useSWR( request ? [getAdresserUrl(request), { antall: antall.toString() }] : null, - ([url, headers]) => fetcher(url, headers) + ([url, headers]) => fetcher(url, headers), ) const ingenAdresseFunnet = error?.message?.includes('Ingen adresse funnet') @@ -61,7 +61,7 @@ export const useAdresser = (request: AdresseRequest, antall: number = 10) => { export const useMatrikkelAdresser = (request: MatrikkelAdresseRequest, antall: number = 10) => { const { data, isLoading, error } = useSWR( request ? [getMatrikkeladresserUrl(request), { antall: antall.toString() }] : null, - ([url, headers]) => fetcher(url, headers) + ([url, headers]) => fetcher(url, headers), ) const ingenAdresseFunnet = error?.message?.includes('Ingen adresse funnet') diff --git a/apps/dolly-frontend/src/main/js/src/utils/hooks/usePensjon.tsx b/apps/dolly-frontend/src/main/js/src/utils/hooks/usePensjon.tsx index 05366d66db7..4c12e2b2aa3 100644 --- a/apps/dolly-frontend/src/main/js/src/utils/hooks/usePensjon.tsx +++ b/apps/dolly-frontend/src/main/js/src/utils/hooks/usePensjon.tsx @@ -1,11 +1,15 @@ import useSWR from 'swr' -import { fetcher } from '@/api' +import api, { fetcher } from '@/api' +import { v4 as _uuid } from 'uuid' +import useSWRMutation from 'swr/mutation' -const getPensjonVedtakUrl = '/testnav-pensjon-testdata-facade-proxy/api/vedtak' +const pensjonVedtakUrl = '/testnav-pensjon-testdata-facade-proxy/api/vedtak' +const pensjonFacadeGenererUrl = + '/testnav-pensjon-testdata-facade-proxy/api/v1/generate-inntekt-med-gjennomsnitt-g' export const usePensjonVedtak = (ident, miljo) => { const { data, isLoading, error } = useSWR( - [`${getPensjonVedtakUrl}?miljo=${miljo}`, { fnr: ident }], + [`${pensjonVedtakUrl}?miljo=${miljo}`, { fnr: ident }], ([url, headers]) => fetcher(url, headers), ) @@ -15,3 +19,50 @@ export const usePensjonVedtak = (ident, miljo) => { error: error, } } + +type GjennomsnittG = { + ar: string + inntekt: number + generatedG: number + grunnbelop: number +} +type PensjonResponse = { + data: { + arInntektGList: GjennomsnittG[] + averageG: number + } +} + +const validateBody = (body) => { + if (!body) return false + const { fomAar, tomAar, averageG } = body + return fomAar && tomAar && averageG +} + +export const usePensjonFacadeGenerer = (body: any) => { + const { data, error, trigger } = useSWRMutation( + validateBody(body) && pensjonFacadeGenererUrl, + (url) => { + return api + .fetchJson( + url, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Nav-Consumer-Id': 'dolly', + 'Nav-Call-Id': 'dolly ' + _uuid(), + }, + }, + body, + ) + .then((response: PensjonResponse) => ({ data: response })) + }, + ) + + return { + pensjonResponse: data?.data, + error: error, + trigger: trigger, + } +}