diff --git a/docs/user_guide/assets/licenses/frontend_licenses.txt b/docs/user_guide/assets/licenses/frontend_licenses.txt index 4b24bef762..377178bf29 100644 --- a/docs/user_guide/assets/licenses/frontend_licenses.txt +++ b/docs/user_guide/assets/licenses/frontend_licenses.txt @@ -1488,7 +1488,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -@reduxjs/toolkit 1.9.7 +@reduxjs/toolkit 2.5.0 MIT MIT License @@ -1765,31 +1765,6 @@ MIT SOFTWARE -@types/react-dom 18.3.0 -MIT - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE - - @types/react-redux 7.1.33 MIT MIT License @@ -1865,7 +1840,7 @@ MIT SOFTWARE -@types/use-sync-external-store 0.0.3 +@types/use-sync-external-store 0.0.6 MIT MIT License @@ -3319,7 +3294,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -immer 9.0.21 +immer 10.1.1 MIT MIT License @@ -4454,7 +4429,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -react-redux 8.1.3 +react-redux 9.2.0 MIT The MIT License (MIT) @@ -4666,7 +4641,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -redux-thunk 2.4.2 +redux-thunk 3.1.0 MIT The MIT License (MIT) @@ -4716,6 +4691,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +redux 5.0.1 +MIT +The MIT License (MIT) + +Copyright (c) 2015-present Dan Abramov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + regenerator-runtime 0.14.1 MIT MIT License @@ -4793,7 +4793,7 @@ SOFTWARE. -reselect 4.1.8 +reselect 5.1.1 MIT The MIT License (MIT) @@ -5192,11 +5192,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -use-sync-external-store 1.2.2 +use-sync-external-store 1.4.0 MIT MIT License -Copyright (c) Facebook, Inc. and its affiliates. +Copyright (c) Meta Platforms, Inc. and affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package-lock.json b/package-lock.json index af1d2c7673..8bc6251227 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,8 @@ "@mui/icons-material": "^5.15.7", "@mui/material": "^5.14.16", "@mui/x-date-pickers": "^6.18.7", - "@redux-devtools/extension": "^3.2.5", - "@reduxjs/toolkit": "^1.9.5", + "@redux-devtools/extension": "^3.3.0", + "@reduxjs/toolkit": "^2.5.0", "axios": "^1.7.7", "chart.js": "^4.4.0", "crypto-js": "^4.2.0", @@ -44,13 +44,13 @@ "react-dom": "^18.2.0", "react-i18next": "^15.0.1", "react-modal": "^3.16.1", - "react-redux": "^8.1.3", + "react-redux": "^9.2.0", "react-router-dom": "^6.16.0", "react-toastify": "^9.1.3", "recordrtc": "^5.6.1", - "redux": "^4.2.1", + "redux": "^5.0.1", "redux-persist": "^6.0.0", - "redux-thunk": "^2.4.0", + "redux-thunk": "^3.1.0", "ts-key-enum": "^2.0.12", "uuid": "^9.0.1", "validator": "^13.11.0", @@ -73,7 +73,7 @@ "@types/react-modal": "^3.16.1", "@types/react-test-renderer": "^18.0.7", "@types/recordrtc": "^5.6.12", - "@types/redux-mock-store": "^1.0.4", + "@types/redux-mock-store": "^1.5.0", "@types/uuid": "^9.0.8", "@types/validator": "^13.11.1", "@typescript-eslint/eslint-plugin": "^7.1.0", @@ -91,7 +91,7 @@ "prettier": "^3.3.3", "react-scripts": "^5.0.1", "react-test-renderer": "^18.2.0", - "redux-mock-store": "^1.5.4", + "redux-mock-store": "^1.5.5", "source-map-explorer": "^2.5.3", "typescript": "^4.9.5" } @@ -3935,6 +3935,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/@redux-devtools/extension/-/extension-3.3.0.tgz", "integrity": "sha512-X34S/rC8S/M1BIrkYD1mJ5f8vlH0BDqxXrs96cvxSBo4FhMdbhU+GUGsmNYov1xjSyLMHgo8NYrUG8bNX7525g==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.2", "immutable": "^4.3.4" @@ -3944,18 +3945,19 @@ } }, "node_modules/@reduxjs/toolkit": { - "version": "1.9.7", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.7.tgz", - "integrity": "sha512-t7v8ZPxhhKgOKtU+uyJT13lu4vL7az5aFi4IdoDs/eS548edn2M8Ik9h8fxgvMjGoAUVFSt6ZC1P5cWmQ014QQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.5.0.tgz", + "integrity": "sha512-awNe2oTodsZ6LmRqmkFhtb/KH03hUhxOamEQy411m3Njj3BbFvoBovxo4Q1cBWnV1ErprVj9MlF0UPXkng0eyg==", + "license": "MIT", "dependencies": { - "immer": "^9.0.21", - "redux": "^4.2.1", - "redux-thunk": "^2.4.2", - "reselect": "^4.1.8" + "immer": "^10.0.3", + "redux": "^5.0.1", + "redux-thunk": "^3.1.0", + "reselect": "^5.1.0" }, "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18", - "react-redux": "^7.2.1 || ^8.0.2" + "react": "^16.9.0 || ^17.0.0 || ^18 || ^19", + "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" }, "peerDependenciesMeta": { "react": { @@ -3966,6 +3968,16 @@ } } }, + "node_modules/@reduxjs/toolkit/node_modules/immer": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.1.1.tgz", + "integrity": "sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, "node_modules/@remix-run/router": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.17.0.tgz", @@ -4982,7 +4994,7 @@ "version": "18.3.0", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", - "devOptional": true, + "dev": true, "dependencies": { "@types/react": "*" } @@ -5007,6 +5019,15 @@ "redux": "^4.0.0" } }, + "node_modules/@types/react-redux/node_modules/redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.9.2" + } + }, "node_modules/@types/react-test-renderer": { "version": "18.3.0", "resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-18.3.0.tgz", @@ -5031,14 +5052,25 @@ "dev": true }, "node_modules/@types/redux-mock-store": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/redux-mock-store/-/redux-mock-store-1.0.6.tgz", - "integrity": "sha512-eg5RDfhJTXuoJjOMyXiJbaDb1B8tfTaJixscmu+jOusj6adGC0Krntz09Tf4gJgXeCqCrM5bBMd+B7ez0izcAQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@types/redux-mock-store/-/redux-mock-store-1.5.0.tgz", + "integrity": "sha512-jcscBazm6j05Hs6xYCca6psTUBbFT2wqMxT7wZEHAYFxHB/I8jYk7d5msrHUlDiSL02HdTqTmkK2oIV8i3C8DA==", "dev": true, + "license": "MIT", "dependencies": { "redux": "^4.0.5" } }, + "node_modules/@types/redux-mock-store/node_modules/redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.9.2" + } + }, "node_modules/@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -5112,9 +5144,9 @@ "dev": true }, "node_modules/@types/use-sync-external-store": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", - "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==" }, "node_modules/@types/uuid": { "version": "9.0.8", @@ -11487,6 +11519,7 @@ "version": "9.0.21", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==", + "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/immer" @@ -17566,6 +17599,15 @@ } } }, + "node_modules/react-beautiful-dnd/node_modules/redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.9.2" + } + }, "node_modules/react-chartjs-2": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.2.0.tgz", @@ -17757,48 +17799,28 @@ } }, "node_modules/react-redux": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", - "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz", + "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.12.1", - "@types/hoist-non-react-statics": "^3.3.1", - "@types/use-sync-external-store": "^0.0.3", - "hoist-non-react-statics": "^3.3.2", - "react-is": "^18.0.0", - "use-sync-external-store": "^1.0.0" + "@types/use-sync-external-store": "^0.0.6", + "use-sync-external-store": "^1.4.0" }, "peerDependencies": { - "@types/react": "^16.8 || ^17.0 || ^18.0", - "@types/react-dom": "^16.8 || ^17.0 || ^18.0", - "react": "^16.8 || ^17.0 || ^18.0", - "react-dom": "^16.8 || ^17.0 || ^18.0", - "react-native": ">=0.59", - "redux": "^4 || ^5.0.0-beta.0" + "@types/react": "^18.2.25 || ^19", + "react": "^18.0 || ^19", + "redux": "^5.0.0" }, "peerDependenciesMeta": { "@types/react": { "optional": true }, - "@types/react-dom": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - }, "redux": { "optional": true } } }, - "node_modules/react-redux/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" - }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -19336,36 +19358,40 @@ } }, "node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "dependencies": { - "@babel/runtime": "^7.9.2" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "license": "MIT" }, "node_modules/redux-mock-store": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/redux-mock-store/-/redux-mock-store-1.5.4.tgz", - "integrity": "sha512-xmcA0O/tjCLXhh9Fuiq6pMrJCwFRaouA8436zcikdIpYWWCjU76CRk+i2bHx8EeiSiMGnB85/lZdU3wIJVXHTA==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/redux-mock-store/-/redux-mock-store-1.5.5.tgz", + "integrity": "sha512-YxX+ofKUTQkZE4HbhYG4kKGr7oCTJfB0GLy7bSeqx86GLpGirrbUWstMnqXkqHNaQpcnbMGbof2dYs5KsPE6Zg==", "dev": true, + "license": "MIT", "dependencies": { "lodash.isplainobject": "^4.0.6" + }, + "peerDependencies": { + "redux": "*" } }, "node_modules/redux-persist": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/redux-persist/-/redux-persist-6.0.0.tgz", "integrity": "sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ==", + "license": "MIT", "peerDependencies": { "redux": ">4.0.0" } }, "node_modules/redux-thunk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.4.2.tgz", - "integrity": "sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "license": "MIT", "peerDependencies": { - "redux": "^4" + "redux": "^5.0.0" } }, "node_modules/reflect.getprototypeof": { @@ -19534,9 +19560,10 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/reselect": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz", - "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", + "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", + "license": "MIT" }, "node_modules/resolve": { "version": "1.22.8", @@ -22067,11 +22094,11 @@ } }, "node_modules/use-sync-external-store": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", - "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz", + "integrity": "sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==", "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/util-deprecate": { diff --git a/package.json b/package.json index 59e5a43695..f958184603 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "@mui/icons-material": "^5.15.7", "@mui/material": "^5.14.16", "@mui/x-date-pickers": "^6.18.7", - "@redux-devtools/extension": "^3.2.5", - "@reduxjs/toolkit": "^1.9.5", + "@redux-devtools/extension": "^3.3.0", + "@reduxjs/toolkit": "^2.5.0", "axios": "^1.7.7", "chart.js": "^4.4.0", "crypto-js": "^4.2.0", @@ -72,13 +72,13 @@ "react-dom": "^18.2.0", "react-i18next": "^15.0.1", "react-modal": "^3.16.1", - "react-redux": "^8.1.3", + "react-redux": "^9.2.0", "react-router-dom": "^6.16.0", "react-toastify": "^9.1.3", "recordrtc": "^5.6.1", - "redux": "^4.2.1", + "redux": "^5.0.1", "redux-persist": "^6.0.0", - "redux-thunk": "^2.4.0", + "redux-thunk": "^3.1.0", "ts-key-enum": "^2.0.12", "uuid": "^9.0.1", "validator": "^13.11.0", @@ -101,7 +101,7 @@ "@types/react-modal": "^3.16.1", "@types/react-test-renderer": "^18.0.7", "@types/recordrtc": "^5.6.12", - "@types/redux-mock-store": "^1.0.4", + "@types/redux-mock-store": "^1.5.0", "@types/uuid": "^9.0.8", "@types/validator": "^13.11.1", "@typescript-eslint/eslint-plugin": "^7.1.0", @@ -119,7 +119,7 @@ "prettier": "^3.3.3", "react-scripts": "^5.0.1", "react-test-renderer": "^18.2.0", - "redux-mock-store": "^1.5.4", + "redux-mock-store": "^1.5.5", "source-map-explorer": "^2.5.3", "typescript": "^4.9.5" }, diff --git a/src/components/App/tests/index.test.tsx b/src/components/App/tests/index.test.tsx index 5fc1db0209..58192465c8 100644 --- a/src/components/App/tests/index.test.tsx +++ b/src/components/App/tests/index.test.tsx @@ -4,7 +4,6 @@ import "jest-canvas-mock"; import { act } from "react"; import { Provider } from "react-redux"; import configureMockStore from "redux-mock-store"; -import thunk from "redux-thunk"; import App from "components/App"; import { defaultState } from "rootRedux/types"; @@ -12,7 +11,7 @@ import theme from "types/theme"; jest.mock("react-router-dom"); -const createMockStore = configureMockStore([thunk]); +const createMockStore = configureMockStore(); const mockStore = createMockStore(defaultState); // Need window.innerHeight defined for LandingPage. diff --git a/src/components/TreeView/tests/index.test.tsx b/src/components/TreeView/tests/index.test.tsx index 03fb73ab93..dbaf2e4a29 100644 --- a/src/components/TreeView/tests/index.test.tsx +++ b/src/components/TreeView/tests/index.test.tsx @@ -2,7 +2,6 @@ import { ThemeProvider } from "@mui/material/styles"; import { Provider } from "react-redux"; import renderer from "react-test-renderer"; import configureMockStore from "redux-mock-store"; -import thunk from "redux-thunk"; import { Key } from "ts-key-enum"; import TreeView, { exitButtonId, topButtonId } from "components/TreeView"; @@ -30,7 +29,7 @@ jest.mock("rootRedux/hooks", () => { }; }); -const mockStore = configureMockStore([thunk])({ +const mockStore = configureMockStore()({ treeViewState: { ...treeViewState, currentDomain: mockMap[mapIds.parent] }, currentProjectState: { project: { semDomWritingSystem: newWritingSystem() }, diff --git a/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx b/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx index 2baebb20a9..2cf8c7d901 100644 --- a/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx +++ b/src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx @@ -1,4 +1,4 @@ -import { type Action, type PreloadedState } from "redux"; +import { type Action } from "redux"; import { type Project, type Word } from "api/models"; import { @@ -47,7 +47,7 @@ const mockGetFrontierWords = jest.fn(); const mockUpdateWord = jest.fn(); const bumpId = (id: string): string => `${id}++`; -const mockAction: Action = { type: null }; +const mockAction: Action = { type: "" }; const setMockFunctions = (): void => { mockAddCharInvChangesToGoal.mockReturnValue(mockAction); mockAsyncUpdateCurrentProject.mockReturnValue(mockAction); @@ -64,7 +64,7 @@ beforeEach(() => { describe("CharacterInventoryActions", () => { describe("setCharacterStatus", () => { const character = "C"; - const mockState = (status: CharacterStatus): PreloadedState => { + const mockState = (status: CharacterStatus): RootState => { const entry: CharacterSetEntry = { character, occurrences: 0, status }; const rej = status === CharacterStatus.Rejected ? [character] : []; const val = status === CharacterStatus.Accepted ? [character] : []; diff --git a/src/goals/DefaultGoal/tests/BaseGoalScreen.test.tsx b/src/goals/DefaultGoal/tests/BaseGoalScreen.test.tsx index ac9593ae65..45b404461c 100644 --- a/src/goals/DefaultGoal/tests/BaseGoalScreen.test.tsx +++ b/src/goals/DefaultGoal/tests/BaseGoalScreen.test.tsx @@ -2,12 +2,11 @@ import "jest-canvas-mock"; import { Provider } from "react-redux"; import renderer from "react-test-renderer"; import configureMockStore from "redux-mock-store"; -import thunk from "redux-thunk"; import { BaseGoalScreen } from "goals/DefaultGoal/BaseGoalScreen"; import { Goal } from "types/goals"; -const createMockStore = configureMockStore([thunk]); +const createMockStore = configureMockStore(); const mockStoreState = { goalsState: { currentGoal: new Goal() } }; const mockStore = createMockStore(mockStoreState); diff --git a/src/goals/DefaultGoal/tests/DisplayProgress.test.tsx b/src/goals/DefaultGoal/tests/DisplayProgress.test.tsx index 9a62cc9312..3809c6e00e 100644 --- a/src/goals/DefaultGoal/tests/DisplayProgress.test.tsx +++ b/src/goals/DefaultGoal/tests/DisplayProgress.test.tsx @@ -1,13 +1,12 @@ import { Provider } from "react-redux"; import { act, create } from "react-test-renderer"; import configureMockStore from "redux-mock-store"; -import thunk from "redux-thunk"; import DisplayProgress from "goals/DefaultGoal/DisplayProgress"; import { MergeDups } from "goals/MergeDuplicates/MergeDupsTypes"; import { Goal } from "types/goals"; -const createMockStore = configureMockStore([thunk]); +const createMockStore = configureMockStore(); let mockStore = createMockStore(); function createMockStoreWithGoal(goal: Goal): void { const mockStoreState = { goalsState: { currentGoal: goal } }; diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts b/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts index 1f66b63766..bb70c7b231 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsDataMock.ts @@ -1,5 +1,3 @@ -import { type PreloadedState } from "@reduxjs/toolkit"; - import { type Definition, type SemanticDomain, type Word } from "api/models"; import { convertSenseToMergeTreeSense, @@ -98,7 +96,7 @@ export type ExpectedScenarioResult = { }; export type GetMergeWordsScenario = { - initialState: () => PreloadedState; + initialState: () => RootState; expectedResult: ExpectedScenarioResult[]; }; diff --git a/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx b/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx index 77ab8eed44..bf675b6f8f 100644 --- a/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx +++ b/src/goals/MergeDuplicates/Redux/tests/MergeDupsReducer.test.tsx @@ -1,4 +1,8 @@ -import { type Action, type PayloadAction } from "@reduxjs/toolkit"; +import { + type Action, + type PayloadAction, + type UnknownAction, +} from "@reduxjs/toolkit"; import { type MergeTreeReference, @@ -570,9 +574,9 @@ describe("MergeDupsReducer", () => { type: StoreActionTypes.RESET, }; - expect(mergeDupStepReducer({} as MergeTreeState, action)).toEqual( - defaultState - ); + expect( + mergeDupStepReducer({} as MergeTreeState, action as UnknownAction) + ).toEqual(defaultState); }); test("setWordData", () => { diff --git a/src/rootRedux/reducer.ts b/src/rootRedux/reducer.ts index 920c615645..b30407a80c 100644 --- a/src/rootRedux/reducer.ts +++ b/src/rootRedux/reducer.ts @@ -11,7 +11,7 @@ import goalsReducer from "goals/Redux/GoalReducer"; import { type StoreState } from "rootRedux/types"; import analyticsReducer from "types/Redux/analytics"; -export const rootReducer: Reducer = combineReducers({ +export const rootReducer: Reducer = combineReducers({ //login and signup loginState: loginReducer, diff --git a/src/rootRedux/store.ts b/src/rootRedux/store.ts index c821939bac..7c69b532fd 100644 --- a/src/rootRedux/store.ts +++ b/src/rootRedux/store.ts @@ -1,19 +1,23 @@ -import { type PreloadedState, configureStore } from "@reduxjs/toolkit"; +import { type Action, configureStore } from "@reduxjs/toolkit"; import { persistStore, persistReducer } from "redux-persist"; import storage from "redux-persist/lib/storage"; import { rootReducer } from "rootRedux/reducer"; +import { type StoreState } from "rootRedux/types"; const persistConfig = { key: "root", storage }; -const persistedReducer = persistReducer(persistConfig, rootReducer); +const persistedReducer = persistReducer( + persistConfig, + rootReducer +); // In development and test, immutability check enabled for the Redux reducers const immutableCheckConfig = process.env.NODE_ENV !== "production" ? { warnAfter: 1000 } : false; // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -export const setupStore = (preloadedState?: PreloadedState) => { +export const setupStore = (preloadedState?: RootState) => { return configureStore({ reducer: persistedReducer, // for each of the default middleware items set to: diff --git a/src/rootRedux/testTypes.ts b/src/rootRedux/testTypes.ts index 9eecc4494f..c3e789501e 100644 --- a/src/rootRedux/testTypes.ts +++ b/src/rootRedux/testTypes.ts @@ -1,10 +1,8 @@ -import { type PreloadedState } from "redux"; - import { type RootState } from "rootRedux/store"; import { defaultState } from "rootRedux/types"; /** Preloaded values for store when testing */ -export const persistedDefaultState: PreloadedState = { +export const persistedDefaultState: RootState = { ...defaultState, _persist: { rehydrated: false, version: -1 }, }; diff --git a/src/utilities/testingLibraryUtilities.tsx b/src/utilities/testingLibraryUtilities.tsx index ce384e48ef..681d2f9548 100644 --- a/src/utilities/testingLibraryUtilities.tsx +++ b/src/utilities/testingLibraryUtilities.tsx @@ -1,4 +1,3 @@ -import { type PreloadedState } from "@reduxjs/toolkit"; import { type RenderOptions, render } from "@testing-library/react"; import { type PropsWithChildren, type ReactElement } from "react"; import { Provider } from "react-redux"; @@ -15,7 +14,7 @@ import { persistedDefaultState } from "rootRedux/testTypes"; /** This extends the default options for `render` from `@testing-library/react`, * allowing the user to specify other things such as `initialState`, `store`. */ interface ExtendedRenderOptions extends Omit { - preloadedState?: PreloadedState; + preloadedState?: RootState; store?: AppStore; }