diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2cd4a776..47fc0a8d 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,33 +9,27 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@navikt/ds-css": "^5.12.0", + "@navikt/ds-css": "^5.12.1", "@navikt/ds-icons": "^3.4.3", - "@navikt/ds-react": "^5.12.0", + "@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": "^3.0.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.15.0", "@typescript-eslint/parser": "^6.15.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,15 +1354,15 @@ "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": { @@ -1425,14 +1376,14 @@ } }, "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", @@ -1473,9 +1424,9 @@ } }, "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": { @@ -1805,121 +1756,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", @@ -1977,12 +1813,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", @@ -2063,9 +1893,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": "*", @@ -2121,16 +1951,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", @@ -2314,17 +2134,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", @@ -2881,19 +2690,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", @@ -3318,11 +3114,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", @@ -4053,9 +3844,9 @@ } }, "node_modules/date-fns": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.0.0.tgz", - "integrity": "sha512-xjDz3rNN9jp+Lh3P/4MeY4E5HkaRnEnrJCcrdRZnKdn42gJlIe6hwrrwVXePRwVR2kh1UcMnz00erYBnHF8PFA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.0.1.tgz", + "integrity": "sha512-cr9igCUa0QSqgAMj7JOrYTY6Nh1rmyGrFDko7ADqfmaQqP/I2N4rlfrLl7AWuzDaoIpz6MNjoEcTPzgZYIrhnA==", "funding": { "type": "github", "url": "https://github.com/sponsors/kossnocorp" @@ -4088,14 +3879,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", @@ -4485,9 +4268,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": { @@ -5096,9 +4879,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", @@ -5113,6 +4896,7 @@ "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", + "eslint-config-prettier": "*", "prettier": ">=3.0.0" }, "peerDependenciesMeta": { @@ -5501,9 +5285,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" @@ -5554,17 +5338,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", @@ -6089,14 +5862,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", @@ -8785,12 +8550,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", @@ -8821,6 +8580,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", @@ -8888,22 +8653,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", @@ -8996,9 +8745,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", @@ -9831,17 +9581,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 6f155ea3..21575bb2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,11 +14,9 @@ "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.15.0", "@typescript-eslint/parser": "^6.15.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-css": "^5.12.1", "@navikt/ds-icons": "^3.4.3", - "@navikt/ds-react": "^5.12.0", + "@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": "^3.0.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/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/upload-button.tsx b/frontend/src/components/attachments/upload-button.tsx index 827014fc..a5f5b6af 100644 --- a/frontend/src/components/attachments/upload-button.tsx +++ b/frontend/src/components/attachments/upload-button.tsx @@ -1,7 +1,6 @@ import { Upload } from '@navikt/ds-icons'; import { Button } from '@navikt/ds-react'; import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -import { captureException } from '@sentry/react'; import React, { useRef } from 'react'; import { styled } from 'styled-components'; import { isError } from '@app/functions/is-api-error'; @@ -58,7 +57,6 @@ export const UploadButton = ({ await uploadAttachment({ caseId, file }).unwrap(); } catch (err) { if (isError(err)) { - captureException(err); setError(err); } diff --git a/frontend/src/components/case/common/post/innsending-page.tsx b/frontend/src/components/case/common/post/innsending-page.tsx index 4cb03390..991f84a3 100644 --- a/frontend/src/components/case/common/post/innsending-page.tsx +++ b/frontend/src/components/case/common/post/innsending-page.tsx @@ -6,22 +6,17 @@ import { useAddress } from '@app/hooks/use-address'; import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser'; import { Language } from '@app/language/language'; 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 { Optional } from '../../../optional/optional'; import { PostFormContainer } from './post-form-container'; interface Props { - pageIdentifier: PageIdentifier; skjema_post: Language['ankeskjema_post'] | Language['klageskjema_post']; innsendingsytelse: Innsendingsytelse; hasVedlegg: boolean; } -export const RenderCaseinnsendingPage = ({ pageIdentifier, skjema_post, innsendingsytelse, hasVedlegg }: Props) => { - useLogPageView(pageIdentifier); - +export const RenderCaseinnsendingPage = ({ skjema_post, innsendingsytelse, hasVedlegg }: Props) => { const { page_title, title_fragment, steps, title, stepTexts, address, common } = useTexts({ skjema_post, innsendingsytelse, 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..75400c1a 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(); 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..c0141e01 100644 --- a/frontend/src/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page.tsx +++ b/frontend/src/components/klage/uinnlogget/begrunnelse/klage-begrunnelse-page.tsx @@ -7,10 +7,8 @@ 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 +42,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); diff --git a/frontend/src/components/klage/uinnlogget/innsending/klage-innsending-page.tsx b/frontend/src/components/klage/uinnlogget/innsending/klage-innsending-page.tsx index b740fd96..f8ed027e 100644 --- a/frontend/src/components/klage/uinnlogget/innsending/klage-innsending-page.tsx +++ b/frontend/src/components/klage/uinnlogget/innsending/klage-innsending-page.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { useGoToBegrunnelseOnError, useSessionKlageErrors } 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 { KlageSessionLoader } from '../klage-session-loader'; import { ISessionKlage } from '../types'; @@ -24,7 +23,6 @@ const SessionKlageWrapper = ({ klage }: { klage: ISessionKlage }) => { ); 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/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/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/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/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/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..e7469f92 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; @@ -26,12 +26,6 @@ interface IAnkeUpdate { export type AnkeUpdate = IAnkeUpdate; -enum AnkemulighetStatus { - OPEN = 'OPEN', -} - -type AvailableAnkeStatus = CaseStatus | AnkemulighetStatus; - export enum Utfall { TRUKKET = 'TRUKKET', RETUR = 'RETUR', @@ -42,13 +36,3 @@ export enum Utfall { 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/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/inngang/styled-components/panels.tsx b/frontend/src/routes/inngang/styled-components/panels.tsx deleted file mode 100644 index 1c13deb3..00000000 --- a/frontend/src/routes/inngang/styled-components/panels.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Panel } from '@navikt/ds-react'; -import { styled } from 'styled-components'; - -export const InngangPanel = styled(Panel)` - display: flex; - flex-direction: column; - gap: 16px; - width: 100%; - background-color: #fff; -`; diff --git a/frontend/src/routes/not-found-page.tsx b/frontend/src/routes/not-found-page.tsx index c1b0693c..34670afc 100644 --- a/frontend/src/routes/not-found-page.tsx +++ b/frontend/src/routes/not-found-page.tsx @@ -1,13 +1,7 @@ import { useEffect } from 'react'; -import { useNavigate } from 'react-router-dom'; -import { PageIdentifier } from '@app/logging/amplitude'; -import { useLogPageView } from '@app/logging/use-log-page-view'; export const NotFoundPage = () => { - useLogPageView(PageIdentifier.NOT_FOUND); - const navigate = useNavigate(); - - useEffect(() => navigate('https://www.nav.no/klage'), [navigate]); + useEffect(() => location.assign('https://www.nav.no/klage'), []); return null; }; 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;