diff --git a/apps/dolly-frontend/src/main/js/package-lock.json b/apps/dolly-frontend/src/main/js/package-lock.json index 6bc3dfa4dd1..084695a3ca1 100644 --- a/apps/dolly-frontend/src/main/js/package-lock.json +++ b/apps/dolly-frontend/src/main/js/package-lock.json @@ -1278,9 +1278,9 @@ "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" }, "node_modules/@grafana/faro-core": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@grafana/faro-core/-/faro-core-1.3.4.tgz", - "integrity": "sha512-r3l+7+qZHWGlAcc1q0DQI5xdF2cidDoYO0TtU3P1XDFLayFqMcUwQpXX1Yu0fd/WYegrtgc96jwje7g9W2N/5g==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@grafana/faro-core/-/faro-core-1.3.5.tgz", + "integrity": "sha512-5DBJDVqzTRh6cHq2usmX1eisyQiJ60gX3TEnRIKMQ3a+uwEDJN5q/Cm4wz3PVk1WH8HimzOPMty3FoFN/zxH9g==", "dependencies": { "@opentelemetry/api": "^1.7.0", "@opentelemetry/otlp-transformer": "^0.45.1", @@ -1288,12 +1288,12 @@ } }, "node_modules/@grafana/faro-react": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@grafana/faro-react/-/faro-react-1.3.4.tgz", - "integrity": "sha512-AnNF3wJq3nwke/IorJTMTrU/Hz4dt4jGNjBUfPQoJNpwChM6oK80GFIQBdea5KXbNsR0WeGIPyW5ZFKsq2gSNw==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@grafana/faro-react/-/faro-react-1.3.5.tgz", + "integrity": "sha512-26YgCLKO/nOUoAJxrRO6RZ6Kv+/mg/oLvgf48sys4zB5DWiAPUpumSeqB8/h+4pY39TPTlGmT2Clq+2gbTiDjw==", "dependencies": { - "@grafana/faro-web-sdk": "^1.3.4", - "@grafana/faro-web-tracing": "^1.3.4", + "@grafana/faro-web-sdk": "^1.3.5", + "@grafana/faro-web-tracing": "^1.3.5", "hoist-non-react-statics": "^3.3.2" }, "peerDependencies": { @@ -1303,21 +1303,21 @@ } }, "node_modules/@grafana/faro-web-sdk": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@grafana/faro-web-sdk/-/faro-web-sdk-1.3.4.tgz", - "integrity": "sha512-jPgSqU+W6RZKWmo1XOBJEv/Rn8O6AeHeKeD9N8G8Rs0Rg3jW0HfnU+dA07trpdbHVpdF1jJ84XNe9hhJRbbThg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@grafana/faro-web-sdk/-/faro-web-sdk-1.3.5.tgz", + "integrity": "sha512-yIHLUnunmVvZr4dTMmk6Z2KpfF3HFmDI0YFWQFoQOP6vItHi/kXj9jFV92f0FuEjSaGwq46P9EJclpksL1tZAQ==", "dependencies": { - "@grafana/faro-core": "^1.3.4", + "@grafana/faro-core": "^1.3.5", "ua-parser-js": "^1.0.32", "web-vitals": "^3.1.1" } }, "node_modules/@grafana/faro-web-tracing": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@grafana/faro-web-tracing/-/faro-web-tracing-1.3.4.tgz", - "integrity": "sha512-y8Yb+ueJ4WLhEaNWhup6hA0rG5dY8qqVuj2FLqnau09FXIkWUSmi1ioO7OveYtUoG+rIRR5cfgU/TVVSCJD2/w==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@grafana/faro-web-tracing/-/faro-web-tracing-1.3.5.tgz", + "integrity": "sha512-Y8ezwH2FAL2Zd1OPMFE46doRNEeigXPc9iynT6Jks05Fjs10p7rivOu/NHEs6II4bQ0lYMPzGkVOUNhkQoOqXQ==", "dependencies": { - "@grafana/faro-web-sdk": "^1.3.4", + "@grafana/faro-web-sdk": "^1.3.5", "@opentelemetry/api": "^1.7.0", "@opentelemetry/context-zone": "^1.18.1", "@opentelemetry/core": "^1.18.1", @@ -5536,9 +5536,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.612", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.612.tgz", - "integrity": "sha512-dM8BMtXtlH237ecSMnYdYuCkib2QHq0kpWfUnavjdYsyr/6OsAwg5ZGUfnQ9KD1Ga4QgB2sqXlB2NT8zy2GnVg==" + "version": "1.4.613", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.613.tgz", + "integrity": "sha512-r4x5+FowKG6q+/Wj0W9nidx7QO31BJwmR2uEo+Qh3YLGQ8SbBAFuDFpTxzly/I2gsbrFwBuIjrMp423L3O5U3w==" }, "node_modules/emoji-regex": { "version": "9.2.2", @@ -5904,9 +5904,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", - "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dependencies": { "array-includes": "^3.1.7", "array.prototype.findlastindex": "^1.2.3", @@ -5924,7 +5924,7 @@ "object.groupby": "^1.0.1", "object.values": "^1.1.7", "semver": "^6.3.1", - "tsconfig-paths": "^3.14.2" + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -10279,12 +10279,12 @@ } }, "node_modules/redux-first-history": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/redux-first-history/-/redux-first-history-5.1.1.tgz", - "integrity": "sha512-ujVHv+y9wC2rqavS5tLiSu6zkw+VYrEea+/ggwVTRuutadEtwxSRlaK19ry/PTLSQtFuUF1Xu+plL5erD4roVw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/redux-first-history/-/redux-first-history-5.2.0.tgz", + "integrity": "sha512-7kLqtSXGPZIgvEhl3B+3wRvzePvvZggpVqg+jpR2ZVqu2ESGj9DF6hMHpoEP7bGHqddljjKYjnRmtSetYEiG2Q==", "peerDependencies": { "history": "^4.7.2 || ^5.0", - "redux": "^3.6.0 || ^4.0.0" + "redux": "^3.6.0 || ^4.0.0 || ^5.0.0" } }, "node_modules/redux-promise-middleware": { @@ -11810,9 +11810,9 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -12128,9 +12128,9 @@ } }, "node_modules/vite": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.8.tgz", - "integrity": "sha512-jYMALd8aeqR3yS9xlHd0OzQJndS9fH5ylVgWdB+pxTwxLKdO1pgC5Dlb398BUxpfaBxa4M9oT7j1g503Gaj5IQ==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.9.tgz", + "integrity": "sha512-wVqMd5kp28QWGgfYPDfrj771VyHTJ4UDlCteLH7bJDGDEamaz5hV8IX6h1brSGgnnyf9lI2RnzXq/JmD0c2wwg==", "dev": true, "dependencies": { "esbuild": "^0.19.3", @@ -12575,9 +12575,9 @@ } }, "node_modules/yup": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/yup/-/yup-1.3.2.tgz", - "integrity": "sha512-6KCM971iQtJ+/KUaHdrhVr2LDkfhBtFPRnsG1P8F4q3uUVQ2RfEM9xekpha9aA4GXWJevjM10eDcPQ1FfWlmaQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.3.3.tgz", + "integrity": "sha512-v8QwZSsHH2K3/G9WSkp6mZKO+hugKT1EmnMqLNUcfu51HU9MDyhlETT/JgtzprnrnQHPWsjc6MUDMBp/l9fNnw==", "dependencies": { "property-expr": "^2.0.5", "tiny-case": "^1.0.3", diff --git a/apps/dolly-frontend/src/main/js/src/app/App.tsx b/apps/dolly-frontend/src/main/js/src/app/App.tsx index 26c64ba1b57..d2fffdf816e 100644 --- a/apps/dolly-frontend/src/main/js/src/app/App.tsx +++ b/apps/dolly-frontend/src/main/js/src/app/App.tsx @@ -18,6 +18,7 @@ import { runningCypressE2E } from '@/service/services/Request' import { navigateToLogin } from '@/components/utlogging/navigateToLogin' import { FaroErrorBoundary } from '@grafana/faro-react' import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' +import { InfoStripe } from '@/components/infostripe/InfoStripe' const logout = (feilmelding: string) => { if (!runningCypressE2E()) { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsavtaleForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsavtaleForm.tsx index 0df5321185a..56e81176faa 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsavtaleForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsavtaleForm.tsx @@ -2,8 +2,12 @@ import { FormikSelect } from '@/components/ui/form/inputs/select/Select' import { FormikDatepicker } from '@/components/ui/form/inputs/datepicker/Datepicker' import { FormikTextInput } from '@/components/ui/form/inputs/textInput/TextInput' import { ArbeidKodeverk } from '@/config/kodeverk' +import { useFormContext } from 'react-hook-form' export const ArbeidsavtaleForm = ({ path, onChangeLenket, ...props }) => { + const { watch } = useFormContext() + const yrke = watch(`${path}.yrke`) + console.log('yrke: ', yrke) //TODO - SLETT MEG return (

Ansettelsesdetaljer

diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx index 36577062efc..3dd1d0a7eaf 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/aareg/form/partials/arbeidsforholdForm.tsx @@ -158,12 +158,14 @@ export const ArbeidsforholdForm = ({ arbeidsforholdstype: event.value, arbeidsgiver: gjeldendeArbeidsgiver, }) + trigger() } else if (arbeidsgiverType === ArbeidsgiverTyper.privat) { setFieldValue(path, { ...initialForenkletOppgjoersordningPers, arbeidsforholdstype: event.value, arbeidsgiver: gjeldendeArbeidsgiver, }) + trigger() } } } else { @@ -177,23 +179,27 @@ export const ArbeidsforholdForm = ({ arbeidsforholdstype: event.value, arbeidsgiver: gjeldendeArbeidsgiver, }) + trigger() } else if (arbeidsgiverType === ArbeidsgiverTyper.privat) { setFieldValue(path, { ...initialArbeidsforholdPers, arbeidsforholdstype: event.value, arbeidsgiver: gjeldendeArbeidsgiver, }) + trigger } } else { setFieldValue(`${path}.arbeidsforholdstype`, event.value) + trigger } if (event.value === 'maritimtArbeidsforhold') { setFieldValue(`${path}.fartoy`, initialFartoy) + trigger() } else { setFieldValue(`${path}.fartoy`, undefined) + trigger() } } - trigger(path) } useEffect(() => { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/bankkonto/form/validation.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/bankkonto/form/validation.tsx index 76f3681b0da..eadc21ce754 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/bankkonto/form/validation.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/bankkonto/form/validation.tsx @@ -16,7 +16,7 @@ const validInputOrCheckboxTest = (val, checkboxPath, feilmelding, inputValidatio return true } - const path = testContext.path.substring(0, this.path.lastIndexOf('.')) + const path = testContext.path.substring(0, testContext.path.lastIndexOf('.')) const checkbox = _.get(fullForm, `${path}.${checkboxPath}`) @@ -30,7 +30,7 @@ const validInputOrCheckboxTest = (val, checkboxPath, feilmelding, inputValidatio // from - begynner med 0 const replaceSubstringAtPos = (str, from, to, replaceWith) => { - return str.substring(0, from) + replaceWith + str.substr(to + 1) + return str.substring(0, from) + replaceWith + str.substring(to + 1) } const validateIban = (kontonummer, form) => { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/brregstub/form/partials/EgneOrganisasjoner.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/brregstub/form/partials/EgneOrganisasjoner.tsx index 8347c2b5036..551ce4d9131 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/brregstub/form/partials/EgneOrganisasjoner.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/brregstub/form/partials/EgneOrganisasjoner.tsx @@ -227,8 +227,9 @@ export const EgneOrganisasjoner = ({ onChange={(event) => { setOrgnr(event.value) handleChange(event) + formMethods.trigger() }} - value={_.get(formMethods.getValues(), path)} + value={formMethods.watch(path)} feil={sjekkOrganisasjoner()} isClearable={false} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/button/RelatertPersonImportButton/RelatertPersonImportButton.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/button/RelatertPersonImportButton/RelatertPersonImportButton.tsx index 762d5293013..3890bbfe0f8 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/button/RelatertPersonImportButton/RelatertPersonImportButton.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/button/RelatertPersonImportButton/RelatertPersonImportButton.tsx @@ -11,7 +11,7 @@ import { DollyCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox' import { allCapsToCapitalized } from '@/utils/DataFormatter' import * as _ from 'lodash' import { REGEX_BACKEND_GRUPPER, useMatchMutate } from '@/utils/hooks/useMutate' -import { useFieldArray, useForm } from 'react-hook-form' +import { FormProvider, useFieldArray, useForm } from 'react-hook-form' type RelatertPersonProps = { type: string @@ -106,7 +106,7 @@ export const RelatertPersonImportButton = ({ } const identForm = () => { - const fieldMethods = useFieldArray({ name: 'identer' }) + const fieldMethods = useFieldArray({ control: formMethods.control, name: 'identer' }) const values = fieldMethods.fields?.values?.identer const isChecked = (id: string) => values?.includes(id) const onClick = (e: { target: RelatertPersonProps }) => { @@ -135,60 +135,62 @@ export const RelatertPersonImportButton = ({ } return ( -
- - {feilmelding && ( -
- {feilmelding} -
- )} - -
- - {relatertPersonIdenter.length > 1 ? ( - <> -

Importer relaterte personer

-

Velg hvilke relaterte personer du ønsker å importere

- {identForm()} - - ) : ( - <> -
-

{`Importer ${foersteRelatertPersonType}`}

-

- {`Er du sikker på at du vil importere og legge til valgt persons ${ - foersteRelatertPersonType || 'relaterte person' - } i gruppen?`} -

-
-
- - Nei - - { - closeModal() - handleImport([relatertPersonIdenter[0]?.id]) - }} - variant={'primary'} - > - Ja - -
- - )} -
-
-
+ +
+ + {feilmelding && ( +
+ {feilmelding} +
+ )} + +
+ + {relatertPersonIdenter.length > 1 ? ( + <> +

Importer relaterte personer

+

Velg hvilke relaterte personer du ønsker å importere

+ {identForm()} + + ) : ( + <> +
+

{`Importer ${foersteRelatertPersonType}`}

+

+ {`Er du sikker på at du vil importere og legge til valgt persons ${ + foersteRelatertPersonType || 'relaterte person' + } i gruppen?`} +

+
+
+ + Nei + + { + closeModal() + handleImport([relatertPersonIdenter[0]?.id]) + }} + variant={'primary'} + > + Ja + +
+ + )} +
+
+
+
) }