From eac416af96dabc956276512f812e32f34fac2549 Mon Sep 17 00:00:00 2001 From: Daniel Eriksson Date: Wed, 20 Dec 2023 11:47:29 +0100 Subject: [PATCH] Remove inngang. The only entry-point for this app is via the external page nav.no/klage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Skrøvseth --- frontend/.vscode/settings.json | 2 +- frontend/package-lock.json | 502 +++++------------- frontend/package.json | 20 +- frontend/src/breadcrumbs/use-breadcrumbs.ts | 47 -- .../begrunnelse/anke-begrunnelse-page.tsx | 5 - .../innsending/anke-innsending-page.tsx | 2 - .../kvittering/anke-kvittering-page.tsx | 4 - .../summary/anke-oppsummering-page.tsx | 4 - .../begrunnelse/anke-begrunnelse-page.tsx | 4 - .../innsending/anke-innsending-page.tsx | 2 - .../summary/anke-oppsummering-page.tsx | 4 - .../components/attachments/attachments.tsx | 8 +- .../src/components/attachments/file-icon.tsx | 6 +- .../components/attachments/upload-button.tsx | 7 +- .../autosave-progress/autosave-progress.tsx | 6 +- .../common/digital/digital-form-container.tsx | 2 - .../case/common/post/innsending-page.tsx | 7 +- .../case/common/post/post-form-container.tsx | 2 - .../case/innlogget/kvittering/kvittering.tsx | 4 +- .../innlogget/summary/finalize-digital.tsx | 4 +- .../components/case/uinnlogget/saksnummer.tsx | 4 +- .../uinnlogget/summary/download-button.tsx | 4 +- .../delete-case-button/delete-case-button.tsx | 20 +- .../icon-link-panel/icon-link-panel.tsx | 46 -- .../begrunnelse/klage-begrunnelse-page.tsx | 6 +- .../innsending/klage-innsending-page.tsx | 2 - .../kvittering/klage-kvittering-page.tsx | 4 - .../summary/klage-oppsummering-page.tsx | 4 - .../begrunnelse/klage-begrunnelse-page.tsx | 7 +- .../innsending/klage-innsending-page.tsx | 2 - .../summary/klage-oppsummering-page.tsx | 4 - frontend/src/components/link/link.tsx | 5 +- .../personalised-content/available-anker.tsx | 67 --- .../personalised-content/draft-anke.tsx | 46 -- .../personalised-content/draft-anker.tsx | 50 -- .../personalised-content/draft-klage.tsx | 46 -- .../personalised-content/draft-klager.tsx | 54 -- .../personalised-content.tsx | 21 - .../components/text-loader/text-loader.tsx | 36 -- .../components/text-loader/title-loader.tsx | 20 - frontend/src/functions/query-string.ts | 64 --- frontend/src/hooks/use-innsendingsytelser.ts | 13 - frontend/src/icons/clipboard.tsx | 1 + frontend/src/icons/document.tsx | 39 -- frontend/src/icons/envelope.tsx | 1 + frontend/src/icons/external-link.tsx | 8 +- frontend/src/icons/law-book.tsx | 35 -- frontend/src/icons/letter-opened.tsx | 51 -- frontend/src/index.tsx | 25 +- .../innsendingsytelser/innsendingsytelser.ts | 2 +- frontend/src/kategorier/kategorier.ts | 339 ------------ frontend/src/language/en.tsx | 99 +--- frontend/src/language/nb.tsx | 106 +--- frontend/src/logging/amplitude.ts | 70 --- frontend/src/logging/error-report/action.ts | 1 + .../src/logging/error-report/error-report.ts | 3 +- frontend/src/logging/use-log-page-view.ts | 9 - frontend/src/redux-api/case/anke/api.ts | 63 +-- frontend/src/redux-api/case/anke/types.ts | 29 +- frontend/src/redux-api/case/klage/api.ts | 58 -- frontend/src/redux-api/case/klage/types.ts | 5 +- frontend/src/redux-api/user/api.ts | 3 +- frontend/src/redux/session/session.ts | 1 - frontend/src/routes/error-boundary.tsx | 38 ++ frontend/src/routes/inngang/guide-panel.tsx | 16 - frontend/src/routes/inngang/kategori.tsx | 108 ---- .../klage-anke-knapper/anke-link-panel.tsx | 44 -- .../klage-anke-knapper/klage-link-panel.tsx | 41 -- .../inngang/styled-components/panels.tsx | 32 -- .../routes/inngang/tema-with-kategorier.tsx | 89 ---- frontend/src/routes/inngang/temaer.tsx | 100 ---- frontend/src/routes/landing-page.tsx | 11 +- frontend/src/routes/not-found-page.tsx | 45 +- frontend/src/routes/query-params-handler.tsx | 13 +- frontend/src/routes/routes.tsx | 108 ++-- frontend/src/routes/sentry-fallback.tsx | 16 - .../src/simple-api-state/simple-api-state.ts | 3 - .../src/styled-components/main-container.tsx | 5 - frontend/webpack.config.js | 3 +- 79 files changed, 312 insertions(+), 2475 deletions(-) delete mode 100644 frontend/src/breadcrumbs/use-breadcrumbs.ts delete mode 100644 frontend/src/components/icon-link-panel/icon-link-panel.tsx delete mode 100644 frontend/src/components/personalised-content/available-anker.tsx delete mode 100644 frontend/src/components/personalised-content/draft-anke.tsx delete mode 100644 frontend/src/components/personalised-content/draft-anker.tsx delete mode 100644 frontend/src/components/personalised-content/draft-klage.tsx delete mode 100644 frontend/src/components/personalised-content/draft-klager.tsx delete mode 100644 frontend/src/components/personalised-content/personalised-content.tsx delete mode 100644 frontend/src/components/text-loader/text-loader.tsx delete mode 100644 frontend/src/components/text-loader/title-loader.tsx delete mode 100644 frontend/src/functions/query-string.ts delete mode 100644 frontend/src/icons/document.tsx delete mode 100644 frontend/src/icons/law-book.tsx delete mode 100644 frontend/src/icons/letter-opened.tsx delete mode 100644 frontend/src/kategorier/kategorier.ts delete mode 100644 frontend/src/logging/amplitude.ts delete mode 100644 frontend/src/logging/use-log-page-view.ts create mode 100644 frontend/src/routes/error-boundary.tsx delete mode 100644 frontend/src/routes/inngang/guide-panel.tsx delete mode 100644 frontend/src/routes/inngang/kategori.tsx delete mode 100644 frontend/src/routes/inngang/klage-anke-knapper/anke-link-panel.tsx delete mode 100644 frontend/src/routes/inngang/klage-anke-knapper/klage-link-panel.tsx delete mode 100644 frontend/src/routes/inngang/styled-components/panels.tsx delete mode 100644 frontend/src/routes/inngang/tema-with-kategorier.tsx delete mode 100644 frontend/src/routes/inngang/temaer.tsx delete mode 100644 frontend/src/routes/sentry-fallback.tsx diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json index e928b87f..cd248b56 100644 --- a/frontend/.vscode/settings.json +++ b/frontend/.vscode/settings.json @@ -12,7 +12,7 @@ "editor.linkedEditing": true, "editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "typescript.validate.enable": true, "typescript.tsdk": "node_modules/typescript/lib", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ffdfc989..6c350f67 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,36 +9,30 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@navikt/ds-css": "^5.12.0", - "@navikt/ds-icons": "^3.4.3", - "@navikt/ds-react": "^5.12.0", + "@navikt/aksel-icons": "^5.12.1", + "@navikt/ds-css": "^5.12.1", + "@navikt/ds-react": "^5.12.1", "@navikt/fnrvalidator": "^1.3.3", "@navikt/nav-dekoratoren-moduler": "^2.1.5", "@reduxjs/toolkit": "^2.0.1", - "@sentry/react": "^7.88.0", - "@sentry/tracing": "^7.88.0", "@styled-icons/material": "^10.47.0", - "amplitude-js": "^8.21.9", "classnames": "^2.3.2", - "date-fns": "^2.30.0", + "date-fns": "^3.0.1", "dayjs": "^1.11.10", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "^9.0.4", "react-router": "^6.21.0", "react-router-dom": "^6.21.0", - "redux": "^5.0.0", - "styled-components": "^6.1.1" + "styled-components": "6.1.1" }, "devDependencies": { - "@types/amplitude-js": "^8.16.5", "@types/jest": "^29.5.11", "@types/react": "^18.2.45", "@types/react-dom": "^18.2.18", - "@types/styled-components": "^5.1.34", "@types/webpack-env": "^1.18.4", - "@typescript-eslint/eslint-plugin": "^6.14.0", - "@typescript-eslint/parser": "^6.14.0", + "@typescript-eslint/eslint-plugin": "^6.15.0", + "@typescript-eslint/parser": "^6.15.0", "copyfiles": "^2.4.1", "css-loader": "^6.8.1", "eslint": "^8.56.0", @@ -48,7 +42,7 @@ "eslint-plugin-jest": "^27.6.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-prettier": "^5.0.1", + "eslint-plugin-prettier": "^5.1.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "fork-ts-checker-webpack-plugin": "^9.0.2", @@ -72,49 +66,6 @@ "node": ">=0.10.0" } }, - "node_modules/@amplitude/analytics-connector": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@amplitude/analytics-connector/-/analytics-connector-1.5.0.tgz", - "integrity": "sha512-T8mOYzB9RRxckzhL0NTHwdge9xuFxXEOplC8B1Y3UX3NHa3BLh7DlBUZlCOwQgMc2nxDfnSweDL5S3bhC+W90g==" - }, - "node_modules/@amplitude/types": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/@amplitude/types/-/types-1.10.2.tgz", - "integrity": "sha512-I8qenRI7uU6wKNb9LiZrAosSHVoNHziXouKY81CrqxH9xhVTEIJFXeuCV0hbtBr0Al/8ejnGjQRx+S2SvU/pPg==", - "engines": { - "node": ">=10" - } - }, - "node_modules/@amplitude/ua-parser-js": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/@amplitude/ua-parser-js/-/ua-parser-js-0.7.33.tgz", - "integrity": "sha512-wKEtVR4vXuPT9cVEIJkYWnlF++Gx3BdLatPBM+SZ1ztVIvnhdGBZR/mn9x/PzyrMcRlZmyi6L56I2J3doVBnjA==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/ua-parser-js" - }, - { - "type": "paypal", - "url": "https://paypal.me/faisalman" - } - ], - "engines": { - "node": "*" - } - }, - "node_modules/@amplitude/utils": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/@amplitude/utils/-/utils-1.10.2.tgz", - "integrity": "sha512-tVsHXu61jITEtRjB7NugQ5cVDd4QDzne8T3ifmZye7TiJeUfVRvqe44gDtf55A+7VqhDhyEIIXTA1iVcDGqlEw==", - "dependencies": { - "@amplitude/types": "^1.10.2", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -1403,36 +1354,26 @@ "dev": true }, "node_modules/@navikt/aksel-icons": { - "version": "5.12.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/5.12.0/e0e20adaee0177bd961092fed5dfa33f1a098013", - "integrity": "sha512-q7rhK/TaFx1ZN05i2p3R9kNMnbTa4G5Cbl2Dj36aaiLKcGt4GHLIrkBwjehhLDFrB9LK/jfhKuPC0J9cs1JOhw==", + "version": "5.12.1", + "resolved": "https://npm.pkg.github.com/download/@navikt/aksel-icons/5.12.1/bf1bb720875f7f1cb929c67fc052ae039f63b6dd", + "integrity": "sha512-4L0dARUYII+cQONZyNv5sZhZPdK0GaVtW0hw0LVQB1yzmOVQL2mGOf12jxUbMkAwKAwa1eroEAeaPVgzjpb2Ww==", "license": "MIT" }, "node_modules/@navikt/ds-css": { - "version": "5.12.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/5.12.0/dc3aaa060688cc71abea57fd3d02dd590824e147", - "integrity": "sha512-UPgwKoya6WcU9q0H3w3Of6G/sBoJEboXMVwhJAHKA1jYA03RfoW3+Jtrl24OxY/su37OJMmGUws3pN5htfys+w==", + "version": "5.12.1", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-css/5.12.1/fa9d949d7eb2cc61218322a1f6bbd1a4bfe6e670", + "integrity": "sha512-3lkNLgDW1h4RjcDgmlqb5ELOgYPuH3HhXaQM/kAmMy0T4bsbDDANhl1o7cC+fcmDrgaayfnn05uMRXtPblQqBA==", "license": "MIT" }, - "node_modules/@navikt/ds-icons": { - "version": "3.4.3", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-icons/3.4.3/eaa8fc38f6d184806d3405a5efbc9d137c2b8d27", - "integrity": "sha512-Ys25tnDUzS+AtagMMW4/154OCZy+pTxCv9uiV4YcZUeXMfjnMiRWx1dueyCODb7FF7Jd6TwELd3G6ieQt/rf+w==", - "license": "MIT", - "peerDependencies": { - "@types/react": "^17.0.30 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" - } - }, "node_modules/@navikt/ds-react": { - "version": "5.12.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/5.12.0/5ed9bddf4aa7ab451f648c717d702306e7a0ac2c", - "integrity": "sha512-1eYtOcseQ/6w8sInvSh7mqJl8tlNeUZ9j/FjkUBiZ1yQkYli3iU8muBbncQodRndjLyzpSkNbn+ttfQIAJ0exg==", + "version": "5.12.1", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-react/5.12.1/ffd68467c74f804a9f457fa0f56badb229dc3975", + "integrity": "sha512-6CwV66IwRuGxtJ1HAr18kTa3kVA4+T6pKHbHXRJkJZN2ELVk1306/zoOzHzyiuShvmEISoTH3X+na0DMRgNG1A==", "license": "MIT", "dependencies": { "@floating-ui/react": "0.25.4", - "@navikt/aksel-icons": "^5.12.0", - "@navikt/ds-tokens": "^5.12.0", + "@navikt/aksel-icons": "^5.12.1", + "@navikt/ds-tokens": "^5.12.1", "@radix-ui/react-tabs": "1.0.0", "@radix-ui/react-toggle-group": "1.0.0", "clsx": "^1.2.1", @@ -1444,10 +1385,38 @@ "react": "^17.0.0 || ^18.0.0" } }, + "node_modules/@navikt/ds-react/node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, + "node_modules/@navikt/ds-react/node_modules/react-day-picker": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.3.4.tgz", + "integrity": "sha512-UuCbfZ69DhQmd+UhEv8nCPp5PxMk7ioNTuOLMlU0X7q3wd7o8TKDdsjduQoeBYTPTMS3LFdbA1qqbrIpRHo/Vg==", + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/gpbl" + }, + "peerDependencies": { + "date-fns": "^2.28.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/@navikt/ds-tokens": { - "version": "5.12.0", - "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/5.12.0/fcbcfb2f4bd0a7e374255deff8ca2575fdc216da", - "integrity": "sha512-0PCjnUqSdUv+fb64XD6OErbz8fXojYRyULrDmfld2Jh/KazrMPsf2/XI7+BYve7NnvCoNUCsge8ANdU6A0hDOA==", + "version": "5.12.1", + "resolved": "https://npm.pkg.github.com/download/@navikt/ds-tokens/5.12.1/5fb81244c46f2a29269b50b344195ce3ba9ae00e", + "integrity": "sha512-oM2bXHPxhz6LW4qEFF1O+vTDBw3xZxZV2RLnMK3qQHqCWsTjb4AW4mq+4DW19KyYXV5e2vrPMqOjbv4qnNDj9A==", "license": "MIT" }, "node_modules/@navikt/fnrvalidator": { @@ -1777,121 +1746,6 @@ "node": ">=14.0.0" } }, - "node_modules/@sentry-internal/feedback": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.88.0.tgz", - "integrity": "sha512-lbK6jgO1I0M96nZQ99mcLSZ55ebwPAP6LhEWhkmc+eAfy97VpiY+qsbmgsmOzCEPqMmEUCEcI0rEZ7fiye2v2Q==", - "dependencies": { - "@sentry/core": "7.88.0", - "@sentry/types": "7.88.0", - "@sentry/utils": "7.88.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@sentry-internal/tracing": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.88.0.tgz", - "integrity": "sha512-xXQdcYhsS+ourzJHjXNjZC9zakuc97udmpgaXRjEP7FjPYclIx+YXwgFBdHM2kzAwZLFOsEce5dr46GVXUDfZw==", - "dependencies": { - "@sentry/core": "7.88.0", - "@sentry/types": "7.88.0", - "@sentry/utils": "7.88.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/browser": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.88.0.tgz", - "integrity": "sha512-il4x3PB99nuU/OJQw2RltgYYbo8vtnYoIgneOeEiw4m0ppK1nKkMkd3vDRipGL6E/0i7IUmQfYYy6U10J5Rx+g==", - "dependencies": { - "@sentry-internal/feedback": "7.88.0", - "@sentry-internal/tracing": "7.88.0", - "@sentry/core": "7.88.0", - "@sentry/replay": "7.88.0", - "@sentry/types": "7.88.0", - "@sentry/utils": "7.88.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/core": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.88.0.tgz", - "integrity": "sha512-Jzbb7dcwiCO7kI0a1w+32UzWxbEn2OcZWzp55QMEeAh6nZ/5CXhXwpuHi0tW7doPj+cJdmxMTMu9LqMVfdGkzQ==", - "dependencies": { - "@sentry/types": "7.88.0", - "@sentry/utils": "7.88.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/react": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.88.0.tgz", - "integrity": "sha512-iDOImijbsc0cYLWNBXlYKhh/sG/czPK/51GcMi3GcEBkhHDDcdWSZ7cNjFAqHfdrMkPf26bYgDPIL6aJsBZwpQ==", - "dependencies": { - "@sentry/browser": "7.88.0", - "@sentry/types": "7.88.0", - "@sentry/utils": "7.88.0", - "hoist-non-react-statics": "^3.3.2" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "react": "15.x || 16.x || 17.x || 18.x" - } - }, - "node_modules/@sentry/replay": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.88.0.tgz", - "integrity": "sha512-em5dPKLPG7c/HGDbpIj3aHrWbA4iMwqjevqTzn+++KNO1YslkOosCaGsb1whU3AL1T9c3aIFIhZ4u3rNo+DxcA==", - "dependencies": { - "@sentry-internal/tracing": "7.88.0", - "@sentry/core": "7.88.0", - "@sentry/types": "7.88.0", - "@sentry/utils": "7.88.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@sentry/tracing": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.88.0.tgz", - "integrity": "sha512-Lj4hhLraalN4w3swXkP2do1hcaQVOuLvO6eJJbcwf10b+P4CcdlwAnqvxOOCNxA5VzG4/K2BqQ8LRU4S0Ulj9A==", - "dependencies": { - "@sentry-internal/tracing": "7.88.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/types": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.88.0.tgz", - "integrity": "sha512-FvwvmX1pWAZKicPj4EpKyho8Wm+C4+r5LiepbbBF8oKwSPJdD2QV1fo/LWxsrzNxWOllFIVIXF5Ed3nPYQWpTw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/utils": { - "version": "7.88.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.88.0.tgz", - "integrity": "sha512-ukminfRmdBXTzk49orwJf3Lu3hR60ZRHjE2a4IXwYhyDT6JJgJqgsq1hzGXx0AyFfyS4WhfZ6QUBy7fu3BScZQ==", - "dependencies": { - "@sentry/types": "7.88.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1949,12 +1803,6 @@ "styled-components": ">=4.1.0 <6" } }, - "node_modules/@types/amplitude-js": { - "version": "8.16.5", - "resolved": "https://registry.npmjs.org/@types/amplitude-js/-/amplitude-js-8.16.5.tgz", - "integrity": "sha512-W73JfDpwDH4VijOGo+nVuQOqUCiqyEGGVdajU4ziWTLn27cn+QtFuFuBdlhCraIIrO52fDRO4NSOGkawtn77Jw==", - "dev": true - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2035,9 +1883,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.44.9", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.9.tgz", - "integrity": "sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-FlsN0p4FhuYRjIxpbdXovvHQhtlG05O1GG/RNWvdAxTboR438IOTwmrY/vLA+Xfgg06BTkP045M3vpFwTMv1dg==", "dev": true, "dependencies": { "@types/estree": "*", @@ -2093,16 +1941,6 @@ "@types/node": "*" } }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", - "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", - "dev": true, - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -2286,17 +2124,6 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, - "node_modules/@types/styled-components": { - "version": "5.1.34", - "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.34.tgz", - "integrity": "sha512-mmiVvwpYklFIv9E8qfxuPyIt/OuyIrn6gMOAMOFUO3WJfSrSE+sGUoa4PiZj77Ut7bKZpaa6o1fBKS/4TOEvnA==", - "dev": true, - "dependencies": { - "@types/hoist-non-react-statics": "*", - "@types/react": "*", - "csstype": "^3.0.2" - } - }, "node_modules/@types/stylis": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.4.tgz", @@ -2338,16 +2165,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz", - "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.15.0.tgz", + "integrity": "sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/type-utils": "6.15.0", + "@typescript-eslint/utils": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2373,15 +2200,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz", - "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.15.0.tgz", + "integrity": "sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/typescript-estree": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/typescript-estree": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0", "debug": "^4.3.4" }, "engines": { @@ -2401,13 +2228,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", - "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.15.0.tgz", + "integrity": "sha512-+BdvxYBltqrmgCNu4Li+fGDIkW9n//NrruzG9X1vBzaNK+ExVXPoGB71kneaVw/Jp+4rH/vaMAGC6JfMbHstVg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0" + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2418,13 +2245,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz", - "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.15.0.tgz", + "integrity": "sha512-CnmHKTfX6450Bo49hPg2OkIm/D/TVYV7jO1MCfPYGwf6x3GO0VU8YMO5AYMn+u3X05lRRxA4fWCz87GFQV6yVQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.14.0", - "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/typescript-estree": "6.15.0", + "@typescript-eslint/utils": "6.15.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2445,9 +2272,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", - "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.15.0.tgz", + "integrity": "sha512-yXjbt//E4T/ee8Ia1b5mGlbNj9fB9lJP4jqLbZualwpP2BCQ5is6BcWwxpIsY4XKAhmdv3hrW92GdtJbatC6dQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2458,13 +2285,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", - "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.15.0.tgz", + "integrity": "sha512-7mVZJN7Hd15OmGuWrp2T9UvqR2Ecg+1j/Bp1jXUEY2GZKV6FXlOIoqVDmLpBiEiq3katvj/2n2mR0SDwtloCew==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/visitor-keys": "6.15.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2485,17 +2312,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", - "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.15.0.tgz", + "integrity": "sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/scope-manager": "6.15.0", + "@typescript-eslint/types": "6.15.0", + "@typescript-eslint/typescript-estree": "6.15.0", "semver": "^7.5.4" }, "engines": { @@ -2510,12 +2337,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", - "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.15.0.tgz", + "integrity": "sha512-1zvtdC1a9h5Tb5jU9x3ADNXO9yjP8rXlaoChu0DQX40vf5ACVpYIVIZhIMZ6d5sDXH7vq4dsZBT1fEGj8D2n2w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/types": "6.15.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2853,19 +2680,6 @@ "ajv": "^6.9.1" } }, - "node_modules/amplitude-js": { - "version": "8.21.9", - "resolved": "https://registry.npmjs.org/amplitude-js/-/amplitude-js-8.21.9.tgz", - "integrity": "sha512-d0jJH00wbXu7sxKtVwkdSXtVffjqdUrxuACKlnzP7jU5qt9wriXXMgHifdH5Oq+buKmyF8wKL9S02gAykysURA==", - "dependencies": { - "@amplitude/analytics-connector": "^1.4.6", - "@amplitude/ua-parser-js": "0.7.33", - "@amplitude/utils": "^1.10.2", - "@babel/runtime": "^7.21.0", - "blueimp-md5": "^2.19.0", - "query-string": "8.1.0" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -3290,11 +3104,6 @@ "node": ">=8" } }, - "node_modules/blueimp-md5": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", - "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==" - }, "node_modules/body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", @@ -4025,18 +3834,12 @@ } }, "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.0.1.tgz", + "integrity": "sha512-cr9igCUa0QSqgAMj7JOrYTY6Nh1rmyGrFDko7ADqfmaQqP/I2N4rlfrLl7AWuzDaoIpz6MNjoEcTPzgZYIrhnA==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" } }, "node_modules/dayjs": { @@ -4066,14 +3869,6 @@ "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "peer": true }, - "node_modules/decode-uri-component": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", - "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", - "engines": { - "node": ">=14.16" - } - }, "node_modules/dedent": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", @@ -4463,9 +4258,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.614", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz", - "integrity": "sha512-X4ze/9Sc3QWs6h92yerwqv7aB/uU8vCjZcrMjA8N9R1pjMFRe44dLsck5FzLilOYvcXuDn93B+bpGYyufc70gQ==", + "version": "1.4.615", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.615.tgz", + "integrity": "sha512-/bKPPcgZVUziECqDc+0HkT87+0zhaWSZHNXqF8FLd2lQcptpmUFwoCSWjCdOng9Gdq+afKArPdEg/0ZW461Eng==", "dev": true }, "node_modules/emittery": { @@ -5074,9 +4869,9 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz", - "integrity": "sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.0.tgz", + "integrity": "sha512-hQc+2zbnMeXcIkg+pKZtVa+3Yqx4WY7SMkn1PLZ4VbBEU7jJIpVn9347P8BBhTbz6ne85aXvQf30kvexcqBeWw==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", @@ -5091,6 +4886,7 @@ "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", + "eslint-config-prettier": "*", "prettier": ">=3.0.0" }, "peerDependenciesMeta": { @@ -5479,9 +5275,9 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -5532,17 +5328,6 @@ "node": ">=8" } }, - "node_modules/filter-obj": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", - "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/finalhandler": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", @@ -6067,14 +5852,6 @@ "node": ">= 0.4" } }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, "node_modules/hpack.js": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", @@ -8763,12 +8540,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/pretty-format/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -8799,6 +8570,12 @@ "react-is": "^16.13.1" } }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -8866,22 +8643,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/query-string": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-8.1.0.tgz", - "integrity": "sha512-BFQeWxJOZxZGix7y+SByG3F36dA0AbTy9o6pSmKFcFz7DAj0re9Frkty3saBn3nHo3D0oZJ/+rx3r8H8r8Jbpw==", - "dependencies": { - "decode-uri-component": "^0.4.1", - "filter-obj": "^5.1.0", - "split-on-first": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -8961,19 +8722,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-day-picker": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.3.4.tgz", - "integrity": "sha512-UuCbfZ69DhQmd+UhEv8nCPp5PxMk7ioNTuOLMlU0X7q3wd7o8TKDdsjduQoeBYTPTMS3LFdbA1qqbrIpRHo/Vg==", - "funding": { - "type": "individual", - "url": "https://github.com/sponsors/gpbl" - }, - "peerDependencies": { - "date-fns": "^2.28.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", @@ -8987,9 +8735,10 @@ } }, "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true }, "node_modules/react-property": { "version": "2.0.0", @@ -9822,17 +9571,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/split-on-first": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", - "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 555b5238..ee41adb1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,14 +14,12 @@ "lint-fix": "eslint src --color --fix" }, "devDependencies": { - "@types/amplitude-js": "^8.16.5", "@types/jest": "^29.5.11", "@types/react": "^18.2.45", "@types/react-dom": "^18.2.18", - "@types/styled-components": "^5.1.34", "@types/webpack-env": "^1.18.4", - "@typescript-eslint/eslint-plugin": "^6.14.0", - "@typescript-eslint/parser": "^6.14.0", + "@typescript-eslint/eslint-plugin": "^6.15.0", + "@typescript-eslint/parser": "^6.15.0", "copyfiles": "^2.4.1", "css-loader": "^6.8.1", "eslint": "^8.56.0", @@ -31,7 +29,7 @@ "eslint-plugin-jest": "^27.6.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-prettier": "^5.0.1", + "eslint-plugin-prettier": "^5.1.0", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "fork-ts-checker-webpack-plugin": "^9.0.2", @@ -46,25 +44,21 @@ "webpack-dev-server": "^4.15.1" }, "dependencies": { - "@navikt/ds-css": "^5.12.0", - "@navikt/ds-icons": "^3.4.3", - "@navikt/ds-react": "^5.12.0", + "@navikt/aksel-icons": "^5.12.1", + "@navikt/ds-css": "^5.12.1", + "@navikt/ds-react": "^5.12.1", "@navikt/fnrvalidator": "^1.3.3", "@navikt/nav-dekoratoren-moduler": "^2.1.5", "@reduxjs/toolkit": "^2.0.1", - "@sentry/react": "^7.88.0", - "@sentry/tracing": "^7.88.0", "@styled-icons/material": "^10.47.0", - "amplitude-js": "^8.21.9", "classnames": "^2.3.2", - "date-fns": "^2.30.0", + "date-fns": "^3.0.1", "dayjs": "^1.11.10", "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "^9.0.4", "react-router": "^6.21.0", "react-router-dom": "^6.21.0", - "redux": "^5.0.0", "styled-components": "^6.1.1" } } \ No newline at end of file diff --git a/frontend/src/breadcrumbs/use-breadcrumbs.ts b/frontend/src/breadcrumbs/use-breadcrumbs.ts deleted file mode 100644 index e719cafc..00000000 --- a/frontend/src/breadcrumbs/use-breadcrumbs.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { onBreadcrumbClick, setBreadcrumbs } from '@navikt/nav-dekoratoren-moduler'; -import { useEffect } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { currentPath } from '@app/routes/current-path'; - -export interface Breadcrumb { - url: string; - title: string; - handleInApp?: boolean; -} - -export const useBreadcrumbs = (breadcrumbs: Breadcrumb[] | null, currentTitle: string | null) => { - const navigate = useNavigate(); - const { inngang } = useTranslation(); - const lang = useLanguage(); - - useEffect(() => { - if (breadcrumbs === null) { - setBreadcrumbs([]); - - return; - } - - onBreadcrumbClick(({ url }) => navigate(url)); - - const hovedkategorierBreadcrumb: Breadcrumb = { - title: inngang.hovedkategorier.title, - url: `/${lang}/`, - handleInApp: true, - }; - - if (currentTitle === null) { - setBreadcrumbs([hovedkategorierBreadcrumb, ...breadcrumbs]); - - return; - } - - const currentPageBreadcrumb: Breadcrumb = { - title: currentTitle, - url: currentPath(window.location), - handleInApp: true, - }; - setBreadcrumbs([hovedkategorierBreadcrumb, ...breadcrumbs, currentPageBreadcrumb]); - }, [currentTitle, breadcrumbs, navigate, inngang.hovedkategorier.title, lang]); -}; diff --git a/frontend/src/components/anke/innlogget/begrunnelse/anke-begrunnelse-page.tsx b/frontend/src/components/anke/innlogget/begrunnelse/anke-begrunnelse-page.tsx index d60bd76a..039b728e 100644 --- a/frontend/src/components/anke/innlogget/begrunnelse/anke-begrunnelse-page.tsx +++ b/frontend/src/components/anke/innlogget/begrunnelse/anke-begrunnelse-page.tsx @@ -5,10 +5,8 @@ import { useAnkeErrors } from '@app/hooks/use-errors'; import { useUser } from '@app/hooks/use-user'; import { useLanguage } from '@app/language/use-language'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { AppEventEnum } from '@app/logging/error-report/action'; import { addAppEvent } from '@app/logging/error-report/error-report'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { useDeleteAnkeMutation, useDeleteAttachmentMutation, @@ -41,9 +39,6 @@ const RenderAnkebegrunnelsePage = ({ anke }: Props) => { const navigate = useNavigate(); const language = useLanguage(); const { data: user } = useUser(); - - useLogPageView(PageIdentifier.ANKESKJEMA_BEGRUNNElSE); - const { ankeskjema } = useTranslation(); const [deleteAttachment] = useDeleteAttachmentMutation(); diff --git a/frontend/src/components/anke/innlogget/innsending/anke-innsending-page.tsx b/frontend/src/components/anke/innlogget/innsending/anke-innsending-page.tsx index 70dcf36a..e00d170e 100644 --- a/frontend/src/components/anke/innlogget/innsending/anke-innsending-page.tsx +++ b/frontend/src/components/anke/innlogget/innsending/anke-innsending-page.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { useAnkeErrors, useGoToBegrunnelseOnError } from '@app/hooks/use-errors'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { Anke } from '@app/redux-api/case/anke/types'; import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page'; import { AnkeLoader } from '../anke-loader'; @@ -21,7 +20,6 @@ const AnkeinnsendingPageWrapper = ({ anke }: Props) => { ); diff --git a/frontend/src/components/anke/innlogget/kvittering/anke-kvittering-page.tsx b/frontend/src/components/anke/innlogget/kvittering/anke-kvittering-page.tsx index 322e5a39..e4772e10 100644 --- a/frontend/src/components/anke/innlogget/kvittering/anke-kvittering-page.tsx +++ b/frontend/src/components/anke/innlogget/kvittering/anke-kvittering-page.tsx @@ -2,8 +2,6 @@ import React from 'react'; import { Navigate } from 'react-router-dom'; import { useLanguage } from '@app/language/use-language'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { useGetAnkeQuery } from '@app/redux-api/case/anke/api'; import { Anke } from '@app/redux-api/case/anke/types'; import { CaseStatus } from '@app/redux-api/case/types'; @@ -23,8 +21,6 @@ const RenderAnkekvitteringPage = ({ anke }: Props) => { const language = useLanguage(); const { ankeskjema } = useTranslation(); - useLogPageView(PageIdentifier.ANKESKJEMA_KVITTERING); - if (anke.status !== CaseStatus.DONE) { return ; } diff --git a/frontend/src/components/anke/innlogget/summary/anke-oppsummering-page.tsx b/frontend/src/components/anke/innlogget/summary/anke-oppsummering-page.tsx index c143d9f1..34b3f4d4 100644 --- a/frontend/src/components/anke/innlogget/summary/anke-oppsummering-page.tsx +++ b/frontend/src/components/anke/innlogget/summary/anke-oppsummering-page.tsx @@ -6,8 +6,6 @@ import { useAnkeErrors } from '@app/hooks/use-errors'; import { useIsAuthenticated, useUser } from '@app/hooks/use-user'; import { Clipboard } from '@app/icons/clipboard'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { Anke } from '@app/redux-api/case/anke/types'; import { CaseStatus } from '@app/redux-api/case/types'; import { API_PATH } from '@app/redux-api/common'; @@ -38,8 +36,6 @@ const DigitalAnkeoppsummeringPage = ({ anke }: Props) => { const { data: user, isLoading: userIsLoading } = useUser(); - useLogPageView(PageIdentifier.ANKESKJEMA_OPPSUMMERING); - const { isValid } = useAnkeErrors(anke); if (userIsLoading || typeof user === 'undefined') { diff --git a/frontend/src/components/anke/uinnlogget/begrunnelse/anke-begrunnelse-page.tsx b/frontend/src/components/anke/uinnlogget/begrunnelse/anke-begrunnelse-page.tsx index b593f25e..d14ce54e 100644 --- a/frontend/src/components/anke/uinnlogget/begrunnelse/anke-begrunnelse-page.tsx +++ b/frontend/src/components/anke/uinnlogget/begrunnelse/anke-begrunnelse-page.tsx @@ -7,10 +7,8 @@ import { useSessionAnkeUpdate } from '@app/hooks/use-session-anke-update'; import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { useLanguage } from '@app/language/use-language'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { AppEventEnum } from '@app/logging/error-report/action'; import { addAppEvent } from '@app/logging/error-report/error-report'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { useAppDispatch } from '@app/redux/configure-store'; import { deleteSessionAnke } from '@app/redux/session/session'; import { CenteredContainer } from '@app/styled-components/common'; @@ -44,8 +42,6 @@ const RenderAnkebegrunnelsePage = ({ anke }: Props) => { const dispatch = useAppDispatch(); const language = useLanguage(); - useLogPageView(PageIdentifier.ANKESKJEMA_BEGRUNNElSE); - const { ankeskjema, ankeskjema_post } = useTranslation(); const { errors, isValid, isEverythingValid, setError } = useSessionAnkeErrors(anke); diff --git a/frontend/src/components/anke/uinnlogget/innsending/anke-innsending-page.tsx b/frontend/src/components/anke/uinnlogget/innsending/anke-innsending-page.tsx index 2beec837..46b0a002 100644 --- a/frontend/src/components/anke/uinnlogget/innsending/anke-innsending-page.tsx +++ b/frontend/src/components/anke/uinnlogget/innsending/anke-innsending-page.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { useGoToBegrunnelseOnError, useSessionAnkeErrors } from '@app/hooks/use-errors'; import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page'; import { AnkeSessionLoader } from '../anke-session-loader'; import { ISessionAnke } from '../types'; @@ -24,7 +23,6 @@ const SessionAnkeWrapper = ({ anke }: { anke: ISessionAnke }) => { ); diff --git a/frontend/src/components/anke/uinnlogget/summary/anke-oppsummering-page.tsx b/frontend/src/components/anke/uinnlogget/summary/anke-oppsummering-page.tsx index ec604399..a3cdc035 100644 --- a/frontend/src/components/anke/uinnlogget/summary/anke-oppsummering-page.tsx +++ b/frontend/src/components/anke/uinnlogget/summary/anke-oppsummering-page.tsx @@ -6,8 +6,6 @@ import { useSessionAnkeErrors } from '@app/hooks/use-errors'; import { Clipboard } from '@app/icons/clipboard'; import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { CenteredContainer } from '@app/styled-components/common'; import { CenteredHeading } from '@app/styled-components/page-title'; import { PostFormContainer } from '../../../case/common/post/post-form-container'; @@ -33,8 +31,6 @@ interface IProps { const PostAnkeoppsummeringPage = ({ anke }: IProps) => { const { common, ankeskjema } = useTranslation(); - useLogPageView(PageIdentifier.ANKESKJEMA_OPPSUMMERING); - const { isValid } = useSessionAnkeErrors(anke); const { steps, title_fragment, page_title } = ankeskjema.common; diff --git a/frontend/src/components/attachments/attachments.tsx b/frontend/src/components/attachments/attachments.tsx index 4ecee424..500ecfbb 100644 --- a/frontend/src/components/attachments/attachments.tsx +++ b/frontend/src/components/attachments/attachments.tsx @@ -1,4 +1,4 @@ -import { Close, Delete } from '@navikt/ds-icons'; +import { TrashIcon, XMarkIcon } from '@navikt/aksel-icons'; import { Alert, BodyLong, Button, ErrorSummary, Label, Loader } from '@navikt/ds-react'; import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; import React, { useState } from 'react'; @@ -68,10 +68,10 @@ export const AttachmentsSection = ({ ); diff --git a/frontend/src/components/case/uinnlogget/saksnummer.tsx b/frontend/src/components/case/uinnlogget/saksnummer.tsx index 233738d9..06fa6ec0 100644 --- a/frontend/src/components/case/uinnlogget/saksnummer.tsx +++ b/frontend/src/components/case/uinnlogget/saksnummer.tsx @@ -1,4 +1,4 @@ -import { Edit } from '@navikt/ds-icons'; +import { PencilIcon } from '@navikt/aksel-icons'; import { BodyShort, Button, Label } from '@navikt/ds-react'; import React from 'react'; import { styled } from 'styled-components'; @@ -25,7 +25,7 @@ export const Saksnummer = ({ translations, internalSaksnummer, ...props }: Saksn title={translations.begrunnelse.saksnummer.change} onClick={onClick} size="small" - icon={} + icon={} variant="tertiary" /> diff --git a/frontend/src/components/case/uinnlogget/summary/download-button.tsx b/frontend/src/components/case/uinnlogget/summary/download-button.tsx index 1b261623..43f7060a 100644 --- a/frontend/src/components/case/uinnlogget/summary/download-button.tsx +++ b/frontend/src/components/case/uinnlogget/summary/download-button.tsx @@ -1,4 +1,4 @@ -import { Download } from '@navikt/ds-icons'; +import { DownloadIcon } from '@navikt/aksel-icons'; import { Button } from '@navikt/ds-react'; import dayjs from 'dayjs'; import React, { useState } from 'react'; @@ -89,7 +89,7 @@ export const DownloadButton = ({ caseData, type, validForm }: Props) => { variant="primary" onClick={submitKlage} loading={pdfLoading} - icon={} + icon={} iconPosition="left" > {common.download} diff --git a/frontend/src/components/delete-case-button/delete-case-button.tsx b/frontend/src/components/delete-case-button/delete-case-button.tsx index 791939a2..ff9710de 100644 --- a/frontend/src/components/delete-case-button/delete-case-button.tsx +++ b/frontend/src/components/delete-case-button/delete-case-button.tsx @@ -1,4 +1,4 @@ -import { Delete } from '@navikt/ds-icons'; +import { TrashIcon } from '@navikt/aksel-icons'; import { Button } from '@navikt/ds-react'; import React, { useState } from 'react'; import { useTranslation } from '@app/language/use-translation'; @@ -17,7 +17,13 @@ export const DeleteCaseButton = ({ onDelete, isLoading, title }: Props) => { if (!showConfirm) { return ( - ); }; diff --git a/frontend/src/components/icon-link-panel/icon-link-panel.tsx b/frontend/src/components/icon-link-panel/icon-link-panel.tsx deleted file mode 100644 index 6463d67c..00000000 --- a/frontend/src/components/icon-link-panel/icon-link-panel.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { LinkPanel, LinkPanelProps } from '@navikt/ds-react'; -import React from 'react'; -import { styled } from 'styled-components'; -import { device } from '@app/styled-components/media-queries'; - -type Props = { - icon: JSX.Element; - as?: T; -} & React.ComponentProps & - LinkPanelProps; - -export const IconLinkPanel = ({ icon, children, ...props }: Props) => ( - - - {icon} - {children} - - -); - -const StyledContainer = styled.div` - display: flex; - flex-direction: column; - align-items: center; - - @media ${device.mobileL} { - flex-direction: row; - } -`; - -const StyledIcon = styled.div` - display: flex; - align-items: center; - justify-content: center; - margin: 8px; - margin-right: 24px; - - svg { - width: 60px; - height: 80px; - } -`; - -const StyledText = styled.div` - height: 100%; -`; diff --git a/frontend/src/components/klage/innlogget/begrunnelse/klage-begrunnelse-page.tsx b/frontend/src/components/klage/innlogget/begrunnelse/klage-begrunnelse-page.tsx index 0559719c..f494e0e8 100644 --- a/frontend/src/components/klage/innlogget/begrunnelse/klage-begrunnelse-page.tsx +++ b/frontend/src/components/klage/innlogget/begrunnelse/klage-begrunnelse-page.tsx @@ -5,10 +5,8 @@ import { useKlageErrors } from '@app/hooks/use-errors'; import { useUser } from '@app/hooks/use-user'; import { useLanguage } from '@app/language/use-language'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { AppEventEnum } from '@app/logging/error-report/action'; import { addAppEvent } from '@app/logging/error-report/error-report'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { useDeleteAttachmentMutation, useDeleteKlageMutation, @@ -42,8 +40,6 @@ const RenderKlagebegrunnelsePage = ({ klage }: Props) => { const language = useLanguage(); const { data: user } = useUser(); - useLogPageView(PageIdentifier.KLAGESKJEMA_BEGRUNNElSE); - const { klageskjema } = useTranslation(); const [deleteAttachment] = useDeleteAttachmentMutation(); @@ -68,6 +64,8 @@ const RenderKlagebegrunnelsePage = ({ klage }: Props) => { return; } + addAppEvent(AppEventEnum.VALID); + navigate(NEXT_PAGE_URL); }; diff --git a/frontend/src/components/klage/innlogget/innsending/klage-innsending-page.tsx b/frontend/src/components/klage/innlogget/innsending/klage-innsending-page.tsx index 4d3c6b33..e87a98b9 100644 --- a/frontend/src/components/klage/innlogget/innsending/klage-innsending-page.tsx +++ b/frontend/src/components/klage/innlogget/innsending/klage-innsending-page.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { useGoToBegrunnelseOnError, useKlageErrors } from '@app/hooks/use-errors'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { Klage } from '@app/redux-api/case/klage/types'; import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page'; import { KlageLoader } from '../klage-loader'; @@ -17,7 +16,6 @@ const KlageWrapper = ({ klage }: { klage: Klage }) => { ); diff --git a/frontend/src/components/klage/innlogget/kvittering/klage-kvittering-page.tsx b/frontend/src/components/klage/innlogget/kvittering/klage-kvittering-page.tsx index 3a8d8bf0..1011271e 100644 --- a/frontend/src/components/klage/innlogget/kvittering/klage-kvittering-page.tsx +++ b/frontend/src/components/klage/innlogget/kvittering/klage-kvittering-page.tsx @@ -2,8 +2,6 @@ import React from 'react'; import { Navigate } from 'react-router-dom'; import { useLanguage } from '@app/language/use-language'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { useGetKlageQuery } from '@app/redux-api/case/klage/api'; import { Klage } from '@app/redux-api/case/klage/types'; import { CaseStatus } from '@app/redux-api/case/types'; @@ -23,8 +21,6 @@ const RenderKlagekvitteringPage = ({ klage }: Props) => { const language = useLanguage(); const { klageskjema } = useTranslation(); - useLogPageView(PageIdentifier.KLAGESKJEMA_KVITTERING); - if (klage.status !== CaseStatus.DONE) { return ; } diff --git a/frontend/src/components/klage/innlogget/summary/klage-oppsummering-page.tsx b/frontend/src/components/klage/innlogget/summary/klage-oppsummering-page.tsx index 0ab878ee..386088a9 100644 --- a/frontend/src/components/klage/innlogget/summary/klage-oppsummering-page.tsx +++ b/frontend/src/components/klage/innlogget/summary/klage-oppsummering-page.tsx @@ -5,8 +5,6 @@ import { styled } from 'styled-components'; import { useIsAuthenticated, useUser } from '@app/hooks/use-user'; import { Clipboard } from '@app/icons/clipboard'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { Klage } from '@app/redux-api/case/klage/types'; import { CaseStatus } from '@app/redux-api/case/types'; import { API_PATH } from '@app/redux-api/common'; @@ -38,8 +36,6 @@ const DigitalKlageoppsummeringPage = ({ klage }: Props) => { const { data: user, isLoading: userIsLoading } = useUser(); - useLogPageView(PageIdentifier.KLAGESKJEMA_OPPSUMMERING); - if (userIsLoading || typeof user === 'undefined') { return null; } diff --git a/frontend/src/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page.tsx b/frontend/src/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page.tsx index 16753a71..88d31658 100644 --- a/frontend/src/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page.tsx +++ b/frontend/src/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page.tsx @@ -2,15 +2,14 @@ import { BodyLong, Button, Checkbox, GuidePanel } from '@navikt/ds-react'; import React from 'react'; import { useNavigate } from 'react-router'; import { Link } from 'react-router-dom'; +import { ENVIRONMENT } from '@app/environment/environment'; import { useSessionKlageErrors } from '@app/hooks/use-errors'; import { useSessionKlageUpdate } from '@app/hooks/use-session-klage-update'; import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { useLanguage } from '@app/language/use-language'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; import { AppEventEnum } from '@app/logging/error-report/action'; import { addAppEvent } from '@app/logging/error-report/error-report'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { useAppDispatch } from '@app/redux/configure-store'; import { deleteSessionKlage } from '@app/redux/session/session'; import { CenteredContainer } from '@app/styled-components/common'; @@ -44,8 +43,6 @@ const RenderKlagebegrunnelsePage = ({ klage }: Props) => { const dispatch = useAppDispatch(); const language = useLanguage(); - useLogPageView(PageIdentifier.KLAGESKJEMA_BEGRUNNElSE); - const { klageskjema, klageskjema_post } = useTranslation(); const { errors, isValid, isEverythingValid, setError } = useSessionKlageErrors(klage); @@ -84,6 +81,8 @@ const RenderKlagebegrunnelsePage = ({ klage }: Props) => { {klageskjema_post.employer_info} + {ENVIRONMENT.isProduction ? null : <>05906498040} + { ); diff --git a/frontend/src/components/klage/uinnlogget/summary/klage-oppsummering-page.tsx b/frontend/src/components/klage/uinnlogget/summary/klage-oppsummering-page.tsx index b4c55630..ad02ed3a 100644 --- a/frontend/src/components/klage/uinnlogget/summary/klage-oppsummering-page.tsx +++ b/frontend/src/components/klage/uinnlogget/summary/klage-oppsummering-page.tsx @@ -6,8 +6,6 @@ import { useSessionKlageErrors } from '@app/hooks/use-errors'; import { Clipboard } from '@app/icons/clipboard'; import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; import { CenteredContainer } from '@app/styled-components/common'; import { CenteredHeading } from '@app/styled-components/page-title'; import { PostFormContainer } from '../../../case/common/post/post-form-container'; @@ -35,8 +33,6 @@ const PostKlageoppsummeringPage = ({ klage }: Props) => { const { common, klageskjema } = useTranslation(); const { isValid } = useSessionKlageErrors(klage); - useLogPageView(PageIdentifier.KLAGESKJEMA_OPPSUMMERING); - const { steps, title_fragment, page_title } = klageskjema.common; return ( diff --git a/frontend/src/components/link/link.tsx b/frontend/src/components/link/link.tsx index ff1f04d6..34b96710 100644 --- a/frontend/src/components/link/link.tsx +++ b/frontend/src/components/link/link.tsx @@ -1,7 +1,6 @@ import { Link, LinkProps } from '@navikt/ds-react'; import React from 'react'; import { ExtLink } from '@app/icons/external-link'; -import { Optional } from '../optional/optional'; interface ExternalLinkProps extends Omit { openInSameWindow?: boolean; @@ -16,8 +15,6 @@ export const ExternalLink = ({ openInSameWindow = false, inline = false, childre style={{ display: inline ? 'inline' : undefined }} > {children} - - - + {openInSameWindow ? null : } ); diff --git a/frontend/src/components/personalised-content/available-anker.tsx b/frontend/src/components/personalised-content/available-anker.tsx deleted file mode 100644 index 3231e83f..00000000 --- a/frontend/src/components/personalised-content/available-anker.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { Heading, LinkPanel } from '@navikt/ds-react'; -import { skipToken } from '@reduxjs/toolkit/query'; -import React from 'react'; -import { Link } from 'react-router-dom'; -import { isoDateTimeToPretty } from '@app/domain/date/date'; -import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { LawBook } from '@app/icons/law-book'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { useGetAvailableAnkerQuery } from '@app/redux-api/case/anke/api'; -import { AvailableAnke } from '@app/redux-api/case/anke/types'; -import { InngangPanel } from '@app/routes/inngang/styled-components/panels'; -import { IconLinkPanel } from '../icon-link-panel/icon-link-panel'; - -interface Props { - innsendingsytelser: Innsendingsytelse[]; -} - -export const AvailableAnker = ({ innsendingsytelser }: Props) => { - const { data: isAuthenticated } = useIsAuthenticated(); - const { data, isLoading } = useGetAvailableAnkerQuery(isAuthenticated === true ? undefined : skipToken); - const { personalised } = useTranslation(); - - if (isLoading || typeof data === 'undefined') { - return null; - } - - const hasFilter = innsendingsytelser.length !== 0; - - const anker = data - .filter( - (anke) => - !hasFilter || innsendingsytelser.some((innsendingsytelse) => anke.innsendingsytelse === innsendingsytelse), - ) - .map((anke) => ); - - if (anker.length === 0) { - return null; - } - - return ( - - - {personalised.available_anker.title} - - {anker} - - ); -}; - -const Anke = (anke: AvailableAnke) => { - const lang = useLanguage(); - const { personalised } = useTranslation(); - - const [title] = useInnsendingsytelseName(anke.innsendingsytelse); - - return ( - } as={Link} to={`/${lang}/anke/${anke.id}/begrunnelse`} border> - {title} - - {personalised.available_anker.klage_date}: {isoDateTimeToPretty(anke.vedtakDate)} - - - ); -}; diff --git a/frontend/src/components/personalised-content/draft-anke.tsx b/frontend/src/components/personalised-content/draft-anke.tsx deleted file mode 100644 index 22d1cf28..00000000 --- a/frontend/src/components/personalised-content/draft-anke.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { LinkPanel } from '@navikt/ds-react'; -import React from 'react'; -import { Link } from 'react-router-dom'; -import { ISODateTime, isoDateTimeToPretty } from '@app/domain/date/date'; -import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser'; -import { LawBook } from '@app/icons/law-book'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { Anke } from '@app/redux-api/case/anke/types'; -import { IconLinkPanel } from '../icon-link-panel/icon-link-panel'; -import { TextLoader } from '../text-loader/text-loader'; - -export const ApiAnke = (anke: Anke) => { - const lang = useLanguage(); - - return ( - - ); -}; - -interface Props { - to: string; - modified: ISODateTime; - innsendingsytelse: Innsendingsytelse; -} - -const Anke = ({ to, modified, innsendingsytelse }: Props) => { - const { common } = useTranslation(); - const [title, isLoading] = useInnsendingsytelseName(innsendingsytelse); - - return ( - } as={Link} to={to} border> - - {title} - - - {common.last_changed}: {isoDateTimeToPretty(modified)} - - - ); -}; diff --git a/frontend/src/components/personalised-content/draft-anker.tsx b/frontend/src/components/personalised-content/draft-anker.tsx deleted file mode 100644 index bfa8d27a..00000000 --- a/frontend/src/components/personalised-content/draft-anker.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Heading } from '@navikt/ds-react'; -import { skipToken } from '@reduxjs/toolkit/query'; -import React, { useMemo } from 'react'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useTranslation } from '@app/language/use-translation'; -import { useGetAnkerQuery } from '@app/redux-api/case/anke/api'; -import { InngangPanel } from '@app/routes/inngang/styled-components/panels'; -import { ApiAnke } from './draft-anke'; - -interface Props { - innsendingsytelser: Innsendingsytelse[]; -} - -export const DraftAnker = (props: Props) => { - const { personalised } = useTranslation(); - - const apiAnker = useApiAnker(props).map((anke) => ); - - if (apiAnker.length === 0) { - return null; - } - - return ( - - - {personalised.draft_anker.title} - - {apiAnker} - - ); -}; - -const useApiAnker = ({ innsendingsytelser }: Props) => { - const { data: isAuthenticated } = useIsAuthenticated(); - const { data, isLoading } = useGetAnkerQuery(isAuthenticated === true ? undefined : skipToken); - - const hasFilter = innsendingsytelser.length !== 0; - - const filtered = useMemo( - () => data?.filter((anke) => !hasFilter || innsendingsytelser.includes(anke.innsendingsytelse)) ?? [], - [data, hasFilter, innsendingsytelser], - ); - - if (isLoading || typeof data === 'undefined' || data.length === 0) { - return []; - } - - return filtered; -}; diff --git a/frontend/src/components/personalised-content/draft-klage.tsx b/frontend/src/components/personalised-content/draft-klage.tsx deleted file mode 100644 index b89d8a41..00000000 --- a/frontend/src/components/personalised-content/draft-klage.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { LinkPanel } from '@navikt/ds-react'; -import React from 'react'; -import { Link } from 'react-router-dom'; -import { ISODateTime, isoDateTimeToPretty } from '@app/domain/date/date'; -import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser'; -import { LetterOpened } from '@app/icons/letter-opened'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { Klage } from '@app/redux-api/case/klage/types'; -import { IconLinkPanel } from '../icon-link-panel/icon-link-panel'; -import { TextLoader } from '../text-loader/text-loader'; - -export const ApiKlage = (klage: Klage) => { - const lang = useLanguage(); - - return ( - - ); -}; - -interface Props { - to: string; - modified: ISODateTime; - innsendingsytelse: Innsendingsytelse; -} - -const Klage = ({ to, innsendingsytelse, modified }: Props) => { - const { common } = useTranslation(); - const [title, isLoading] = useInnsendingsytelseName(innsendingsytelse); - - return ( - } as={Link} to={to} border> - - {title} - - - {common.last_changed}: {isoDateTimeToPretty(modified)} - - - ); -}; diff --git a/frontend/src/components/personalised-content/draft-klager.tsx b/frontend/src/components/personalised-content/draft-klager.tsx deleted file mode 100644 index 904fe9f9..00000000 --- a/frontend/src/components/personalised-content/draft-klager.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Heading } from '@navikt/ds-react'; -import { skipToken } from '@reduxjs/toolkit/query'; -import React, { useMemo } from 'react'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useTranslation } from '@app/language/use-translation'; -import { useGetKlagerQuery } from '@app/redux-api/case/klage/api'; -import { Klage } from '@app/redux-api/case/klage/types'; -import { InngangPanel } from '@app/routes/inngang/styled-components/panels'; -import { ApiKlage } from './draft-klage'; - -interface Props { - innsendingsytelser: Innsendingsytelse[]; -} - -export const DraftKlager = (props: Props) => { - const { personalised } = useTranslation(); - - const apiKlager = useApiKlager(props).map((klage) => ); - - if (apiKlager.length === 0) { - return null; - } - - return ( - - - {personalised.draft_klager.title} - - {apiKlager} - - ); -}; - -const useApiKlager = ({ innsendingsytelser }: Props): Klage[] => { - const { data: isAuthenticated } = useIsAuthenticated(); - const { data, isLoading } = useGetKlagerQuery(isAuthenticated === true ? undefined : skipToken); - - const hasFilter = innsendingsytelser.length !== 0; - - const filtered = useMemo(() => { - if (!hasFilter) { - return data ?? []; - } - - return data?.filter((klage) => !hasFilter || innsendingsytelser.includes(klage.innsendingsytelse)) ?? []; - }, [hasFilter, data, innsendingsytelser]); - - if (isAuthenticated !== true || isLoading || typeof data === 'undefined') { - return []; - } - - return filtered; -}; diff --git a/frontend/src/components/personalised-content/personalised-content.tsx b/frontend/src/components/personalised-content/personalised-content.tsx deleted file mode 100644 index 1f096186..00000000 --- a/frontend/src/components/personalised-content/personalised-content.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { AvailableAnker } from './available-anker'; -import { DraftAnker } from './draft-anker'; -import { DraftKlager } from './draft-klager'; - -interface Props { - innsendingsytelser?: Innsendingsytelse[]; -} - -export const DraftKlageAndAnkeLists = ({ innsendingsytelser = [] }: Props) => ( - <> - - - -); - -// eslint-disable-next-line import/no-unused-modules -export const AvailableAnkerList = ({ innsendingsytelser = [] }: Props) => ( - -); diff --git a/frontend/src/components/text-loader/text-loader.tsx b/frontend/src/components/text-loader/text-loader.tsx deleted file mode 100644 index 25272853..00000000 --- a/frontend/src/components/text-loader/text-loader.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import { keyframes, styled } from 'styled-components'; - -interface Props extends PlaceholderProps { - children: React.ReactNode; - isLoading: boolean; -} - -export const TextLoader = ({ children, isLoading, ...size }: Props) => - isLoading ? : {children}; - -const animation = keyframes` - 0% { - background-position: 100% 0%; - } - 100% { - background-position: -100% 0%; - } -`; - -interface PlaceholderProps { - $minWidth?: string; - $height?: string; -} - -const Placeholder = styled.span` - display: inline-block; - border-radius: 4px; - width: 100%; - min-width: ${({ $minWidth }) => $minWidth ?? 'inherit'}; - height: ${({ $height }) => $height ?? '1em'}; - background: #ccc; - background: linear-gradient(90deg, #ccc 0%, #ccc 33%, #ddd 50%, #ccc 66%, #ccc 100%); - background-size: 200% 100%; - animation: ${animation} 1.25s linear infinite; -`; diff --git a/frontend/src/components/text-loader/title-loader.tsx b/frontend/src/components/text-loader/title-loader.tsx deleted file mode 100644 index 398f684f..00000000 --- a/frontend/src/components/text-loader/title-loader.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useLanguage } from '@app/language/use-language'; -import { useGetInnsendingsytelserQuery } from '@app/redux-api/innsendingsytelser'; -import { TextLoader } from './text-loader'; - -interface Props { - innsendingsytelse: Innsendingsytelse; -} - -export const TitleLoader = ({ innsendingsytelse }: Props) => { - const lang = useLanguage(); - const { data, isLoading } = useGetInnsendingsytelserQuery(lang); - - return ( - - {data?.[innsendingsytelse] ?? innsendingsytelse} - - ); -}; diff --git a/frontend/src/functions/query-string.ts b/frontend/src/functions/query-string.ts deleted file mode 100644 index 6818acac..00000000 --- a/frontend/src/functions/query-string.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { isNotNull } from './is-not-type-guards'; - -export const queryStringify = (query: unknown): string => { - if (query === null || typeof query !== 'object') { - return ''; - } - - const entries: [string, unknown][] = Object.entries(query); - - if (entries.length === 0) { - return ''; - } - - const params = entries - .map(([key, value]) => { - if (value === null || value === undefined) { - return null; - } - - if (typeof value === 'number') { - return `${key}=${value.toString(10)}`; - } - - if (typeof value === 'string') { - return `${key}=${value}`; - } - - if (typeof value === 'boolean') { - return `${key}=${value.toString()}`; - } - - if (Array.isArray(value)) { - const arrayValue = value.map(stringifyValue).filter(isNotNull).join(','); - - return `${key}=${arrayValue}`; - } - - return null; - }) - .filter(isNotNull) - .join('&'); - - if (params.length === 0) { - return ''; - } - - return `?${params}`; -}; - -const stringifyValue = (value: string | number | boolean): string | null => { - if (typeof value === 'number') { - return value.toString(10); - } - - if (typeof value === 'boolean') { - return value.toString(); - } - - if (typeof value === 'string') { - return value; - } - - return null; -}; diff --git a/frontend/src/hooks/use-innsendingsytelser.ts b/frontend/src/hooks/use-innsendingsytelser.ts index e0d4ec1a..bef5fe96 100644 --- a/frontend/src/hooks/use-innsendingsytelser.ts +++ b/frontend/src/hooks/use-innsendingsytelser.ts @@ -14,16 +14,3 @@ export const useInnsendingsytelseName = (innsendingsytelse: Innsendingsytelse): return [data[innsendingsytelse] ?? innsendingsytelse, false]; }; - -export const useInnsendingsytelserNames = (innsendingsytelser: Innsendingsytelse[]): [string[], boolean] => { - const lang = useLanguage(); - const { data, isLoading } = useGetInnsendingsytelserQuery(lang); - - if (isLoading || typeof data === 'undefined') { - return [[], true]; - } - - const titles = innsendingsytelser.map((innsendingsytelse) => data[innsendingsytelse] ?? innsendingsytelse); - - return [titles, isLoading]; -}; diff --git a/frontend/src/icons/clipboard.tsx b/frontend/src/icons/clipboard.tsx index 2ce83c98..1e43d13e 100644 --- a/frontend/src/icons/clipboard.tsx +++ b/frontend/src/icons/clipboard.tsx @@ -12,6 +12,7 @@ const ClipboardSvg = (props: Props) => ( fill="none" viewBox="0 0 100 100" role="presentation" + aria-hidden > ( - - - - - - - - - - - -); - -export const Document = styled(DocumentSvg)` - width: 100px; -`; diff --git a/frontend/src/icons/envelope.tsx b/frontend/src/icons/envelope.tsx index f257ebf9..65f45c55 100644 --- a/frontend/src/icons/envelope.tsx +++ b/frontend/src/icons/envelope.tsx @@ -12,6 +12,7 @@ const EnvelopeSvg = (props: Props) => ( fill="none" viewBox="0 0 100 100" role="presentation" + aria-hidden > ( - + ); diff --git a/frontend/src/icons/law-book.tsx b/frontend/src/icons/law-book.tsx deleted file mode 100644 index bb86a369..00000000 --- a/frontend/src/icons/law-book.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import { styled } from 'styled-components'; - -interface Props { - className?: string; -} - -const LawBookSvg = (props: Props) => ( - - - - - -); - -export const LawBook = styled(LawBookSvg)` - width: 100px; -`; diff --git a/frontend/src/icons/letter-opened.tsx b/frontend/src/icons/letter-opened.tsx deleted file mode 100644 index a0c2cd73..00000000 --- a/frontend/src/icons/letter-opened.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from 'react'; -import { styled } from 'styled-components'; - -interface Props { - className?: string; -} - -const LetterOpenedSvg = (props: Props) => ( - - - - - - - -); - -export const LetterOpened = styled(LetterOpenedSvg)` - width: 67px; -`; diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index c450259a..4b3c9de8 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -1,9 +1,6 @@ import { injectDecoratorClientSide } from '@navikt/nav-dekoratoren-moduler'; -import * as Sentry from '@sentry/react'; -import { BrowserTracing } from '@sentry/tracing'; -import React, { useEffect } from 'react'; +import React from 'react'; import { createRoot } from 'react-dom/client'; -import { createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from 'react-router-dom'; import { App } from './app/app'; import { ENVIRONMENT } from './environment/environment'; @@ -20,26 +17,6 @@ if (ENVIRONMENT.isLocal) { }); } -Sentry.init({ - dsn: 'https://ec59cb6bad7f4a30be759b6cdfccc968@sentry.gc.nav.no/140', - integrations: [ - new BrowserTracing({ - routingInstrumentation: Sentry.reactRouterV6Instrumentation( - useEffect, - useLocation, - useNavigationType, - createRoutesFromChildren, - matchRoutes, - ), - }), - ], - tracesSampleRate: 1.0, - environment: ENVIRONMENT.environment, - release: ENVIRONMENT.version, - normalizeDepth: 10, - enabled: ENVIRONMENT.isDeployed, -}); - const container = document.getElementById('root'); if (container !== null) { diff --git a/frontend/src/innsendingsytelser/innsendingsytelser.ts b/frontend/src/innsendingsytelser/innsendingsytelser.ts index 38917a27..b4aa6bce 100644 --- a/frontend/src/innsendingsytelser/innsendingsytelser.ts +++ b/frontend/src/innsendingsytelser/innsendingsytelser.ts @@ -111,7 +111,7 @@ export enum Innsendingsytelse { FEIL = 'FEIL', } -const INNSENDINGSYTELSER = Object.values(Innsendingsytelse); +export const INNSENDINGSYTELSER = Object.values(Innsendingsytelse); export const ensureStringIsInnsendingsytelse = (value: string | null = null): Innsendingsytelse | null => { if (value === null) { diff --git a/frontend/src/kategorier/kategorier.ts b/frontend/src/kategorier/kategorier.ts deleted file mode 100644 index bbdef776..00000000 --- a/frontend/src/kategorier/kategorier.ts +++ /dev/null @@ -1,339 +0,0 @@ -/* eslint-disable max-lines */ -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { Languages } from '@app/language/types'; - -export type StringValue = { - [key in Languages]: string; -}; - -export enum TemaType { - TEMA = 'TEMA', - INNSENDINGSYTELSE = 'INNSENDINGSYTELSE', - EXTERNAL = 'EXTERNAL', -} - -export interface IExternalTema { - type: TemaType.EXTERNAL; - title: StringValue; - externalUrl: StringValue; -} - -export interface ITemaWithKategorier { - type: TemaType.TEMA; - path: string; - title: StringValue; - innsendingsytelser: IInnsendingsytelse[]; -} - -export interface IInnsendingsytelse { - type: TemaType.INNSENDINGSYTELSE; - path: string; - innsendingsytelse: Innsendingsytelse; - allowsAnke: boolean; -} - -type ITema = ITemaWithKategorier | IInnsendingsytelse | IExternalTema; - -export const INNGANG_KATEGORIER: ITema[] = [ - { - type: TemaType.TEMA, - title: { - [Languages.nb]: 'Arbeid', - [Languages.en]: 'Work', - }, - path: 'arbeid', - innsendingsytelser: [ - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.DAGPENGER, - allowsAnke: true, - path: 'dagpenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.DAGPENGER_TILBAKEBETALING_FORSKUDD, - allowsAnke: false, - path: 'dagpenger-tilbakebetaling-forskudd', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.ARBEIDSAVKLARINGSPENGER, - allowsAnke: true, - path: 'arbeidsavklaringspenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.LONNSGARANTI, - allowsAnke: false, - path: 'lonnsgaranti', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.TILTAKSPENGER, - allowsAnke: false, - - path: 'tiltakspenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.NAV_LOVEN_14A, - allowsAnke: false, - path: 'nav-loven-14a', - }, - ], - }, - { - type: TemaType.TEMA, - title: { [Languages.nb]: 'Helse', [Languages.en]: 'Health' }, - path: 'helse', - innsendingsytelser: [ - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.SYKEPENGER, - allowsAnke: true, - path: 'sykepenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.ARBEIDSAVKLARINGSPENGER, - allowsAnke: true, - path: 'arbeidsavklaringspenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.UFORETRYGD, - allowsAnke: true, - path: 'uforetrygd', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.SUPPLERENDE_STONAD_UFORE_FLYKTNINGER, - allowsAnke: true, - path: 'supplerende-stonad-ufore-flyktninger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.GRUNN_OG_HJELPESTONAD, - allowsAnke: true, - path: 'grunn-og-hjelpestonad', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.YRKESSKADE, - allowsAnke: true, - path: 'yrkesskade', - }, - ], - }, - { - type: TemaType.TEMA, - title: { [Languages.nb]: 'Familie', [Languages.en]: 'Family' }, - path: 'familie', - innsendingsytelser: [ - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.FORELDREPENGER, - allowsAnke: true, - path: 'foreldrepenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.ENGANGSSTONAD, - allowsAnke: true, - path: 'engangsstonad', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.SVANGERSKAPSPENGER, - allowsAnke: true, - path: 'svangerskapspenger', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.KONTANTSTOTTE, - allowsAnke: false, - path: 'kontantstotte', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.BARNETRYGD, - allowsAnke: true, - path: 'barnetrygd', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.BARNEBIDRAG_OG_BIDRAGSFORSKUDD, - allowsAnke: false, - path: 'barnebidrag-og-bidragsforskudd', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.EKTEFELLEBIDRAG, - allowsAnke: false, - path: 'ektefellebidrag', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.ENSLIG_MOR_ELLER_FAR, - allowsAnke: true, - path: 'enslig-mor-eller-far', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.GRAVFERDSSTONAD, - allowsAnke: true, - path: 'gravferdsstonad', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.SYKDOM_I_FAMILIEN, - allowsAnke: true, - path: 'sykdom-i-familien', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.OPPFOSTRINGSBIDRAG, - allowsAnke: false, - path: 'oppfostringsbidrag', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.REISEKOSTNADER_VED_SAMVAER, - allowsAnke: false, - path: 'reisekostnader-ved-samvaer', - }, - ], - }, - { - type: TemaType.TEMA, - title: { [Languages.nb]: 'Pensjon', [Languages.en]: 'Pension' }, - path: 'pensjon', - innsendingsytelser: [ - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.ALDERSPENSJON, - allowsAnke: true, - path: 'alderspensjon', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.AVTALEFESTET_PENSJON_SPK, - allowsAnke: true, - path: 'avtalefestet-pensjon-spk', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.AVTALEFESTET_PENSJON_PRIVAT, - allowsAnke: true, - path: 'avtalefestet-pensjon-privat', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.BARNEPENSJON, - allowsAnke: true, - path: 'barnepensjon', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.KRIGSPENSJON, - allowsAnke: true, - path: 'krigspensjon', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.GJENLEVENDE, - allowsAnke: true, - path: 'gjenlevende', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.SUPPLERENDE_STONAD, - allowsAnke: true, - path: 'supplerende-stonad', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.TIDLIGERE_FAMILIEPLEIER, - allowsAnke: true, - path: 'tidligere-familiepleier', - }, - ], - }, - { - type: TemaType.TEMA, - title: { [Languages.nb]: 'Til eller fra Norge', [Languages.en]: 'To and from Norway' }, - path: 'til-eller-fra-norge', - innsendingsytelser: [ - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.OPPHOLD_ELLER_ARBEID_I_NORGE, - allowsAnke: true, - path: 'opphold-eller-arbeid-i-norge', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.OPPHOLD_ELLER_ARBEID_UTENFOR_NORGE, - allowsAnke: true, - path: 'opphold-eller-arbeid-utenfor-norge', - }, - ], - }, - { - type: TemaType.TEMA, - title: { - [Languages.nb]: 'Hjelpemidler og tilrettelegging', - [Languages.en]: 'Assistive technology and facilitation', - }, - path: 'hjelpemidler-og-tilrettelegging', - innsendingsytelser: [ - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.HJELPEMIDLER, - allowsAnke: true, - path: 'hjelpemidler', - }, - { - type: TemaType.INNSENDINGSYTELSE, - innsendingsytelse: Innsendingsytelse.BILSTONAD, - allowsAnke: true, - path: 'bil', - }, - ], - }, - { - type: TemaType.INNSENDINGSYTELSE, - path: 'tilleggsstonader', - innsendingsytelse: Innsendingsytelse.TILLEGGSSTONADER, - allowsAnke: true, - }, - { - type: TemaType.EXTERNAL, - title: { [Languages.nb]: 'Økonomisk sosialhjelp', [Languages.en]: 'Financial social assistance' }, - externalUrl: { - [Languages.nb]: 'https://www.nav.no/sosialhjelp/klage', - [Languages.en]: 'https://www.nav.no/sosialhjelp/klage?lang=en', - }, - }, -]; - -export const innsendingsytelsePath = (innsendingsytelse: Innsendingsytelse | null): string | null => { - if (innsendingsytelse === null) { - return null; - } - - for (const tema of INNGANG_KATEGORIER) { - if (tema.type === TemaType.TEMA) { - const kategori = tema.innsendingsytelser.find((k) => k.innsendingsytelse === innsendingsytelse); - - if (kategori !== undefined) { - return `${tema.path}/${kategori.path}`; - } - } - - if (tema.type === TemaType.INNSENDINGSYTELSE) { - return tema.path; - } - } - - return null; -}; diff --git a/frontend/src/language/en.tsx b/frontend/src/language/en.tsx index 53c42dc7..809823d8 100644 --- a/frontend/src/language/en.tsx +++ b/frontend/src/language/en.tsx @@ -1,75 +1,14 @@ /* eslint-disable max-lines */ -import { BodyShort, Link } from '@navikt/ds-react'; import { format } from 'date-fns'; import React from 'react'; import { PRETTY_FORMAT } from '@app/components/date-picker/constants'; import { ExternalLink } from '@app/components/link/link'; import { ErrorMessageKeys } from '@app/language/error-messages'; -import { Utfall } from '@app/redux-api/case/anke/types'; import { Reason } from '@app/redux-api/case/klage/types'; import { CaseStatus } from '@app/redux-api/case/types'; import { Language } from './nb'; export const en: Language = { - inngang: { - title_postfix: 'complain or appeal', - guide_panel: { - general_info: [ - - You have a right to complain if you have received a decision from NAV and disagree with the decision. Read - more about{' '} - - your right to complain - - . - , - ].map((c, index) => {c}), - login_info: [ - - To get the best possible user experience, we recommend that you log in{' '} - before you proceed.{' '} - - How to get an electronic ID. - - , - ], - }, - hovedkategorier: { - title: 'Complain or appeal against decision', - chooseInnsendingsytelse: 'Select topic', - }, - kategorier: { - title: 'Which service or benefit is applicable?', - }, - innsendingsvalg: { - title: 'What do you want?', - common: { - warning: - 'Your complaint or appeal may be stored in the browser until the tab is closed, even if you are not logged in.', - }, - klage: { - title: 'Complain on decision from NAV', - description: { - logged_in_digital: 'You can send your complaint and attachments digitally here.', - logged_out_digital: - 'If you log in, you will be able to send the complaint and attachments digitally. You can continue without logging in, but you will have to print your complaint, sign it, and send it by post.', - }, - }, - anke: { - title: 'Appeal on decision from NAV Klageinstans', - description: { - logged_in_digital: 'You can send your appeal and attachments digitally here.', - logged_out_digital: - 'If you log in, you will be able to send the appeal and attachments digitally. You can continue without logging in, but you will have to print your appeal, sign it, and send it by post.', - }, - }, - ettersendelse: { - title: 'Submit additional documentation to a complaint or appeal', - description: - 'If you have complained or appealed against a decision, and you wish to submit additional documentation or send in new/changed information regarding your case, click here to get help with submitting it via post.', - }, - }, - }, ettersendelse: { title: 'Submit additional documentation to a complaint or appeal', send_by_post: 'Send by post to:', @@ -199,7 +138,13 @@ export const en: Language = { sent: 'Submitted', general_info: { title: 'The rest is now our responsibility', - description: `You don't have to do anything else. We will contact you if we have any questions or if we need further information from you. If you have forgotten to include some attachments, you can forward documentation at any time.`, + description: [ + `You don't have to do anything else. We will contact you if we have any questions or if we need further information from you. If you have forgotten to include some attachments, you can forward documentation at any time `, + + here + , + '.', + ], }, read_more: [ 'You can read more about the further processing of your complaint on our ', @@ -325,7 +270,13 @@ export const en: Language = { sent: 'Submitted', general_info: { title: 'The rest is now our responsibility', - description: `You don't have to do anything else. We will contact you if we have any questions or if we need further information from you. If you have forgotten to include some attachments, you can send them to us later by clicking on "Submit additional documentation to a previously submitted complaint or appeal" for the topic in question.`, + description: [ + `You don't have to do anything else. We will contact you if we have any questions or if we need further information from you. If you have forgotten to include some attachments, you can forward documentation at any time `, + + here + , + '.', + ], }, read_more: [ 'You can read more about the further processing of your complaint on our ', @@ -370,16 +321,6 @@ export const en: Language = { title: 'Page not found', go_back: 'Go back to homepage', }, - utfall: { - [Utfall.TRUKKET]: 'Drawn', - [Utfall.RETUR]: 'Returned', - [Utfall.OPPHEVET]: 'Overturned', - [Utfall.MEDHOLD]: 'Reversed', - [Utfall.DELVIS_MEDHOLD]: 'Partially reversed', - [Utfall.OPPRETTHOLDT]: 'Upheld', - [Utfall.UGUNST]: 'Reversed', - [Utfall.AVVIST]: 'Rejected', - }, kvittering: { see_estimate: [ 'You can see ', @@ -430,16 +371,4 @@ export const en: Language = { no: 'No', expires_in: (exp: string) => `You will be logged out ${exp}. To continue, you just need to log in again.`, }, - personalised: { - draft_klager: { - title: 'Draft complaints', - }, - draft_anker: { - title: 'Draft appeals', - }, - available_anker: { - title: 'Declined complaints', - klage_date: 'Complaint decision date', - }, - }, }; diff --git a/frontend/src/language/nb.tsx b/frontend/src/language/nb.tsx index 89853693..9d77e55e 100644 --- a/frontend/src/language/nb.tsx +++ b/frontend/src/language/nb.tsx @@ -1,79 +1,17 @@ /* eslint-disable max-lines */ -import { BodyShort, Link } from '@navikt/ds-react'; import { format } from 'date-fns'; import React from 'react'; import { PRETTY_FORMAT } from '@app/components/date-picker/constants'; import { ExternalLink } from '@app/components/link/link'; import { ErrorMessageKeys } from '@app/language/error-messages'; -import { Utfall } from '@app/redux-api/case/anke/types'; import { Reason } from '@app/redux-api/case/klage/types'; import { CaseStatus } from '@app/redux-api/case/types'; export type Language = typeof nb; export const nb = { - inngang: { - title_postfix: 'klage eller anke', - guide_panel: { - general_info: [ - - Hvis du har fått et vedtak fra NAV og du er uenig i vedtaket, har du rett til å klage eller anke. Les mer om{' '} - - dine klagerettigheter - - . - , - ].map((c, index) => {c}), - login_info: [ - - For at du skal få best mulig brukeropplevelse, anbefaler vi deg å logge inn{' '} - før du går videre. - , - - Slik skaffer du deg elektronisk ID. - , - ], - }, - hovedkategorier: { - title: 'Klage eller anke på vedtak', - chooseInnsendingsytelse: 'Hvilket tema gjelder saken?', - }, - kategorier: { - title: 'Hvilken tjeneste eller ytelse gjelder saken?', - }, - innsendingsvalg: { - title: 'Hva vil du?', - common: { - warning: 'Klagen eller anken din lagres i nettleseren inntil fanen lukkes, selv om du ikke er logget inn.', - }, - klage: { - title: 'Klage på vedtak fra NAV', - description: { - logged_in_digital: 'Du kan sende inn klagen og vedlegg digitalt her.', - logged_out_digital: - 'Hvis du logger deg inn kan du sende inn klagen og vedlegg digitalt her. Du kan fortsette uten å logge deg inn, men husk at du da må skrive ut klagen, signere den og sende den via post.', - }, - }, - anke: { - title: 'Anke på vedtak fra NAV Klageinstans', - description: { - logged_in_digital: 'Du kan sende inn anken og vedlegg digitalt her.', - logged_out_digital: - 'Hvis du logger deg inn kan du sende inn anken og vedlegg digitalt her. Du kan fortsette uten å logge deg inn, men husk at du da må skrive ut anken, signere den og sende den via post.', - }, - }, - ettersendelse: { - title: 'Ettersendelse til klage eller anke', - description: - 'Har du klaget eller anket på et vedtak og ønsker å ettersende dokumentasjon eller sende inn nye/endrede opplysninger i saken din, kan du trykke her for å få hjelp til å sende inn dette via post.', - }, - }, - }, ettersendelse: { - title: 'Ettersende dokumentasjon på tidligere innsendt klage/anke', + title: 'Ettersend dokumentasjon', send_by_post: 'Send via post til:', employer_info_logged_out: 'Hvis du er en arbeidsgiver må legge inn fødselsnummeret eller D-nummeret til den arbeidstakeren som ettersendelsen gjelder for, skrive ut forsiden og signere som arbeidsgiver.', @@ -201,8 +139,13 @@ export const nb = { sent: 'Sendt inn', general_info: { title: 'Nå er resten vårt ansvar', - description: - 'Du trenger ikke gjøre noe mer. Vi tar kontakt med deg hvis det er noe vi lurer på eller hvis vi trenger flere opplysninger fra deg. Om det viser seg at du har glemt å sende inn noe dokumentasjon til saken din, så kan dette ettersendes ved å trykke på "Ettersende dokumentasjon på tidligere innsendt klage/anke" på ytelsen det gjelder.', + description: [ + 'Du trenger ikke gjøre noe mer. Vi tar kontakt med deg hvis det er noe vi lurer på eller hvis vi trenger flere opplysninger fra deg. Om det viser seg at du har glemt å sende inn noe dokumentasjon til saken din, så kan dette ettersendes ved å trykke på "Ettersend dokumentasjon" for det det gjelder ', + + her + , + '.', + ], }, read_more: [ 'Du kan lese mer om hvordan vi behandler klagen din videre på våre ', @@ -332,8 +275,13 @@ export const nb = { sent: 'Sendt inn', general_info: { title: 'Nå er resten vårt ansvar', - description: - 'Du trenger ikke gjøre noe mer. Vi tar kontakt med deg hvis det er noe vi lurer på eller hvis vi trenger flere opplysninger fra deg. Om det viser seg at du har glemt å sende inn noe dokumentasjon til saken din, så kan dette ettersendes ved å trykke på "Ettersende dokumentasjon på tidligere innsendt klage/anke" på ytelsen det gjelder.', + description: [ + 'Du trenger ikke gjøre noe mer. Vi tar kontakt med deg hvis det er noe vi lurer på eller hvis vi trenger flere opplysninger fra deg. Om det viser seg at du har glemt å sende inn noe dokumentasjon til saken din, så kan dette ettersendes ved å trykke på "Ettersend dokumentasjon" for det det gjelder ', + + her + , + '.', + ], }, read_more: [ 'Du kan lese mer om hvordan vi behandler anken din videre på våre ', @@ -379,17 +327,7 @@ export const nb = { }, not_found_page: { title: 'Finner ikke siden', - go_back: 'Gå tilbake til startsiden', - }, - utfall: { - [Utfall.TRUKKET]: 'Trukket', - [Utfall.RETUR]: 'Retur', - [Utfall.OPPHEVET]: 'Opphevet', - [Utfall.MEDHOLD]: 'Omgjort', - [Utfall.DELVIS_MEDHOLD]: 'Delvis omgjort', - [Utfall.OPPRETTHOLDT]: 'Stadfestet', - [Utfall.UGUNST]: 'Omgjort', - [Utfall.AVVIST]: 'Avvist', + go_back: 'Gå tilbake til nav.no/klage', }, kvittering: { see_estimate: [ @@ -442,16 +380,4 @@ export const nb = { no: 'Nei', expires_in: (exp: string) => `Du vil bli logget ut ${exp}. For å fortsette trenger du bare logge inn igjen.`, }, - personalised: { - draft_klager: { - title: 'Påbegynte klager', - }, - draft_anker: { - title: 'Påbegynte anker', - }, - available_anker: { - title: 'Avslåtte klager', - klage_date: 'Klagens vedtaksdato', - }, - }, }; diff --git a/frontend/src/logging/amplitude.ts b/frontend/src/logging/amplitude.ts deleted file mode 100644 index e01fd634..00000000 --- a/frontend/src/logging/amplitude.ts +++ /dev/null @@ -1,70 +0,0 @@ -import amplitude from 'amplitude-js'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; - -const APP_NAME = 'klage-dittnav'; - -enum AmplitudeEvent { - PAGE_VIEW = 'sidevisning', -} - -export enum PageIdentifier { - KLAGESKJEMA_BEGRUNNElSE = 'KLAGESKJEMA_BEGRUNNElSE', - KLAGESKJEMA_KVITTERING = 'KLAGESKJEMA_KVITTERING', - KLAGESKJEMA_OPPSUMMERING = 'KLAGESKJEMA_OPPSUMMERING', - KLAGESKJEMA_INNSENDING = 'KLAGESKJEMA_INNSENDING', - ANKESKJEMA_BEGRUNNElSE = 'ANKESKJEMA_BEGRUNNElSE', - ANKESKJEMA_KVITTERING = 'ANKESKJEMA_KVITTERING', - ANKESKJEMA_OPPSUMMERING = 'ANKESKJEMA_OPPSUMMERING', - ANKESKJEMA_INNSENDING = 'ANKESKJEMA_INNSENDING', - INNGANG_INNSENDING_POST = 'INNGANG_INNSENDING_POST', - INNGANG_INNSENDING_DIGITAL = 'INNGANG_INNSENDING_DIGITAL', - INNGANG_HOVEDKATEGORIER = 'INNGANG_HOVEDKATEGORIER', - INNGANG_KATEGORIER = 'INNGANG_KATEGORIER', - NOT_FOUND = 'NOT_FOUND', -} - -const client = amplitude.getInstance(); - -client.init('default', '', { - apiEndpoint: 'amplitude.nav.no/collect-auto', - saveEvents: false, - includeUtm: true, - includeReferrer: true, - platform: window.location.origin, -}); - -interface ExtraEventData { - page: PageIdentifier; - innsendingsytelse?: Innsendingsytelse; - title?: string; -} - -interface EventData extends ExtraEventData { - app: string; - url: string; -} - -const logAmplitudeEvent = async (eventName: AmplitudeEvent, eventProperties: ExtraEventData) => - await new Promise((resolve, reject) => { - const eventData: EventData = { - ...eventProperties, - app: APP_NAME, - url: window.location.href, - }; - client.logEvent(eventName, eventData, (responseCode) => { - if (responseCode === 200) { - resolve(); - - return; - } - - reject(); - }); - }); - -export const logPageView = (page: PageIdentifier, innsendingsytelse?: Innsendingsytelse, title?: string) => - logAmplitudeEvent(AmplitudeEvent.PAGE_VIEW, { - page, - title, - innsendingsytelse, - }); diff --git a/frontend/src/logging/error-report/action.ts b/frontend/src/logging/error-report/action.ts index d4569ea1..8eac07ec 100644 --- a/frontend/src/logging/error-report/action.ts +++ b/frontend/src/logging/error-report/action.ts @@ -7,6 +7,7 @@ export enum AppEventEnum { DOWNLOAD_ATTACHMENT = 'Download attachment', FINALIZE = 'Click finalize button', INVALID = 'Invalid case data', + VALID = 'Valid case data', LOGIN = 'Login', SSE_CLOSE = 'SSE close', SSE_ERROR = 'SSE error', diff --git a/frontend/src/logging/error-report/error-report.ts b/frontend/src/logging/error-report/error-report.ts index 8b5d1e74..d025e4c2 100644 --- a/frontend/src/logging/error-report/error-report.ts +++ b/frontend/src/logging/error-report/error-report.ts @@ -64,12 +64,11 @@ class ErrorReport { public addAppEvent = (action: AppEventEnum) => this.addEvent({ type: 'app', action, ...getBaseEvent() }); - public addErrorEvent = (error_message: string, error_stack?: string, component_stack?: string) => + public addErrorEvent = (error_message: string, error_stack?: string) => this.addEvent({ type: 'error', error_message, error_stack, - component_stack, ...getBaseEvent(), }); diff --git a/frontend/src/logging/use-log-page-view.ts b/frontend/src/logging/use-log-page-view.ts deleted file mode 100644 index 6aa33ea7..00000000 --- a/frontend/src/logging/use-log-page-view.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { useEffect } from 'react'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { PageIdentifier, logPageView } from './amplitude'; - -export const useLogPageView = (page: PageIdentifier, innsendingsytelse?: Innsendingsytelse, title?: string) => { - useEffect(() => { - logPageView(page, innsendingsytelse, title); - }, [page, innsendingsytelse, title]); -}; diff --git a/frontend/src/redux-api/case/anke/api.ts b/frontend/src/redux-api/case/anke/api.ts index fc78a5e4..90baa406 100644 --- a/frontend/src/redux-api/case/anke/api.ts +++ b/frontend/src/redux-api/case/anke/api.ts @@ -2,7 +2,7 @@ import { createApi } from '@reduxjs/toolkit/query/react'; import { API_BASE_QUERY, API_PATH } from '../../common'; import { ServerSentEventManager, ServerSentEventType } from '../../server-sent-events'; import { Attachment, Case, CaseStatus, DeleteAttachmentParams, FinalizedCase, UploadAttachmentParams } from '../types'; -import { Anke, AnkeUpdate, AvailableAnke, NewAnke, ResumeAnke } from './types'; +import { Anke, AnkeUpdate, NewAnke, ResumeAnke } from './types'; type BaseUpdateResponse = Pick; @@ -10,19 +10,6 @@ export const ankeApi = createApi({ reducerPath: 'ankeApi', baseQuery: API_BASE_QUERY, endpoints: (builder) => ({ - getAnker: builder.query({ - query: () => '/anker', - onQueryStarted: async (_, { dispatch, queryFulfilled }) => { - const { data } = await queryFulfilled; - - for (const anke of data) { - dispatch(ankeApi.util.updateQueryData('getAnke', anke.id, () => anke)); - } - }, - }), - getAvailableAnker: builder.query({ - query: () => `/anker/available`, - }), getAnke: builder.query({ query: (ankeId) => `/anker/${ankeId}`, onCacheEntryAdded: async (ankeId, { updateCachedData, cacheEntryRemoved, cacheDataLoaded, getCacheEntry }) => { @@ -51,10 +38,6 @@ export const ankeApi = createApi({ console.error(err); } }, - onQueryStarted: async (_, { dispatch, queryFulfilled }) => { - const { data } = await queryFulfilled; - dispatch(ankeApi.util.updateQueryData('getAnker', undefined, (anker) => addAnke(anker, data))); - }, }), resumeOrCreateAnke: builder.mutation({ query: (body) => ({ @@ -65,7 +48,6 @@ export const ankeApi = createApi({ onQueryStarted: async (_, { dispatch, queryFulfilled }) => { const { data } = await queryFulfilled; dispatch(ankeApi.util.updateQueryData('getAnke', data.id, () => data)); - dispatch(ankeApi.util.updateQueryData('getAnker', undefined, (anker) => addAnke(anker, data))); }, }), createAnke: builder.mutation({ @@ -77,7 +59,6 @@ export const ankeApi = createApi({ onQueryStarted: async (_, { dispatch, queryFulfilled }) => { const { data } = await queryFulfilled; dispatch(ankeApi.util.updateQueryData('getAnke', data.id, () => data)); - dispatch(ankeApi.util.updateQueryData('getAnker', undefined, (anker) => addAnke(anker, data))); }, }), updateAnke: builder.mutation({ @@ -90,23 +71,12 @@ export const ankeApi = createApi({ const patchResult = dispatch( ankeApi.util.updateQueryData('getAnke', id, (draft) => ({ ...draft, [key]: value })), ); - const ankerPatchResult = dispatch( - ankeApi.util.updateQueryData('getAnker', undefined, (anker) => - anker.map((anke) => (anke.id === id ? { ...anke, [key]: value } : anke)), - ), - ); try { const { data } = await queryFulfilled; dispatch(ankeApi.util.updateQueryData('getAnke', id, (draft) => ({ ...draft, ...data }))); - dispatch( - ankeApi.util.updateQueryData('getAnker', undefined, (anker) => - anker.map((anke) => (anke.id === id ? { ...anke, ...data } : anke)), - ), - ); } catch { patchResult.undo(); - ankerPatchResult.undo(); } }, }), @@ -118,9 +88,6 @@ export const ankeApi = createApi({ onQueryStarted: async (ankeId, { dispatch, queryFulfilled }) => { await queryFulfilled; dispatch(ankeApi.util.updateQueryData('getAnke', ankeId, () => undefined)); - dispatch( - ankeApi.util.updateQueryData('getAnker', undefined, (anker) => anker.filter((anke) => anke.id !== ankeId)), - ); }, }), finalizeAnke: builder.mutation({ @@ -137,23 +104,6 @@ export const ankeApi = createApi({ status: CaseStatus.DONE, })), ); - dispatch( - ankeApi.util.updateQueryData('getAnker', undefined, (anker) => { - const updatedAnker = anker.map((anke) => { - if (anke.id === id) { - return { - ...anke, - ...data, - status: CaseStatus.DONE, - }; - } - - return anke; - }); - - return updatedAnker; - }), - ); }, }), uploadAttachment: builder.mutation({ @@ -196,24 +146,13 @@ export const ankeApi = createApi({ }), }); -// eslint-disable-next-line import/no-unused-modules export const { useCreateAnkeMutation, useDeleteAnkeMutation, useDeleteAttachmentMutation, useFinalizeAnkeMutation, useGetAnkeQuery, - useGetAvailableAnkerQuery, - useGetAnkerQuery, useResumeOrCreateAnkeMutation, useUpdateAnkeMutation, useUploadAttachmentMutation, } = ankeApi; - -const addAnke = (anker: Anke[], newAnke: Anke) => { - if (anker.some(({ id }) => id === newAnke.id)) { - return anker.map((klage) => (klage.id === newAnke.id ? newAnke : klage)); - } - - return [newAnke, ...anker]; -}; diff --git a/frontend/src/redux-api/case/anke/types.ts b/frontend/src/redux-api/case/anke/types.ts index 8d4fe8db..c1e83ef1 100644 --- a/frontend/src/redux-api/case/anke/types.ts +++ b/frontend/src/redux-api/case/anke/types.ts @@ -1,5 +1,5 @@ import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { Case, CaseStatus } from '../types'; +import { Case } from '../types'; export interface ResumeAnke { readonly innsendingsytelse: Innsendingsytelse; @@ -25,30 +25,3 @@ interface IAnkeUpdate { } export type AnkeUpdate = IAnkeUpdate; - -enum AnkemulighetStatus { - OPEN = 'OPEN', -} - -type AvailableAnkeStatus = CaseStatus | AnkemulighetStatus; - -export enum Utfall { - TRUKKET = 'TRUKKET', - RETUR = 'RETUR', - OPPHEVET = 'OPPHEVET', - MEDHOLD = 'MEDHOLD', - DELVIS_MEDHOLD = 'DELVIS_MEDHOLD', - OPPRETTHOLDT = 'OPPRETTHOLDT', - UGUNST = 'UGUNST', - AVVIST = 'AVVIST', -} - -export interface AvailableAnke { - readonly id: string; - readonly ankeStatus: AvailableAnkeStatus; - readonly innsendtDate: string; - readonly innsendingsytelse: Innsendingsytelse; - - readonly utfall: Utfall; - readonly vedtakDate: string; -} diff --git a/frontend/src/redux-api/case/klage/api.ts b/frontend/src/redux-api/case/klage/api.ts index f03d35f5..5aacb5d4 100644 --- a/frontend/src/redux-api/case/klage/api.ts +++ b/frontend/src/redux-api/case/klage/api.ts @@ -10,16 +10,6 @@ export const klageApi = createApi({ reducerPath: 'klageApi', baseQuery: API_BASE_QUERY, endpoints: (builder) => ({ - getKlager: builder.query({ - query: () => '/klager', - onQueryStarted: async (_, { dispatch, queryFulfilled }) => { - const { data } = await queryFulfilled; - - for (const klage of data) { - dispatch(klageApi.util.updateQueryData('getKlage', klage.id, () => klage)); - } - }, - }), getKlage: builder.query({ query: (klageId) => `/klager/${klageId}`, onCacheEntryAdded: async (klageId, { updateCachedData, cacheEntryRemoved, cacheDataLoaded, getCacheEntry }) => { @@ -48,10 +38,6 @@ export const klageApi = createApi({ console.error(err); } }, - onQueryStarted: async (klageId, { dispatch, queryFulfilled }) => { - const { data } = await queryFulfilled; - dispatch(klageApi.util.updateQueryData('getKlager', undefined, (klager) => addKlage(klager, data))); - }, }), resumeOrCreateKlage: builder.mutation({ query: (body) => ({ @@ -62,7 +48,6 @@ export const klageApi = createApi({ onQueryStarted: async (_, { dispatch, queryFulfilled }) => { const { data } = await queryFulfilled; dispatch(klageApi.util.updateQueryData('getKlage', data.id, () => data)); - dispatch(klageApi.util.updateQueryData('getKlager', undefined, (klager) => addKlage(klager, data))); }, }), createKlage: builder.mutation({ @@ -74,7 +59,6 @@ export const klageApi = createApi({ onQueryStarted: async (_, { dispatch, queryFulfilled }) => { const { data } = await queryFulfilled; dispatch(klageApi.util.updateQueryData('getKlage', data.id, () => data)); - dispatch(klageApi.util.updateQueryData('getKlager', undefined, (klager) => addKlage(klager, data))); }, }), updateKlage: builder.mutation({ @@ -87,23 +71,12 @@ export const klageApi = createApi({ const patchResult = dispatch( klageApi.util.updateQueryData('getKlage', id, (draft) => ({ ...draft, [key]: value })), ); - const klagerPatchResult = dispatch( - klageApi.util.updateQueryData('getKlager', undefined, (klager) => - klager.map((klage) => (klage.id === id ? { ...klage, [key]: value } : klage)), - ), - ); try { const { data } = await queryFulfilled; dispatch(klageApi.util.updateQueryData('getKlage', id, (draft) => ({ ...draft, ...data }))); - dispatch( - klageApi.util.updateQueryData('getKlager', undefined, (klager) => - klager.map((klage) => (klage.id === id ? { ...klage, ...data } : klage)), - ), - ); } catch { patchResult.undo(); - klagerPatchResult.undo(); } }, }), @@ -115,11 +88,6 @@ export const klageApi = createApi({ onQueryStarted: async (klageId, { dispatch, queryFulfilled }) => { await queryFulfilled; dispatch(klageApi.util.updateQueryData('getKlage', klageId, () => undefined)); - dispatch( - klageApi.util.updateQueryData('getKlager', undefined, (klager) => - klager.filter((klage) => klage.id !== klageId), - ), - ); }, }), finalizeKlage: builder.mutation({ @@ -136,23 +104,6 @@ export const klageApi = createApi({ status: CaseStatus.DONE, })), ); - dispatch( - klageApi.util.updateQueryData('getKlager', undefined, (klager) => { - const updatedKlager = klager.map((klage) => { - if (klage.id === id) { - return { - ...klage, - ...data, - status: CaseStatus.DONE, - }; - } - - return klage; - }); - - return updatedKlager; - }), - ); }, }), uploadAttachment: builder.mutation({ @@ -204,14 +155,5 @@ export const { useResumeOrCreateKlageMutation, useUpdateKlageMutation, useUploadAttachmentMutation, - useGetKlagerQuery, useDeleteKlageMutation, } = klageApi; - -const addKlage = (klager: Klage[], newKlage: Klage) => { - if (klager.some(({ id }) => id === newKlage.id)) { - return klager.map((klage) => (klage.id === newKlage.id ? newKlage : klage)); - } - - return [newKlage, ...klager]; -}; diff --git a/frontend/src/redux-api/case/klage/types.ts b/frontend/src/redux-api/case/klage/types.ts index 38f55384..520b17cf 100644 --- a/frontend/src/redux-api/case/klage/types.ts +++ b/frontend/src/redux-api/case/klage/types.ts @@ -1,5 +1,4 @@ import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { StringValue } from '@app/kategorier/kategorier'; import { Languages } from '@app/language/types'; import { Case } from '../types'; @@ -21,6 +20,10 @@ export interface NewKlage readonly checkboxesSelected: Reason[]; } +type StringValue = { + [key in Languages]: string; +}; + export interface Klage extends ResumeKlage, Case { readonly title: StringValue; readonly language: Languages; diff --git a/frontend/src/redux-api/user/api.ts b/frontend/src/redux-api/user/api.ts index 979a0b39..3e556c41 100644 --- a/frontend/src/redux-api/user/api.ts +++ b/frontend/src/redux-api/user/api.ts @@ -33,5 +33,4 @@ export const userApi = createApi({ }), }); -// eslint-disable-next-line import/no-unused-modules -export const { useGetUserQuery, useIsAuthenticatedQuery, useLazyGetUserQuery } = userApi; +export const { useGetUserQuery, useIsAuthenticatedQuery } = userApi; diff --git a/frontend/src/redux/session/session.ts b/frontend/src/redux/session/session.ts index 7cfbf99a..e76f7d1c 100644 --- a/frontend/src/redux/session/session.ts +++ b/frontend/src/redux/session/session.ts @@ -17,7 +17,6 @@ export const sessionSlice = createSlice({ }, }); -// eslint-disable-next-line import/no-unused-modules export const { setSessionAnke, loadSessionAnke, diff --git a/frontend/src/routes/error-boundary.tsx b/frontend/src/routes/error-boundary.tsx new file mode 100644 index 00000000..476da123 --- /dev/null +++ b/frontend/src/routes/error-boundary.tsx @@ -0,0 +1,38 @@ +import { Alert, BodyShort } from '@navikt/ds-react'; +import React, { Component, ErrorInfo } from 'react'; +import { addErrorEvent, sendErrorReport } from '@app/logging/error-report/error-report'; + +interface Props { + children: React.ReactNode; +} + +interface State { + hasError: boolean; +} + +export class ErrorBoundary extends Component { + state = { hasError: false }; + + public static getDerivedStateFromError(): State { + return { hasError: true }; + } + + public componentDidCatch(error: Error, errorInfo: ErrorInfo) { + addErrorEvent(error.message, error.stack); + sendErrorReport(); + console.error('Uncaught error:', error, errorInfo); + } + + public render() { + if (this.state.hasError) { + return ( + + Beklager, det skjedde en feil. + Sorry, something went wrong. + + ); + } + + return this.props.children; + } +} diff --git a/frontend/src/routes/inngang/guide-panel.tsx b/frontend/src/routes/inngang/guide-panel.tsx deleted file mode 100644 index 12a9bcd1..00000000 --- a/frontend/src/routes/inngang/guide-panel.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { GuidePanel } from '@navikt/ds-react'; -import React from 'react'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { useTranslation } from '@app/language/use-translation'; - -export const InngangGuidePanel = () => { - const { data } = useIsAuthenticated(); - const { inngang } = useTranslation(); - - const guideText = - data === true - ? inngang.guide_panel.general_info - : inngang.guide_panel.general_info.concat(inngang.guide_panel.login_info); - - return {guideText}; -}; diff --git a/frontend/src/routes/inngang/kategori.tsx b/frontend/src/routes/inngang/kategori.tsx deleted file mode 100644 index 886f80fc..00000000 --- a/frontend/src/routes/inngang/kategori.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import { Alert, Heading, LinkPanel } from '@navikt/ds-react'; -import React, { memo, useMemo } from 'react'; -import { Link, useParams } from 'react-router-dom'; -import { Breadcrumb, useBreadcrumbs } from '@app/breadcrumbs/use-breadcrumbs'; -import { IconLinkPanel } from '@app/components/icon-link-panel/icon-link-panel'; -import { Optional } from '@app/components/optional/optional'; -import { queryStringify } from '@app/functions/query-string'; -import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser'; -import { usePageInit } from '@app/hooks/use-page-init'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { Document } from '@app/icons/document'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { IInnsendingsytelse, ITemaWithKategorier } from '@app/kategorier/kategorier'; -import { Languages } from '@app/language/types'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; -import { InngangMainContainer } from '@app/styled-components/main-container'; -import { InngangGuidePanel } from './guide-panel'; -import { AnkeLinkPanel } from './klage-anke-knapper/anke-link-panel'; -import { KlageLinkPanel } from './klage-anke-knapper/klage-link-panel'; -import { CenteredHeading, InngangPanel, PanelContainer } from './styled-components/panels'; - -interface Props extends IInnsendingsytelse { - tema?: ITemaWithKategorier | null; -} - -export const Kategori = memo( - ({ innsendingsytelse, tema = null, allowsAnke = false }: Props) => { - useLogPageView(PageIdentifier.INNGANG_INNSENDING_DIGITAL, innsendingsytelse); - const [title] = useInnsendingsytelseName(innsendingsytelse); - const lang = useLanguage(); - const { inngang } = useTranslation(); - usePageInit(`${title} \u2013 ${inngang.title_postfix}`); - const breadcrumbs = useMemo(() => getBreadcrumbs(tema, lang), [tema, lang]); - useBreadcrumbs(breadcrumbs, title); - - return ( - - - - {title} - - - - - - - - - - - }> - {inngang.innsendingsvalg.ettersendelse.title} - {inngang.innsendingsvalg.ettersendelse.description} - - - - - ); - }, - (prevProps, nextProps) => prevProps.innsendingsytelse === nextProps.innsendingsytelse, -); - -Kategori.displayName = 'InngangInnsending'; - -interface LinksProps { - innsendingsytelse: Innsendingsytelse; -} - -const Links = ({ innsendingsytelse }: LinksProps) => { - const { saksnummer } = useParams(); - const { inngang } = useTranslation(); - const { data: isAuthenticated } = useIsAuthenticated(); - - const query = useMemo(() => queryStringify({ saksnummer }), [saksnummer]); - - return ( - <> - - {inngang.innsendingsvalg.title} - - - - - {inngang.innsendingsvalg.common.warning} - - - - - - ); -}; - -const getBreadcrumbs = (inngangkategori: ITemaWithKategorier | null, lang: Languages): Breadcrumb[] => { - if (inngangkategori === null) { - return []; - } - - return [ - { - title: inngangkategori.title[lang], - url: `/${lang}/${inngangkategori.path}`, - handleInApp: true, - }, - ]; -}; diff --git a/frontend/src/routes/inngang/klage-anke-knapper/anke-link-panel.tsx b/frontend/src/routes/inngang/klage-anke-knapper/anke-link-panel.tsx deleted file mode 100644 index 58d6b8f9..00000000 --- a/frontend/src/routes/inngang/klage-anke-knapper/anke-link-panel.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { LinkPanel } from '@navikt/ds-react'; -import React, { useMemo } from 'react'; -import { Link, useParams } from 'react-router-dom'; -import { IconLinkPanel } from '@app/components/icon-link-panel/icon-link-panel'; -import { queryStringify } from '@app/functions/query-string'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { LawBook } from '@app/icons/law-book'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; - -interface Props { - innsendingsytelse: Innsendingsytelse; -} - -export const AnkeLinkPanel = ({ innsendingsytelse }: Props) => { - const { saksnummer } = useParams(); - const lang = useLanguage(); - const { inngang } = useTranslation(); - const { data: isAuthenticated } = useIsAuthenticated(); - - const query = useMemo(() => queryStringify({ saksnummer }), [saksnummer]); - - return ( - } as={Link} to={`/${lang}/anke/ny/${innsendingsytelse}${query}`} border> - {inngang.innsendingsvalg.anke.title} - - - ); -}; - -interface DescriptionProps { - isAuthenticated?: boolean; -} - -const Description = ({ isAuthenticated }: DescriptionProps) => { - const { inngang } = useTranslation(); - - if (isAuthenticated === true) { - return {inngang.innsendingsvalg.anke.description.logged_in_digital}; - } - - return {inngang.innsendingsvalg.anke.description.logged_out_digital}; -}; diff --git a/frontend/src/routes/inngang/klage-anke-knapper/klage-link-panel.tsx b/frontend/src/routes/inngang/klage-anke-knapper/klage-link-panel.tsx deleted file mode 100644 index d0f008ac..00000000 --- a/frontend/src/routes/inngang/klage-anke-knapper/klage-link-panel.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { LinkPanel } from '@navikt/ds-react'; -import React from 'react'; -import { Link } from 'react-router-dom'; -import { IconLinkPanel } from '@app/components/icon-link-panel/icon-link-panel'; -import { useIsAuthenticated } from '@app/hooks/use-user'; -import { LetterOpened } from '@app/icons/letter-opened'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; - -interface Props { - innsendingsytelse: Innsendingsytelse; - query: string; -} - -export const KlageLinkPanel = ({ innsendingsytelse, query }: Props) => { - const lang = useLanguage(); - const { inngang } = useTranslation(); - const { data: isAuthenticated } = useIsAuthenticated(); - - return ( - } as={Link} to={`/${lang}/klage/ny/${innsendingsytelse}${query}`} border> - {inngang.innsendingsvalg.klage.title} - - - ); -}; - -interface DescriptionProps { - isAuthenticated?: boolean; -} - -const Description = ({ isAuthenticated }: DescriptionProps) => { - const { inngang } = useTranslation(); - - if (isAuthenticated === true) { - return {inngang.innsendingsvalg.klage.description.logged_in_digital}; - } - - return {inngang.innsendingsvalg.klage.description.logged_out_digital}; -}; diff --git a/frontend/src/routes/inngang/styled-components/panels.tsx b/frontend/src/routes/inngang/styled-components/panels.tsx deleted file mode 100644 index a373d930..00000000 --- a/frontend/src/routes/inngang/styled-components/panels.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { Heading, Panel } from '@navikt/ds-react'; -import { styled } from 'styled-components'; - -export const PanelContainer = styled(Panel)` - display: flex; - flex-direction: column; - max-width: 1000px; - margin: 0 auto; - gap: 16px; -`; - -export const InngangPanel = styled(Panel)` - display: flex; - flex-direction: column; - gap: 16px; - width: 100%; - background-color: #fff; -`; - -export const LinkContainer = styled.div` - display: grid; - grid-gap: 16px; - grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); - - @media (max-width: 768px) { - grid-template-columns: minmax(0, 1fr); - } -`; - -export const CenteredHeading = styled(Heading)` - text-align: center; -`; diff --git a/frontend/src/routes/inngang/tema-with-kategorier.tsx b/frontend/src/routes/inngang/tema-with-kategorier.tsx deleted file mode 100644 index d1625233..00000000 --- a/frontend/src/routes/inngang/tema-with-kategorier.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { Heading, LinkPanel } from '@navikt/ds-react'; -import React, { memo, useMemo } from 'react'; -import { Link } from 'react-router-dom'; -import { useBreadcrumbs } from '@app/breadcrumbs/use-breadcrumbs'; -import { DraftKlageAndAnkeLists } from '@app/components/personalised-content/personalised-content'; -import { TitleLoader } from '@app/components/text-loader/title-loader'; -import { usePageInit } from '@app/hooks/use-page-init'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { ITemaWithKategorier } from '@app/kategorier/kategorier'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; -import { InngangMainContainer } from '@app/styled-components/main-container'; -import { InngangGuidePanel } from './guide-panel'; -import { CenteredHeading, InngangPanel, LinkContainer, PanelContainer } from './styled-components/panels'; - -interface Props { - tema: ITemaWithKategorier; -} - -export const TemaWithKategorier = memo( - ({ tema }: Props) => { - useLogPageView(PageIdentifier.INNGANG_KATEGORIER); - const lang = useLanguage(); - const title = tema.title[lang]; - const { inngang } = useTranslation(); - usePageInit(`${title} \u2013 ${inngang.title_postfix}`); - useBreadcrumbs([], title); - - const innsendingsytelser: Innsendingsytelse[] = useMemo( - () => tema.innsendingsytelser.map(({ innsendingsytelse }) => innsendingsytelse), - [tema], - ); - - return ( - - - - {title} - - - - - - - - - {inngang.kategorier.title} - - - - - - ); - }, - (prevProps, nextProps) => prevProps.tema === nextProps.tema, -); - -TemaWithKategorier.displayName = 'TemaWithKategorier'; - -const Kategorilenker = ({ innsendingsytelser: kategorier, path }: ITemaWithKategorier) => { - const lang = useLanguage(); - - return ( - - {kategorier.map((kategori) => ( - - ))} - - ); -}; - -interface KategoriLinkProps { - innsendingsytelse: Innsendingsytelse; - path: string; -} - -export const KategoriLink = ({ innsendingsytelse, path }: KategoriLinkProps) => ( - - - - - -); diff --git a/frontend/src/routes/inngang/temaer.tsx b/frontend/src/routes/inngang/temaer.tsx deleted file mode 100644 index 4573c25c..00000000 --- a/frontend/src/routes/inngang/temaer.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { Heading, LinkPanel } from '@navikt/ds-react'; -import React from 'react'; -import { Link } from 'react-router-dom'; -import { styled } from 'styled-components'; -import { useBreadcrumbs } from '@app/breadcrumbs/use-breadcrumbs'; -import { DraftKlageAndAnkeLists } from '@app/components/personalised-content/personalised-content'; -import { TextLoader } from '@app/components/text-loader/text-loader'; -import { useInnsendingsytelserNames } from '@app/hooks/use-innsendingsytelser'; -import { usePageInit } from '@app/hooks/use-page-init'; -import { IExternalTema, INNGANG_KATEGORIER, ITemaWithKategorier, TemaType } from '@app/kategorier/kategorier'; -import { useLanguage } from '@app/language/use-language'; -import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; -import { KategoriLink } from '@app/routes/inngang/tema-with-kategorier'; -import { InngangMainContainer } from '@app/styled-components/main-container'; -import { InngangGuidePanel } from './guide-panel'; -import { CenteredHeading, InngangPanel, LinkContainer, PanelContainer } from './styled-components/panels'; - -export const Temaer = () => { - useLogPageView(PageIdentifier.INNGANG_HOVEDKATEGORIER); - const { inngang } = useTranslation(); - const { title } = inngang.hovedkategorier; - usePageInit(title); - useBreadcrumbs([], null); - - return ( - - - - {title} - - - - - - - - - {inngang.hovedkategorier.chooseInnsendingsytelse} - - {getLinks()} - - - - ); -}; - -const getLinks = () => - INNGANG_KATEGORIER.map((tema) => { - if (tema.type === TemaType.TEMA) { - return ; - } - - if (tema.type === TemaType.EXTERNAL) { - return ; - } - - return ; - }); - -const ExternalHovedkategoriLink = ({ title, externalUrl }: IExternalTema) => { - const lang = useLanguage(); - - return ( - - {title[lang]} - - ); -}; - -const InngangKategoriLink = ({ title, path, innsendingsytelser: kategorier }: ITemaWithKategorier) => { - const lang = useLanguage(); - const [titles, isLoading] = useInnsendingsytelserNames(kategorier.map(({ innsendingsytelse }) => innsendingsytelse)); - - return ( - - - {title[lang]} - - {titles.join(' - ')} - - - - ); -}; - -const EllipsisDescription = styled(LinkPanel.Description)` - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -`; - -const StyledWrapper = styled.div` - & { - .navds-link-panel__content { - max-width: calc(100% - 24px - 16px); - } - } -`; diff --git a/frontend/src/routes/landing-page.tsx b/frontend/src/routes/landing-page.tsx index 83b6084c..b917ce60 100644 --- a/frontend/src/routes/landing-page.tsx +++ b/frontend/src/routes/landing-page.tsx @@ -3,9 +3,8 @@ import { Navigate, useSearchParams } from 'react-router-dom'; import { LoadingPage } from '@app/components/loading-page/loading-page'; import { useInnsendingsytelseFromQuery } from '@app/hooks/use-innsendingsytelse-from-query'; import { useUser } from '@app/hooks/use-user'; -import { innsendingsytelsePath } from '@app/kategorier/kategorier'; import { useTranslation } from '@app/language/use-translation'; -import { Temaer } from './inngang/temaer'; +import { NotFoundPage } from '@app/routes/not-found-page'; export const LandingPage = () => { const [query] = useSearchParams(); @@ -17,14 +16,12 @@ export const LandingPage = () => { return {landing_page.checking_user}; } - const path = innsendingsytelsePath(innsendingsytelse); - - if (path === null) { - return ; + if (innsendingsytelse === null) { + return ; } query.delete('tema'); query.delete('tittel'); - return ; + return ; }; diff --git a/frontend/src/routes/not-found-page.tsx b/frontend/src/routes/not-found-page.tsx index a90c9548..584c5536 100644 --- a/frontend/src/routes/not-found-page.tsx +++ b/frontend/src/routes/not-found-page.tsx @@ -1,41 +1,14 @@ -import { Home } from '@navikt/ds-icons'; -import { Button, Heading } from '@navikt/ds-react'; -import React from 'react'; -import { useNavigate } from 'react-router-dom'; -import { styled } from 'styled-components'; -import { useTranslation } from '@app/language/use-translation'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; +import { useEffect } from 'react'; +import { ENVIRONMENT } from '@app/environment/environment'; export const NotFoundPage = () => { - useLogPageView(PageIdentifier.NOT_FOUND); - const navigate = useNavigate(); - const { not_found_page } = useTranslation(); + useEffect(() => { + console.warn('404 - Redirecting to www.nav.no/klage'); - const onClick = () => navigate('/'); + if (!ENVIRONMENT.isLocal) { + location.replace(ENVIRONMENT.isProduction ? 'https://www.nav.no/klage' : 'https://www.ekstern.dev.nav.no/klage'); + } + }, []); - return ( - - - 404 - - - {not_found_page.title} - - }> - {not_found_page.go_back} - - - ); + return null; }; - -const Container = styled.div` - display: flex; - flex-direction: column; - align-items: center; - padding: 32px; -`; - -const StyledButton = styled(Button)` - margin-top: 16px; -`; diff --git a/frontend/src/routes/query-params-handler.tsx b/frontend/src/routes/query-params-handler.tsx index e88f3a81..e96d90d5 100644 --- a/frontend/src/routes/query-params-handler.tsx +++ b/frontend/src/routes/query-params-handler.tsx @@ -1,19 +1,26 @@ import React from 'react'; import { Navigate, useSearchParams } from 'react-router-dom'; +import { ENVIRONMENT } from '@app/environment/environment'; import { useInnsendingsytelseFromQuery } from '@app/hooks/use-innsendingsytelse-from-query'; import { useLanguage } from '@app/language/use-language'; interface Props { - type?: 'klage' | 'anke'; + type: 'klage' | 'anke'; } -export const QueryParamsHandler = ({ type = 'klage' }: Props) => { +export const QueryParamsHandler = ({ type }: Props) => { const language = useLanguage(); const [query] = useSearchParams(); const innsendingsytelse = useInnsendingsytelseFromQuery(); if (innsendingsytelse === null) { - return ; + console.error('Innsendingsytelse is null.'); + + if (!ENVIRONMENT.isLocal) { + location.replace(ENVIRONMENT.isProduction ? 'https://www.nav.no/klage' : 'https://www.ekstern.dev.nav.no/klage'); + } + + return

404

; } query.delete('tema'); diff --git a/frontend/src/routes/routes.tsx b/frontend/src/routes/routes.tsx index 1bba6247..1a3c933a 100644 --- a/frontend/src/routes/routes.tsx +++ b/frontend/src/routes/routes.tsx @@ -1,4 +1,3 @@ -import { ErrorBoundary, withSentryReactRouterV6Routing } from '@sentry/react'; import React from 'react'; import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'; import { AnkebegrunnelsePage } from '@app/components/anke/innlogget/begrunnelse/anke-begrunnelse-page'; @@ -16,31 +15,26 @@ import { KlageoppsummeringPage } from '@app/components/klage/innlogget/summary/k import { SessionKlagebegrunnelsePage } from '@app/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page'; import { SessionKlageinnsendingPage } from '@app/components/klage/uinnlogget/innsending/klage-innsending-page'; import { SessionKlageoppsummeringPage } from '@app/components/klage/uinnlogget/summary/klage-oppsummering-page'; -import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; -import { IInnsendingsytelse, INNGANG_KATEGORIER, ITemaWithKategorier, TemaType } from '@app/kategorier/kategorier'; +import { INNSENDINGSYTELSER, Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { LanguageComponent } from '@app/language/component'; import { Languages } from '@app/language/types'; -import { TemaWithKategorier } from '@app/routes/inngang/tema-with-kategorier'; import { CreateAnke } from './create-anke/create-anke'; import { CreateKlage } from './create-klage/create-klage'; import { DekoratorSetRedirect } from './dekorator-set-redirect'; -import { Kategori } from './inngang/kategori'; +import { ErrorBoundary } from './error-boundary'; import { LandingPage } from './landing-page'; import { NavigationLogger } from './navigation-logger'; import { NotFoundPage } from './not-found-page'; import { QueryParamsHandler } from './query-params-handler'; import { LoginIfUnauthorized, UpgradeSession } from './redirects'; -import { SentryFallback } from './sentry-fallback'; - -const SentryRoutes = withSentryReactRouterV6Routing(Routes); export const Router = () => ( - - + + }> } /> @@ -49,9 +43,6 @@ export const Router = () => ( {getCaseRoutes({ component: CreateKlage })} - {innsendingsRoutes} - {temaRoutes} - } /> @@ -91,13 +82,25 @@ export const Router = () => ( } /> + + + {INNSENDINGSYTELSER.map((innsendingsytelse) => ( + } + /> + ))} + + } /> + } /> - + @@ -105,45 +108,6 @@ export const Router = () => ( ); -const temaRoutes = INNGANG_KATEGORIER.map((tema) => { - if (tema.type === TemaType.TEMA) { - return } />; - } - - if (tema.type === TemaType.INNSENDINGSYTELSE) { - return } />; - } - - return null; -}); - -const getInnsendingRoute = ( - kategoriPath: string, - kategori: IInnsendingsytelse, - inngangkategori?: ITemaWithKategorier, -) => ( - - } /> - } - /> - -); -const innsendingsRoutes = INNGANG_KATEGORIER.flatMap((tema) => { - if (tema.type === TemaType.TEMA) { - return tema.innsendingsytelser.map((innsendingsytelse) => - getInnsendingRoute(`${tema.path}/${innsendingsytelse.path}`, innsendingsytelse, tema), - ); - } - - if (tema.type === TemaType.EXTERNAL) { - return null; - } - - return getInnsendingRoute(tema.path, tema); -}); - interface YtelseComponentProps { innsendingsytelse: Innsendingsytelse; } @@ -156,32 +120,20 @@ interface Props { } const getCaseRoutes = ({ component: Component, pathSuffix = null }: Props) => - INNGANG_KATEGORIER.flatMap((tema) => { - if (tema.type === TemaType.TEMA) { - return tema.innsendingsytelser.map((kategori) => getCaseRoute(Component, kategori.innsendingsytelse, pathSuffix)); - } - - if (tema.type === TemaType.EXTERNAL) { - return null; + INNSENDINGSYTELSER.map((innsendingsytelse) => { + if (pathSuffix === null) { + return ( + } + /> + ); } - return getCaseRoute(Component, tema.innsendingsytelse, pathSuffix); - }); - -const getCaseRoute = (Component: YtelseComponent, innsendingsytelse: Innsendingsytelse, pathSuffix: string | null) => { - if (pathSuffix === null) { return ( - } - /> + + } /> + ); - } - - return ( - - } /> - - ); -}; + }); diff --git a/frontend/src/routes/sentry-fallback.tsx b/frontend/src/routes/sentry-fallback.tsx deleted file mode 100644 index 0ee6fba9..00000000 --- a/frontend/src/routes/sentry-fallback.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { Alert, BodyShort } from '@navikt/ds-react'; -import { FallbackRender } from '@sentry/react'; -import React from 'react'; -import { addErrorEvent, sendErrorReport } from '@app/logging/error-report/error-report'; - -export const SentryFallback: FallbackRender = ({ error, componentStack }) => { - addErrorEvent(error.message, error.stack, componentStack ?? undefined); - sendErrorReport(); - - return ( - - Beklager, det skjedde en feil. - Sorry, something went wrong. - - ); -}; diff --git a/frontend/src/simple-api-state/simple-api-state.ts b/frontend/src/simple-api-state/simple-api-state.ts index 446662ff..a21973ef 100644 --- a/frontend/src/simple-api-state/simple-api-state.ts +++ b/frontend/src/simple-api-state/simple-api-state.ts @@ -1,4 +1,3 @@ -import { captureException } from '@sentry/react'; import { useEffect, useState } from 'react'; interface State { @@ -52,8 +51,6 @@ export class SimpleApiState { } else { this.error = new Error('Unknown error'); } - - captureException(this.error); } this.isLoading = false; diff --git a/frontend/src/styled-components/main-container.tsx b/frontend/src/styled-components/main-container.tsx index 7ba14635..8ce0d328 100644 --- a/frontend/src/styled-components/main-container.tsx +++ b/frontend/src/styled-components/main-container.tsx @@ -13,11 +13,6 @@ const MainContainer = styled.main` } `; -export const InngangMainContainer = styled(MainContainer)` - padding-top: 64px; - background-color: #f1f1f1; -`; - export const FormMainContainer = styled(MainContainer)` padding-bottom: 128px; background-color: #fff; diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 0c6e3651..5feab3eb 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -42,7 +42,8 @@ module.exports = (_env, { mode }) => ({ directory: path.join(__dirname, './public'), }, ], - hot: true, + hot: false, + client: false, host: '0.0.0.0', port: 8080, historyApiFallback: true,