diff --git a/package-lock.json b/package-lock.json index 6cc3a8af..d7d6b3a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "@types/react-aria-menubutton": "^6.2.12", "@types/react-collapse": "^5.0.4", "@types/react-dom": "^17.0.23", - "@types/react-intl": "^2.3.18", "@types/react-intl-redux": "^0.1.19", "@types/react-redux": "^7.1.30", "@types/react-router": "^5.1.20", @@ -85,7 +84,7 @@ "react-burger-menu": "^3.0.9", "react-collapse": "^5.1.1", "react-dom": "^17.0.2", - "react-intl": "^2.9.0", + "react-intl": "^3.12.1", "react-intl-redux": "^2.3.0", "react-modal": "^3.16.1", "react-motion": "^0.5.2", @@ -4641,11 +4640,6 @@ "@types/react": "^17" } }, - "node_modules/@types/react-intl": { - "version": "2.3.18", - "resolved": "https://registry.npmjs.org/@types/react-intl/-/react-intl-2.3.18.tgz", - "integrity": "sha512-DVNJs49zUxKRZng8VuILE886Yihdsf3yLr5vHk9zJrmF8SyRSK3sxNSvikAKxNkv9hX55XBTJShz6CkJnbNjgg==" - }, "node_modules/@types/react-intl-redux": { "version": "0.1.19", "resolved": "https://registry.npmjs.org/@types/react-intl-redux/-/react-intl-redux-0.1.19.tgz", @@ -4656,51 +4650,6 @@ "redux": "^4.0.0" } }, - "node_modules/@types/react-intl-redux/node_modules/intl-format-cache": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-4.3.1.tgz", - "integrity": "sha512-OEUYNA7D06agqPOYhbTkl0T8HA3QKSuwWh1HiClEnpd9vw7N+3XsQt5iZ0GUEchp5CW1fQk/tary+NsbF3yQ1Q==" - }, - "node_modules/@types/react-intl-redux/node_modules/intl-messageformat": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-7.8.4.tgz", - "integrity": "sha512-yS0cLESCKCYjseCOGXuV4pxJm/buTfyCJ1nzQjryHmSehlptbZbn9fnlk1I9peLopZGGbjj46yHHiTAEZ1qOTA==", - "dependencies": { - "intl-format-cache": "^4.2.21", - "intl-messageformat-parser": "^3.6.4" - } - }, - "node_modules/@types/react-intl-redux/node_modules/intl-messageformat-parser": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-3.6.4.tgz", - "integrity": "sha512-RgPGwue0mJtoX2Ax8EmMzJzttxjnva7gx0Q7mKJ4oALrTZvtmCeAw5Msz2PcjW4dtCh/h7vN/8GJCxZO1uv+OA==", - "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser", - "dependencies": { - "@formatjs/intl-unified-numberformat": "^3.2.0" - } - }, - "node_modules/@types/react-intl-redux/node_modules/react-intl": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-3.12.1.tgz", - "integrity": "sha512-cgumW29mwROIqyp8NXStYsoIm27+8FqnxykiLSawWjOxGIBeLuN/+p2srei5SRIumcJefOkOIHP+NDck05RgHg==", - "dependencies": { - "@formatjs/intl-displaynames": "^1.2.0", - "@formatjs/intl-listformat": "^1.4.1", - "@formatjs/intl-relativetimeformat": "^4.5.9", - "@formatjs/intl-unified-numberformat": "^3.2.0", - "@formatjs/intl-utils": "^2.2.0", - "@types/hoist-non-react-statics": "^3.3.1", - "@types/invariant": "^2.2.31", - "hoist-non-react-statics": "^3.3.2", - "intl-format-cache": "^4.2.21", - "intl-messageformat": "^7.8.4", - "intl-messageformat-parser": "^3.6.4", - "shallow-equal": "^1.2.1" - }, - "peerDependencies": { - "react": "^16.3.0" - } - }, "node_modules/@types/react-redux": { "version": "7.1.30", "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.30.tgz", @@ -11701,39 +11650,26 @@ } }, "node_modules/intl-format-cache": { - "version": "2.2.9", - "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-2.2.9.tgz", - "integrity": "sha512-Zv/u8wRpekckv0cLkwpVdABYST4hZNTDaX7reFetrYTJwxExR2VyTqQm+l0WmL0Qo8Mjb9Tf33qnfj0T7pjxdQ==" + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-4.3.1.tgz", + "integrity": "sha512-OEUYNA7D06agqPOYhbTkl0T8HA3QKSuwWh1HiClEnpd9vw7N+3XsQt5iZ0GUEchp5CW1fQk/tary+NsbF3yQ1Q==" }, "node_modules/intl-messageformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-2.2.0.tgz", - "integrity": "sha512-I+tSvHnXqJYjDfNmY95tpFMj30yoakC6OXAo+wu/wTMy6tA/4Fd4mvV7Uzs4cqK/Ap29sHhwjcY+78a8eifcXw==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-7.8.4.tgz", + "integrity": "sha512-yS0cLESCKCYjseCOGXuV4pxJm/buTfyCJ1nzQjryHmSehlptbZbn9fnlk1I9peLopZGGbjj46yHHiTAEZ1qOTA==", "dependencies": { - "intl-messageformat-parser": "1.4.0" + "intl-format-cache": "^4.2.21", + "intl-messageformat-parser": "^3.6.4" } }, "node_modules/intl-messageformat-parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz", - "integrity": "sha512-/XkqFHKezO6UcF4Av2/Lzfrez18R0jyw7kRFhSeB/YRakdrgSc9QfFZUwNJI9swMwMoNPygK1ArC5wdFSjPw+A==", - "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser" - }, - "node_modules/intl-relativeformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/intl-relativeformat/-/intl-relativeformat-2.2.0.tgz", - "integrity": "sha512-4bV/7kSKaPEmu6ArxXf9xjv1ny74Zkwuey8Pm01NH4zggPP7JHwg2STk8Y3JdspCKRDriwIyLRfEXnj2ZLr4Bw==", - "deprecated": "This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'", - "dependencies": { - "intl-messageformat": "^2.0.0" - } - }, - "node_modules/invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-3.6.4.tgz", + "integrity": "sha512-RgPGwue0mJtoX2Ax8EmMzJzttxjnva7gx0Q7mKJ4oALrTZvtmCeAw5Msz2PcjW4dtCh/h7vN/8GJCxZO1uv+OA==", + "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser", "dependencies": { - "loose-envify": "^1.0.0" + "@formatjs/intl-unified-numberformat": "^3.2.0" } }, "node_modules/ipaddr.js": { @@ -18997,19 +18933,25 @@ "integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==" }, "node_modules/react-intl": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-2.9.0.tgz", - "integrity": "sha512-27jnDlb/d2A7mSJwrbOBnUgD+rPep+abmoJE511Tf8BnoONIAUehy/U1zZCHGO17mnOwMWxqN4qC0nW11cD6rA==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-3.12.1.tgz", + "integrity": "sha512-cgumW29mwROIqyp8NXStYsoIm27+8FqnxykiLSawWjOxGIBeLuN/+p2srei5SRIumcJefOkOIHP+NDck05RgHg==", "dependencies": { - "hoist-non-react-statics": "^3.3.0", - "intl-format-cache": "^2.0.5", - "intl-messageformat": "^2.1.0", - "intl-relativeformat": "^2.1.0", - "invariant": "^2.1.1" + "@formatjs/intl-displaynames": "^1.2.0", + "@formatjs/intl-listformat": "^1.4.1", + "@formatjs/intl-relativetimeformat": "^4.5.9", + "@formatjs/intl-unified-numberformat": "^3.2.0", + "@formatjs/intl-utils": "^2.2.0", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/invariant": "^2.2.31", + "hoist-non-react-statics": "^3.3.2", + "intl-format-cache": "^4.2.21", + "intl-messageformat": "^7.8.4", + "intl-messageformat-parser": "^3.6.4", + "shallow-equal": "^1.2.1" }, "peerDependencies": { - "prop-types": "^15.5.4", - "react": "^0.14.9 || ^15.0.0 || ^16.0.0" + "react": "^16.3.0" } }, "node_modules/react-intl-redux": { @@ -26626,11 +26568,6 @@ "@types/react": "^17" } }, - "@types/react-intl": { - "version": "2.3.18", - "resolved": "https://registry.npmjs.org/@types/react-intl/-/react-intl-2.3.18.tgz", - "integrity": "sha512-DVNJs49zUxKRZng8VuILE886Yihdsf3yLr5vHk9zJrmF8SyRSK3sxNSvikAKxNkv9hX55XBTJShz6CkJnbNjgg==" - }, "@types/react-intl-redux": { "version": "0.1.19", "resolved": "https://registry.npmjs.org/@types/react-intl-redux/-/react-intl-redux-0.1.19.tgz", @@ -26639,49 +26576,6 @@ "@types/react-redux": "*", "react-intl": "^3", "redux": "^4.0.0" - }, - "dependencies": { - "intl-format-cache": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-4.3.1.tgz", - "integrity": "sha512-OEUYNA7D06agqPOYhbTkl0T8HA3QKSuwWh1HiClEnpd9vw7N+3XsQt5iZ0GUEchp5CW1fQk/tary+NsbF3yQ1Q==" - }, - "intl-messageformat": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-7.8.4.tgz", - "integrity": "sha512-yS0cLESCKCYjseCOGXuV4pxJm/buTfyCJ1nzQjryHmSehlptbZbn9fnlk1I9peLopZGGbjj46yHHiTAEZ1qOTA==", - "requires": { - "intl-format-cache": "^4.2.21", - "intl-messageformat-parser": "^3.6.4" - } - }, - "intl-messageformat-parser": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-3.6.4.tgz", - "integrity": "sha512-RgPGwue0mJtoX2Ax8EmMzJzttxjnva7gx0Q7mKJ4oALrTZvtmCeAw5Msz2PcjW4dtCh/h7vN/8GJCxZO1uv+OA==", - "requires": { - "@formatjs/intl-unified-numberformat": "^3.2.0" - } - }, - "react-intl": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-3.12.1.tgz", - "integrity": "sha512-cgumW29mwROIqyp8NXStYsoIm27+8FqnxykiLSawWjOxGIBeLuN/+p2srei5SRIumcJefOkOIHP+NDck05RgHg==", - "requires": { - "@formatjs/intl-displaynames": "^1.2.0", - "@formatjs/intl-listformat": "^1.4.1", - "@formatjs/intl-relativetimeformat": "^4.5.9", - "@formatjs/intl-unified-numberformat": "^3.2.0", - "@formatjs/intl-utils": "^2.2.0", - "@types/hoist-non-react-statics": "^3.3.1", - "@types/invariant": "^2.2.31", - "hoist-non-react-statics": "^3.3.2", - "intl-format-cache": "^4.2.21", - "intl-messageformat": "^7.8.4", - "intl-messageformat-parser": "^3.6.4", - "shallow-equal": "^1.2.1" - } - } } }, "@types/react-redux": { @@ -31766,37 +31660,25 @@ } }, "intl-format-cache": { - "version": "2.2.9", - "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-2.2.9.tgz", - "integrity": "sha512-Zv/u8wRpekckv0cLkwpVdABYST4hZNTDaX7reFetrYTJwxExR2VyTqQm+l0WmL0Qo8Mjb9Tf33qnfj0T7pjxdQ==" + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/intl-format-cache/-/intl-format-cache-4.3.1.tgz", + "integrity": "sha512-OEUYNA7D06agqPOYhbTkl0T8HA3QKSuwWh1HiClEnpd9vw7N+3XsQt5iZ0GUEchp5CW1fQk/tary+NsbF3yQ1Q==" }, "intl-messageformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-2.2.0.tgz", - "integrity": "sha512-I+tSvHnXqJYjDfNmY95tpFMj30yoakC6OXAo+wu/wTMy6tA/4Fd4mvV7Uzs4cqK/Ap29sHhwjcY+78a8eifcXw==", + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-7.8.4.tgz", + "integrity": "sha512-yS0cLESCKCYjseCOGXuV4pxJm/buTfyCJ1nzQjryHmSehlptbZbn9fnlk1I9peLopZGGbjj46yHHiTAEZ1qOTA==", "requires": { - "intl-messageformat-parser": "1.4.0" + "intl-format-cache": "^4.2.21", + "intl-messageformat-parser": "^3.6.4" } }, "intl-messageformat-parser": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz", - "integrity": "sha512-/XkqFHKezO6UcF4Av2/Lzfrez18R0jyw7kRFhSeB/YRakdrgSc9QfFZUwNJI9swMwMoNPygK1ArC5wdFSjPw+A==" - }, - "intl-relativeformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/intl-relativeformat/-/intl-relativeformat-2.2.0.tgz", - "integrity": "sha512-4bV/7kSKaPEmu6ArxXf9xjv1ny74Zkwuey8Pm01NH4zggPP7JHwg2STk8Y3JdspCKRDriwIyLRfEXnj2ZLr4Bw==", - "requires": { - "intl-messageformat": "^2.0.0" - } - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-3.6.4.tgz", + "integrity": "sha512-RgPGwue0mJtoX2Ax8EmMzJzttxjnva7gx0Q7mKJ4oALrTZvtmCeAw5Msz2PcjW4dtCh/h7vN/8GJCxZO1uv+OA==", "requires": { - "loose-envify": "^1.0.0" + "@formatjs/intl-unified-numberformat": "^3.2.0" } }, "ipaddr.js": { @@ -36768,15 +36650,22 @@ "integrity": "sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==" }, "react-intl": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-2.9.0.tgz", - "integrity": "sha512-27jnDlb/d2A7mSJwrbOBnUgD+rPep+abmoJE511Tf8BnoONIAUehy/U1zZCHGO17mnOwMWxqN4qC0nW11cD6rA==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-3.12.1.tgz", + "integrity": "sha512-cgumW29mwROIqyp8NXStYsoIm27+8FqnxykiLSawWjOxGIBeLuN/+p2srei5SRIumcJefOkOIHP+NDck05RgHg==", "requires": { - "hoist-non-react-statics": "^3.3.0", - "intl-format-cache": "^2.0.5", - "intl-messageformat": "^2.1.0", - "intl-relativeformat": "^2.1.0", - "invariant": "^2.1.1" + "@formatjs/intl-displaynames": "^1.2.0", + "@formatjs/intl-listformat": "^1.4.1", + "@formatjs/intl-relativetimeformat": "^4.5.9", + "@formatjs/intl-unified-numberformat": "^3.2.0", + "@formatjs/intl-utils": "^2.2.0", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/invariant": "^2.2.31", + "hoist-non-react-statics": "^3.3.2", + "intl-format-cache": "^4.2.21", + "intl-messageformat": "^7.8.4", + "intl-messageformat-parser": "^3.6.4", + "shallow-equal": "^1.2.1" } }, "react-intl-redux": { diff --git a/package.json b/package.json index a0b91be4..4af2843a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "@types/react-aria-menubutton": "^6.2.12", "@types/react-collapse": "^5.0.4", "@types/react-dom": "^17.0.23", - "@types/react-intl": "^2.3.18", "@types/react-intl-redux": "^0.1.19", "@types/react-redux": "^7.1.30", "@types/react-router": "^5.1.20", @@ -81,7 +80,7 @@ "react-burger-menu": "^3.0.9", "react-collapse": "^5.1.1", "react-dom": "^17.0.2", - "react-intl": "^2.9.0", + "react-intl": "^3.12.1", "react-intl-redux": "^2.3.0", "react-modal": "^3.16.1", "react-motion": "^0.5.2", @@ -162,6 +161,9 @@ ], "snapshotSerializers": [ "enzyme-to-json/serializer" + ], + "transformIgnorePatterns": [ + "/node_modules/(?!intl-messageformat|intl-messageformat-parser).+\\.js$" ] }, "husky": { diff --git a/src/__test__/components/__snapshots__/navKnapp.snapshot.test.tsx.snap b/src/__test__/components/__snapshots__/navKnapp.snapshot.test.tsx.snap index 49afd439..64984464 100644 --- a/src/__test__/components/__snapshots__/navKnapp.snapshot.test.tsx.snap +++ b/src/__test__/components/__snapshots__/navKnapp.snapshot.test.tsx.snap @@ -7,8 +7,6 @@ exports[`NavKnapp 1`] = ` onClick={[Function]} type="submit" > - - Neste - + Neste `; diff --git a/src/__test__/components/__snapshots__/periodeBanner.snapshot.test.tsx.snap b/src/__test__/components/__snapshots__/periodeBanner.snapshot.test.tsx.snap index ba6ff64d..64b61949 100644 --- a/src/__test__/components/__snapshots__/periodeBanner.snapshot.test.tsx.snap +++ b/src/__test__/components/__snapshots__/periodeBanner.snapshot.test.tsx.snap @@ -8,9 +8,7 @@ exports[`PeriodeBanner 1`] = `
- - Meldekort for perioden - + Meldekort for perioden
, - localeData: localeDataNB, } -const locales: Locales = [locale] +const locales: Locale[] = [locale] const intl: IntlState = { locale: 'nb', diff --git a/src/app/app.tsx b/src/app/app.tsx index c45fe49b..12ef6928 100644 --- a/src/app/app.tsx +++ b/src/app/app.tsx @@ -34,7 +34,7 @@ import { isOldIE, isOldSafari, } from './utils/browsers'; -import { InjectedIntlProps, injectIntl } from 'react-intl'; +import { WrappedComponentProps, injectIntl } from 'react-intl'; if (erMock()) { setupMock(); @@ -56,7 +56,7 @@ interface MapDispatchToProps { toggleMeny: (erApen: boolean) => void; } -type Props = MapStateToProps & MapDispatchToProps & InjectedIntlProps; +type Props = MapStateToProps & MapDispatchToProps & WrappedComponentProps; interface AppState { henterPersonInfo: boolean; diff --git a/src/app/reducers/localesReducer.tsx b/src/app/reducers/localesReducer.tsx index 1b182424..5800c4d8 100644 --- a/src/app/reducers/localesReducer.tsx +++ b/src/app/reducers/localesReducer.tsx @@ -1,42 +1,34 @@ import * as React from 'react'; import NorskFlaggSVG from '../components/sprakvelger/NorskFlaggSVG'; import EngelskFlaggSVG from '../components/sprakvelger/EngelskFlaggSVG'; -import localeDataNB from 'react-intl/locale-data/nb'; -import localeDataEN from 'react-intl/locale-data/en'; export interface Locale { label: string; tittel: string; ikon: JSX.Element; - localeData: ReactIntl.LocaleData; } -export interface Locales extends Array