From 21b0443e267653df09464ad74b18ddc165d5fc67 Mon Sep 17 00:00:00 2001 From: Hallvard Andreas Stark <57254397+hallvardastark@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:26:09 +0100 Subject: [PATCH] Fjerner bruk av Popover fra ft-plattform-komponenter (#6953) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Lager en v2-versjon av dekoratør (#6825) * Lager en v2-versjon av dekoratør * Trenger decodeHtmlEntity for å formatere feilmeldinger fra backend * TSFF-916 sorterer behandlinger med nyeste behandling øverst i listen.… (#6829) * TSFF-916 sorterer behandlinger med nyeste behandling øverst i listen. Er helt tilfeldig i dag * toSorted() i stedet for sort(), lager nytt array i stedet for å mutere * Prosess vilkar overstyring v2 (#6756) * Laget v2-versjon av prosess-vilkar-overstyring * Bort med react-intl Fikset tester og stories * Fiks av tester * Bruker v2-panel for ungdomsytelse * Sender ned vilkårstype slik at avslagsårsaker kan mappes * Retter feil i tester * Flyttet tester inn i stories * Retter overskrift * Fiks imports * fiks css * Legger til eksplisitt type istadenfor any. * Bruker structuredClone fremfor JSON.stringify Lager en delt komponent for OverstyrBekreftKnappPanel * Tar bort duplisert kode * Tar bort ubrukt kode --------- Co-authored-by: Jostein Stuhaug * Bump @navikt/k9-sak-typescript-client (#6787) Bumps [@navikt/k9-sak-typescript-client](https://github.com/navikt/k9-sak) from 1.0.20241028110915 to 1.0.20241105125420. - [Commits](https://github.com/navikt/k9-sak/commits) --- updated-dependencies: - dependency-name: "@navikt/k9-sak-typescript-client" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bruke Json.stringify for cloning av objekter inntil videre (#6837) * Vise 0% fravær om faktisk og normal arbeidstid er 0 (#6849) * Bump the patch-and-minor group across 1 directory with 7 updates (#6848) Bumps the patch-and-minor group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@sentry/browser](https://github.com/getsentry/sentry-javascript) | `8.38.0` | `8.39.0` | | [@sentry/react](https://github.com/getsentry/sentry-javascript) | `8.38.0` | `8.39.0` | | [@playwright/test](https://github.com/microsoft/playwright) | `1.48.2` | `1.49.0` | | [eslint](https://github.com/eslint/eslint) | `9.14.0` | `9.15.0` | | [husky](https://github.com/typicode/husky) | `9.1.6` | `9.1.7` | | [msw](https://github.com/mswjs/msw) | `2.6.4` | `2.6.5` | | [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) | `5.60.2` | `5.61.0` | Updates `@sentry/browser` from 8.38.0 to 8.39.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/8.38.0...8.39.0) Updates `@sentry/react` from 8.38.0 to 8.39.0 - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/8.38.0...8.39.0) Updates `@playwright/test` from 1.48.2 to 1.49.0 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.48.2...v1.49.0) Updates `eslint` from 9.14.0 to 9.15.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.14.0...v9.15.0) Updates `husky` from 9.1.6 to 9.1.7 - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v9.1.6...v9.1.7) Updates `msw` from 2.6.4 to 2.6.5 - [Release notes](https://github.com/mswjs/msw/releases) - [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md) - [Commits](https://github.com/mswjs/msw/compare/v2.6.4...v2.6.5) Updates `@tanstack/react-query` from 5.60.2 to 5.61.0 - [Release notes](https://github.com/TanStack/query/releases) - [Commits](https://github.com/TanStack/query/commits/v5.61.0/packages/react-query) --- updated-dependencies: - dependency-name: "@sentry/browser" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch-and-minor - dependency-name: "@sentry/react" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch-and-minor - dependency-name: "@playwright/test" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: patch-and-minor - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: patch-and-minor - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch dependency-group: patch-and-minor - dependency-name: msw dependency-type: direct:development update-type: version-update:semver-patch dependency-group: patch-and-minor - dependency-name: "@tanstack/react-query" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch-and-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Prøver å gi hjelpefunksjon et mer logisk navn (#6851) Vi bruker ikke microfrontends mer * Tar bort decodeHtmlEntity-funksjon igjen * Fjerner kode relatert til risikoklassifisering (#6855) Dersom det skal håndterers i fremtiden anbefales det å se på Foreldrepengers løsning * Bruker aksel-deler for dekoratør fremfor hjemmesnekret Sletter gammel dekoratør * Revert "Merge branch 'master' into v2-dekoratør" This reverts commit 80e4215132a5e4c1a60840aed04b8f0a4620d291, reversing changes made to 9ea6d16f7a9377ba7c641cc53b843ed1e7efaed0. * Fiks yarn.lock * fiks --------- Signed-off-by: dependabot[bot] Co-authored-by: Vebjørn Nordby Co-authored-by: Jostein Stuhaug Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Thomas H. Wiberg * Viser grønn dekoratør for ung i Q også (#6863) * Legger inn ytelse og lenke i dekoratør * Fjerner bruk av Popover fra ft-plattform-komponenter Bruker aksel-komponenter * Bumper ft-plattform-komponenter Blir helt kvitt react-popper * fiks test * fiks test --------- Signed-off-by: dependabot[bot] Co-authored-by: Vebjørn Nordby Co-authored-by: Jostein Stuhaug Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Thomas H. Wiberg --- package.json | 3 +- packages/behandling-felles/package.json | 2 +- packages/fakta-etablert-tilsyn/package.json | 5 +- packages/fakta-inntektsmelding/package.json | 5 +- packages/fakta-institusjon/package.json | 2 +- .../package.json" | 5 +- packages/fakta-medlemskap/package.json | 2 +- packages/fakta-om-barnet/package.json | 3 +- packages/fakta-omsorgen-for/package.json | 5 +- packages/fakta-opplaering/package.json | 2 +- packages/form/package.json | 2 +- packages/prosess-uttak/package.json | 3 +- .../package.json | 2 +- .../prosess-vilkar-overstyring/package.json | 2 +- packages/prosess-vilkar-sykdom/package.json | 2 +- packages/sak-app/package.json | 2 +- .../BehandlingMenuIndex.spec.tsx | 20 ++--- packages/sak-meny/package.json | 2 +- packages/sak-meny/src/MenySakIndex.spec.tsx | 11 ++- packages/sak-meny/src/MenySakIndex.tsx | 78 +++++-------------- packages/sak-visittkort/package.json | 2 +- packages/shared-components/package.json | 2 +- yarn.lock | 77 ++++++------------ 23 files changed, 80 insertions(+), 159 deletions(-) diff --git a/package.json b/package.json index 86bc006287..517d25d09c 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@navikt/ds-react": "7.6.0", "@navikt/ds-tailwind": "^7.6.0", "@navikt/familie-endringslogg": "13.1.4", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "@sentry/browser": "8.46.0", "@sentry/react": "^8.46.0", @@ -105,7 +105,6 @@ "msw-storybook-addon": "^2.0.4", "postcss": "^8.4.49", "prettier": "3.4.2", - "react-popper": "2.3.0", "storybook": "^8.4.7", "stylelint": "16.12.0", "stylelint-config-standard": "^36.0.1", diff --git a/packages/behandling-felles/package.json b/packages/behandling-felles/package.json index 3a33dec7e4..18bdbe4ed3 100644 --- a/packages/behandling-felles/package.json +++ b/packages/behandling-felles/package.json @@ -15,7 +15,7 @@ "@k9-sak-web/modal-sett-pa-vent": "1.0.0", "@k9-sak-web/rest-api-hooks": "1.0.0", "@k9-sak-web/types": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "classnames": "2.5.1", "react": "18.3.1", "react-intl": "7.0.1", diff --git a/packages/fakta-etablert-tilsyn/package.json b/packages/fakta-etablert-tilsyn/package.json index 1dc2171297..5997dd9fa3 100644 --- a/packages/fakta-etablert-tilsyn/package.json +++ b/packages/fakta-etablert-tilsyn/package.json @@ -17,7 +17,7 @@ "@navikt/ds-css": "7.6.0", "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "7.6.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "classnames": "2.5.1", "dayjs": "1.11.13", @@ -25,8 +25,7 @@ "react": "18.3.1", "react-collapse": "5.1.1", "react-dom": "18.3.1", - "react-hook-form": "7.53.2", - "react-popper": "2.3.0" + "react-hook-form": "7.53.2" }, "msw": { "workerDirectory": "public" diff --git a/packages/fakta-inntektsmelding/package.json b/packages/fakta-inntektsmelding/package.json index 2e6d45536f..4916c0dc7f 100644 --- a/packages/fakta-inntektsmelding/package.json +++ b/packages/fakta-inntektsmelding/package.json @@ -19,15 +19,14 @@ "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "7.6.0", "@navikt/ft-form-hooks": "5.2.9", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "classnames": "2.5.1", "dayjs": "1.11.13", "react": "18.3.1", "react-collapse": "5.1.1", "react-dom": "18.3.1", - "react-hook-form": "7.53.2", - "react-popper": "2.3.0" + "react-hook-form": "7.53.2" }, "msw": { "workerDirectory": "public" diff --git a/packages/fakta-institusjon/package.json b/packages/fakta-institusjon/package.json index 3cca2d4ed7..62cc26da0e 100644 --- a/packages/fakta-institusjon/package.json +++ b/packages/fakta-institusjon/package.json @@ -7,7 +7,7 @@ "dependencies": { "@fpsak-frontend/form": "*", "@k9-sak-web/types": "*", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "formik": "2.4.6" } } diff --git "a/packages/fakta-medisinsk-vilk\303\245r/package.json" "b/packages/fakta-medisinsk-vilk\303\245r/package.json" index 7672a3aeba..a8358f045c 100644 --- "a/packages/fakta-medisinsk-vilk\303\245r/package.json" +++ "b/packages/fakta-medisinsk-vilk\303\245r/package.json" @@ -21,7 +21,7 @@ "@navikt/ds-css": "7.6.0", "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "7.6.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "@tanstack/react-query": "^5.62.8", "axios": "1.7.9", @@ -31,8 +31,7 @@ "react-collapse": "5.1.1", "react-dom": "18.3.1", "react-hook-form": "7.53.2", - "react-outside-click-handler": "1.3.0", - "react-popper": "2.3.0" + "react-outside-click-handler": "1.3.0" }, "msw": { "workerDirectory": "public" diff --git a/packages/fakta-medlemskap/package.json b/packages/fakta-medlemskap/package.json index b185ab09fc..a166f73b88 100644 --- a/packages/fakta-medlemskap/package.json +++ b/packages/fakta-medlemskap/package.json @@ -12,7 +12,7 @@ "@fpsak-frontend/shared-components": "1.0.0", "@fpsak-frontend/utils": "1.0.0", "@navikt/ft-form-hooks": "5.2.9", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "i18n-iso-countries": "7.13.0", "moment": "2.30.1", "prop-types": "15.8.1", diff --git a/packages/fakta-om-barnet/package.json b/packages/fakta-om-barnet/package.json index c5c594c606..9d7f04fdb5 100644 --- a/packages/fakta-om-barnet/package.json +++ b/packages/fakta-om-barnet/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@navikt/ds-react": "7.6.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "classnames": "2.5.1", "dayjs": "1.11.13", @@ -24,7 +24,6 @@ "react-collapse": "5.1.1", "react-dom": "18.3.1", "react-hook-form": "7.53.2", - "react-popper": "2.3.0", "tailwindcss": "^3.4.17" }, "msw": { diff --git a/packages/fakta-omsorgen-for/package.json b/packages/fakta-omsorgen-for/package.json index 8780e37781..50d2c19ffa 100644 --- a/packages/fakta-omsorgen-for/package.json +++ b/packages/fakta-omsorgen-for/package.json @@ -19,7 +19,7 @@ "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "7.6.0", "@navikt/fnrvalidator": "2.1.5", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "classnames": "2.5.1", "dayjs": "1.11.13", @@ -28,8 +28,7 @@ "react-collapse": "5.1.1", "react-dom": "18.3.1", "react-hook-form": "7.53.2", - "react-intl": "7.0.1", - "react-popper": "2.3.0" + "react-intl": "7.0.1" }, "msw": { "workerDirectory": "public" diff --git a/packages/fakta-opplaering/package.json b/packages/fakta-opplaering/package.json index 3f2ed0a702..da878d40b4 100644 --- a/packages/fakta-opplaering/package.json +++ b/packages/fakta-opplaering/package.json @@ -10,7 +10,7 @@ "@k9-sak-web/types": "*", "@navikt/ds-icons": "3.4.3", "@navikt/ds-react": "7.6.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "classnames": "2.5.1", "dayjs": "1.11.13", "formik": "2.4.6", diff --git a/packages/form/package.json b/packages/form/package.json index bef0e5642d..31e856256c 100644 --- a/packages/form/package.json +++ b/packages/form/package.json @@ -8,7 +8,7 @@ "dependencies": { "@fpsak-frontend/shared-components": "1.0.0", "@fpsak-frontend/utils": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "classnames": "2.5.1", "formik": "2.4.6", "moment": "2.30.1", diff --git a/packages/prosess-uttak/package.json b/packages/prosess-uttak/package.json index 6c2bae5875..23436d15c9 100644 --- a/packages/prosess-uttak/package.json +++ b/packages/prosess-uttak/package.json @@ -19,7 +19,7 @@ "@navikt/ds-react": "7.6.0", "@navikt/ft-form-hooks": "5.2.9", "@navikt/ft-form-validators": "2.5.7", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@popperjs/core": "2.11.8", "classnames": "2.5.1", "dayjs": "1.11.13", @@ -27,7 +27,6 @@ "react-collapse": "5.1.1", "react-dom": "18.3.1", "react-hook-form": "7.53.2", - "react-popper": "2.3.0", "yup": "1.6.1" } } diff --git a/packages/prosess-vilkar-opptjening-oms/package.json b/packages/prosess-vilkar-opptjening-oms/package.json index 998f54a350..493031194c 100644 --- a/packages/prosess-vilkar-opptjening-oms/package.json +++ b/packages/prosess-vilkar-opptjening-oms/package.json @@ -11,7 +11,7 @@ "@fpsak-frontend/utils": "1.0.0", "@k9-sak-web/prosess-felles": "1.0.0", "@k9-sak-web/types": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "classnames": "2.5.1", "dayjs": "1.11.13", "lodash": "4.17.21", diff --git a/packages/prosess-vilkar-overstyring/package.json b/packages/prosess-vilkar-overstyring/package.json index 750344d25a..d647a5328b 100644 --- a/packages/prosess-vilkar-overstyring/package.json +++ b/packages/prosess-vilkar-overstyring/package.json @@ -13,7 +13,7 @@ "@k9-sak-web/prosess-felles": "1.0.0", "@k9-sak-web/sak-app": "1.0.0", "@k9-sak-web/types": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "classnames": "2.5.1", "moment": "2.30.1", "react": "18.3.1", diff --git a/packages/prosess-vilkar-sykdom/package.json b/packages/prosess-vilkar-sykdom/package.json index 6d4e37ea56..1628927f76 100644 --- a/packages/prosess-vilkar-sykdom/package.json +++ b/packages/prosess-vilkar-sykdom/package.json @@ -9,7 +9,7 @@ "@fpsak-frontend/kodeverk": "1.0.0", "@fpsak-frontend/shared-components": "1.0.0", "@fpsak-frontend/utils": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "classnames": "2.5.1", "lodash": "4.17.21", "react": "18.3.1", diff --git a/packages/sak-app/package.json b/packages/sak-app/package.json index 5ab38a2dd8..9bd677f0f7 100644 --- a/packages/sak-app/package.json +++ b/packages/sak-app/package.json @@ -45,7 +45,7 @@ "@navikt/ds-react": "7.6.0", "@navikt/ft-fakta-beregning": "7.1.10", "@navikt/ft-form-hooks": "5.2.9", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "@navikt/ft-prosess-beregningsgrunnlag": "7.1.10", "@navikt/ft-ui-komponenter": "2.6.5", "@sentry/browser": "8.46.0", diff --git a/packages/sak-app/src/behandlingmenu/BehandlingMenuIndex.spec.tsx b/packages/sak-app/src/behandlingmenu/BehandlingMenuIndex.spec.tsx index f89b8f09b4..908191fd51 100644 --- a/packages/sak-app/src/behandlingmenu/BehandlingMenuIndex.spec.tsx +++ b/packages/sak-app/src/behandlingmenu/BehandlingMenuIndex.spec.tsx @@ -130,12 +130,12 @@ describe('BehandlingMenuIndex', () => { expect(await knapp).not.toBeNull(); expect(screen.queryByText('Fortsett behandlingen')).toBeNull(); - expect(screen.queryByText('Sett behandlingen på vent')).not.toBeVisible(); - expect(screen.queryByText('Henlegg behandlingen og avslutt')).not.toBeVisible(); - expect(screen.queryByText('Endre behandlende enhet')).not.toBeVisible(); + expect(screen.queryByText('Sett behandlingen på vent')).not.toBeInTheDocument(); + expect(screen.queryByText('Henlegg behandlingen og avslutt')).not.toBeInTheDocument(); + expect(screen.queryByText('Endre behandlende enhet')).not.toBeInTheDocument(); // expect(screen.queryByText('Marker behandling')).not.toBeVisible(); - expect(screen.queryByText('Opprett ny behandling')).not.toBeVisible(); - expect(screen.queryByText('Opprett verge/fullmektig')).not.toBeVisible(); + expect(screen.queryByText('Opprett ny behandling')).not.toBeInTheDocument(); + expect(screen.queryByText('Opprett verge/fullmektig')).not.toBeInTheDocument(); /** * Åpne behandlingsmenyen @@ -145,11 +145,11 @@ describe('BehandlingMenuIndex', () => { }); expect(screen.queryByText('Fortsett behandlingen')).toBeNull(); - expect(screen.queryByRole('button', { name: 'Sett behandlingen på vent' })).toBeVisible(); - expect(screen.queryByRole('button', { name: 'Henlegg behandlingen og avslutt' })).toBeVisible(); - expect(screen.queryByRole('button', { name: 'Endre behandlende enhet' })).toBeVisible(); + expect(screen.getByRole('menuitem', { name: 'Sett behandlingen på vent' })).toBeInTheDocument(); + expect(screen.getByRole('menuitem', { name: 'Henlegg behandlingen og avslutt' })).toBeInTheDocument(); + expect(screen.getByRole('menuitem', { name: 'Endre behandlende enhet' })).toBeInTheDocument(); // expect(screen.queryByRole('button', { name: 'Marker behandling' })).toBeVisible(); - expect(screen.queryByRole('button', { name: 'Opprett ny behandling' })).toBeVisible(); - expect(screen.queryByRole('button', { name: 'Opprett verge/fullmektig' })).toBeVisible(); + expect(screen.getByRole('menuitem', { name: 'Opprett ny behandling' })).toBeInTheDocument(); + expect(screen.getByRole('menuitem', { name: 'Opprett verge/fullmektig' })).toBeInTheDocument(); }); }); diff --git a/packages/sak-meny/package.json b/packages/sak-meny/package.json index f372a53d98..828f756ca1 100644 --- a/packages/sak-meny/package.json +++ b/packages/sak-meny/package.json @@ -7,7 +7,7 @@ "dependencies": { "@fpsak-frontend/assets": "1.0.0", "@fpsak-frontend/shared-components": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "react": "18.3.1", "react-intl": "7.0.1" }, diff --git a/packages/sak-meny/src/MenySakIndex.spec.tsx b/packages/sak-meny/src/MenySakIndex.spec.tsx index 81c6360189..ce4d847ebc 100644 --- a/packages/sak-meny/src/MenySakIndex.spec.tsx +++ b/packages/sak-meny/src/MenySakIndex.spec.tsx @@ -1,7 +1,6 @@ import { renderWithIntl } from '@fpsak-frontend/utils-test/test-utils'; import { act, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import React from 'react'; import messages from '../i18n/nb_NO.json'; import MenyData from './MenyData'; import MenySakIndex from './MenySakIndex'; @@ -17,11 +16,11 @@ describe('', () => { { messages }, ); - expect(screen.queryByRole('button', { name: 'Lag ny behandling' })).not.toBeInTheDocument(); + expect(screen.queryByRole('menuitem', { name: 'Lag ny behandling' })).not.toBeInTheDocument(); await act(async () => { await userEvent.click(screen.getByRole('button', { name: 'Behandlingsmeny' })); }); - expect(screen.getByRole('button', { name: 'Lag ny behandling' })).toBeInTheDocument(); + expect(screen.getByRole('menuitem', { name: 'Lag ny behandling' })).toBeInTheDocument(); }); it('skal åpne modal ved trykk på menyinnslag og så lukke den ved å bruke funksjon for lukking', async () => { @@ -34,14 +33,14 @@ describe('', () => { { messages }, ); - expect(screen.queryByRole('button', { name: 'Lag ny behandling' })).not.toBeInTheDocument(); + expect(screen.queryByRole('menuitem', { name: 'Lag ny behandling' })).not.toBeInTheDocument(); await act(async () => { await userEvent.click(screen.getByRole('button', { name: 'Behandlingsmeny' })); }); - expect(screen.getByRole('button', { name: 'Lag ny behandling' })).toBeInTheDocument(); + expect(screen.getByRole('menuitem', { name: 'Lag ny behandling' })).toBeInTheDocument(); await act(async () => { await userEvent.click(screen.getByRole('button', { name: 'Behandlingsmeny' })); }); - expect(screen.queryByRole('button', { name: 'Lag ny behandling' })).not.toBeInTheDocument(); + expect(screen.queryByRole('menuitem', { name: 'Lag ny behandling' })).not.toBeInTheDocument(); }); }); diff --git a/packages/sak-meny/src/MenySakIndex.tsx b/packages/sak-meny/src/MenySakIndex.tsx index 1bc7c61dfa..f20e81e367 100644 --- a/packages/sak-meny/src/MenySakIndex.tsx +++ b/packages/sak-meny/src/MenySakIndex.tsx @@ -1,10 +1,7 @@ -import closedImage from '@fpsak-frontend/assets/images/pil_ned.svg'; -import openImage from '@fpsak-frontend/assets/images/pil_opp.svg'; -import { Image } from '@fpsak-frontend/shared-components'; -import { Button } from '@navikt/ds-react'; -import { BoxedListWithSelection, Popover } from '@navikt/ft-plattform-komponenter'; -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import { FormattedMessage, RawIntlProvider, createIntl, createIntlCache } from 'react-intl'; +import { ChevronDownIcon } from '@navikt/aksel-icons'; +import { ActionMenu, Button } from '@navikt/ds-react'; +import { useState } from 'react'; +import { RawIntlProvider, createIntl, createIntlCache } from 'react-intl'; import messages from '../i18n/nb_NO.json'; import MenyData from './MenyData'; @@ -24,63 +21,24 @@ interface OwnProps { const MenySakIndex = ({ data }: OwnProps) => { const filtrertData = data.filter(d => d.erSynlig); - - const [visMenySomApen, setVisMenyTilApen] = useState(false); - const toggleMenyVisning = useCallback(() => setVisMenyTilApen(!visMenySomApen), [visMenySomApen]); - const [valgtModal, setValgtModal] = useState(-1); - const menyRef = useRef(null); - const handleClickOutside = event => { - if (menyRef.current && !menyRef.current.contains(event.target)) { - toggleMenyVisning(); - } - }; - useEffect(() => { - if (visMenySomApen) { - document.addEventListener('mousedown', handleClickOutside); - } - return () => { - document.removeEventListener('mousedown', handleClickOutside); - }; - }, [visMenySomApen]); - return ( -
- ( - ({ - name: d.tekst, - }))} - onClick={index => { - setValgtModal(index); - toggleMenyVisning(); - }} - /> - ), - placement: 'bottom-start', - strategy: 'absolute', - }} - referenceProps={{ - children: ({ ref }) => ( -
- -
- ), - }} - /> -
+ + + + + + {filtrertData.map((d, index) => ( + setValgtModal(index)} className="cursor-pointer"> + {d.tekst} + + ))} + + {valgtModal !== -1 && filtrertData[valgtModal].modal(() => setValgtModal(-1))}
); diff --git a/packages/sak-visittkort/package.json b/packages/sak-visittkort/package.json index d37db2fbb9..a55df0e509 100644 --- a/packages/sak-visittkort/package.json +++ b/packages/sak-visittkort/package.json @@ -10,7 +10,7 @@ "@fpsak-frontend/utils": "1.0.0", "@k9-sak-web/sak-app": "1.0.0", "@k9-sak-web/types": "1.0.0", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "dayjs": "1.11.13", "moment": "2.30.1", "react": "18.3.1", diff --git a/packages/shared-components/package.json b/packages/shared-components/package.json index abc72baf22..25ed6a7a1b 100644 --- a/packages/shared-components/package.json +++ b/packages/shared-components/package.json @@ -15,7 +15,7 @@ "@navikt/aksel-icons": "7.6.0", "@navikt/ds-react": "7.6.0", "@navikt/fnrvalidator": "2.1.5", - "@navikt/ft-plattform-komponenter": "5.3.0", + "@navikt/ft-plattform-komponenter": "5.3.1", "axios": "1.7.9", "classnames": "2.5.1", "date-fns": "4.1.0", diff --git a/yarn.lock b/yarn.lock index 3e80612418..318dbf8087 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2651,7 +2651,7 @@ __metadata: "@fpsak-frontend/utils": 1.0.0 "@fpsak-frontend/utils-test": 1.0.0 "@navikt/ft-form-hooks": 5.2.9 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 i18n-iso-countries: 7.13.0 moment: 2.30.1 prop-types: 15.8.1 @@ -2749,7 +2749,7 @@ __metadata: "@fpsak-frontend/shared-components": 1.0.0 "@fpsak-frontend/utils": 1.0.0 "@fpsak-frontend/utils-test": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 classnames: 2.5.1 formik: 2.4.6 moment: 2.30.1 @@ -3090,7 +3090,7 @@ __metadata: "@fpsak-frontend/utils-test": 1.0.0 "@k9-sak-web/prosess-felles": 1.0.0 "@k9-sak-web/types": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 classnames: 2.5.1 dayjs: 1.11.13 lodash: 4.17.21 @@ -3118,7 +3118,7 @@ __metadata: "@k9-sak-web/prosess-felles": 1.0.0 "@k9-sak-web/sak-app": 1.0.0 "@k9-sak-web/types": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 classnames: 2.5.1 moment: 2.30.1 react: 18.3.1 @@ -3276,7 +3276,7 @@ __metadata: "@fpsak-frontend/assets": 1.0.0 "@fpsak-frontend/shared-components": 1.0.0 "@fpsak-frontend/utils-test": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 react: 18.3.1 react-intl: 7.0.1 languageName: unknown @@ -3333,7 +3333,7 @@ __metadata: "@fpsak-frontend/utils": 1.0.0 "@k9-sak-web/sak-app": 1.0.0 "@k9-sak-web/types": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 dayjs: 1.11.13 moment: 2.30.1 react: 18.3.1 @@ -3355,7 +3355,7 @@ __metadata: "@navikt/aksel-icons": 7.6.0 "@navikt/ds-react": 7.6.0 "@navikt/fnrvalidator": 2.1.5 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 axios: 1.7.9 classnames: 2.5.1 date-fns: 4.1.0 @@ -3918,7 +3918,7 @@ __metadata: "@k9-sak-web/modal-sett-pa-vent": 1.0.0 "@k9-sak-web/rest-api-hooks": 1.0.0 "@k9-sak-web/types": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 classnames: 2.5.1 react: 18.3.1 react-intl: 7.0.1 @@ -4252,7 +4252,7 @@ __metadata: "@navikt/ds-css": 7.6.0 "@navikt/ds-icons": 3.4.3 "@navikt/ds-react": 7.6.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@popperjs/core": 2.11.8 classnames: 2.5.1 dayjs: 1.11.13 @@ -4261,7 +4261,6 @@ __metadata: react-collapse: 5.1.1 react-dom: 18.3.1 react-hook-form: 7.53.2 - react-popper: 2.3.0 vite: ^6.0.3 vite-plugin-node-polyfills: ^0.22.0 languageName: unknown @@ -4275,7 +4274,7 @@ __metadata: "@navikt/ds-icons": 3.4.3 "@navikt/ds-react": 7.6.0 "@navikt/ft-form-hooks": 5.2.9 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@popperjs/core": 2.11.8 classnames: 2.5.1 dayjs: 1.11.13 @@ -4284,7 +4283,6 @@ __metadata: react-collapse: 5.1.1 react-dom: 18.3.1 react-hook-form: 7.53.2 - react-popper: 2.3.0 vite: ^6.0.3 vite-plugin-node-polyfills: ^0.22.0 languageName: unknown @@ -4296,7 +4294,7 @@ __metadata: dependencies: "@fpsak-frontend/form": "*" "@k9-sak-web/types": "*" - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 formik: 2.4.6 languageName: unknown linkType: soft @@ -4310,7 +4308,7 @@ __metadata: "@navikt/ds-css": 7.6.0 "@navikt/ds-icons": 3.4.3 "@navikt/ds-react": 7.6.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@popperjs/core": 2.11.8 "@tanstack/react-query": ^5.62.8 axios: 1.7.9 @@ -4323,7 +4321,6 @@ __metadata: react-dom: 18.3.1 react-hook-form: 7.53.2 react-outside-click-handler: 1.3.0 - react-popper: 2.3.0 vite: ^6.0.3 vite-plugin-node-polyfills: ^0.22.0 languageName: unknown @@ -4334,7 +4331,7 @@ __metadata: resolution: "@k9-sak-web/fakta-om-barnet@workspace:packages/fakta-om-barnet" dependencies: "@navikt/ds-react": 7.6.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@popperjs/core": 2.11.8 classnames: 2.5.1 dayjs: 1.11.13 @@ -4343,7 +4340,6 @@ __metadata: react-collapse: 5.1.1 react-dom: 18.3.1 react-hook-form: 7.53.2 - react-popper: 2.3.0 tailwindcss: ^3.4.17 vite: ^6.0.3 vite-plugin-node-polyfills: ^0.22.0 @@ -4358,7 +4354,7 @@ __metadata: "@navikt/ds-icons": 3.4.3 "@navikt/ds-react": 7.6.0 "@navikt/fnrvalidator": 2.1.5 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@popperjs/core": 2.11.8 classnames: 2.5.1 dayjs: 1.11.13 @@ -4369,7 +4365,6 @@ __metadata: react-dom: 18.3.1 react-hook-form: 7.53.2 react-intl: 7.0.1 - react-popper: 2.3.0 vite: ^6.0.3 vite-plugin-node-polyfills: ^0.22.0 languageName: unknown @@ -4384,7 +4379,7 @@ __metadata: "@k9-sak-web/types": "*" "@navikt/ds-icons": 3.4.3 "@navikt/ds-react": 7.6.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 classnames: 2.5.1 dayjs: 1.11.13 formik: 2.4.6 @@ -4570,7 +4565,7 @@ __metadata: "@navikt/ds-react": 7.6.0 "@navikt/ft-form-hooks": 5.2.9 "@navikt/ft-form-validators": 2.5.7 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@popperjs/core": 2.11.8 classnames: 2.5.1 dayjs: 1.11.13 @@ -4578,7 +4573,6 @@ __metadata: react-collapse: 5.1.1 react-dom: 18.3.1 react-hook-form: 7.53.2 - react-popper: 2.3.0 vite: ^6.0.3 vite-plugin-node-polyfills: ^0.22.0 yup: 1.6.1 @@ -4609,7 +4603,7 @@ __metadata: "@fpsak-frontend/kodeverk": 1.0.0 "@fpsak-frontend/shared-components": 1.0.0 "@fpsak-frontend/utils": 1.0.0 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 classnames: 2.5.1 lodash: 4.17.21 react: 18.3.1 @@ -4694,7 +4688,7 @@ __metadata: "@navikt/ds-react": 7.6.0 "@navikt/ft-fakta-beregning": 7.1.10 "@navikt/ft-form-hooks": 5.2.9 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@navikt/ft-prosess-beregningsgrunnlag": 7.1.10 "@navikt/ft-ui-komponenter": 2.6.5 "@sentry/browser": 8.46.0 @@ -5069,9 +5063,9 @@ __metadata: languageName: node linkType: hard -"@navikt/ft-plattform-komponenter@npm:5.3.0": - version: 5.3.0 - resolution: "@navikt/ft-plattform-komponenter@npm:5.3.0::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40navikt%2Fft-plattform-komponenter%2F5.3.0%2F1eb1fe81f102e4c8421cb6869e66e28fd7703ba8" +"@navikt/ft-plattform-komponenter@npm:5.3.1": + version: 5.3.1 + resolution: "@navikt/ft-plattform-komponenter@npm:5.3.1::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40navikt%2Fft-plattform-komponenter%2F5.3.1%2Ff1c9955a24f1c1088233f5089324a60a3d466cf3" dependencies: "@navikt/aksel-icons": 7.6.0 "@navikt/ds-css": 7.6.0 @@ -5088,8 +5082,7 @@ __metadata: prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1 - react-popper: 2.3.0 - checksum: 579e9a4baf06f2d4866068be1018ed2d6e9b433f0e302283b9fb22cf00c4d4e8d4d7bb492ca4d1e9ba35d4d0824bc4415b96be94144fda4c52a8a7ffa51566f1 + checksum: 49d29597d5eab49073ac65fd070f1143a5c9b98ee31e58497cc943e873faed0de5dfa7020ab257aa7ed063fdd43186f8d16f6105accd907b65a84c30de9a6454 languageName: node linkType: hard @@ -12997,7 +12990,7 @@ __metadata: "@navikt/ds-react": 7.6.0 "@navikt/ds-tailwind": ^7.6.0 "@navikt/familie-endringslogg": 13.1.4 - "@navikt/ft-plattform-komponenter": 5.3.0 + "@navikt/ft-plattform-komponenter": 5.3.1 "@playwright/test": ^1.49.1 "@popperjs/core": 2.11.8 "@sentry/browser": 8.46.0 @@ -13050,7 +13043,6 @@ __metadata: prettier: 3.4.2 react: 18.3.1 react-dom: 18.3.1 - react-popper: 2.3.0 react-router: 7.0.2 storybook: ^8.4.7 stylelint: 16.12.0 @@ -15232,13 +15224,6 @@ __metadata: languageName: node linkType: hard -"react-fast-compare@npm:^3.0.1": - version: 3.2.2 - resolution: "react-fast-compare@npm:3.2.2" - checksum: 2071415b4f76a3e6b55c84611c4d24dcb12ffc85811a2840b5a3f1ff2d1a99be1020d9437ee7c6e024c9f4cbb84ceb35e48cf84f28fcb00265ad2dfdd3947704 - languageName: node - linkType: hard - "react-hook-form@npm:7.53.2": version: 7.53.2 resolution: "react-hook-form@npm:7.53.2" @@ -15328,20 +15313,6 @@ __metadata: languageName: node linkType: hard -"react-popper@npm:2.3.0": - version: 2.3.0 - resolution: "react-popper@npm:2.3.0" - dependencies: - react-fast-compare: ^3.0.1 - warning: ^4.0.2 - peerDependencies: - "@popperjs/core": ^2.0.0 - react: ^16.8.0 || ^17 || ^18 - react-dom: ^16.8.0 || ^17 || ^18 - checksum: 837111c98738011c69b3069a464ea5bdcbf487105b6148e8faf90cb7337e134edb1b98b8824322941c378756cca30a15c18c25f558e53b85ed5762fa0dc8e6b2 - languageName: node - linkType: hard - "react-redux@npm:9.2.0": version: 9.2.0 resolution: "react-redux@npm:9.2.0" @@ -17941,7 +17912,7 @@ __metadata: languageName: node linkType: hard -"warning@npm:^4.0.2, warning@npm:^4.0.3": +"warning@npm:^4.0.3": version: 4.0.3 resolution: "warning@npm:4.0.3" dependencies: