diff --git a/generators/react/resources/package.json b/generators/react/resources/package.json index 0cd8f697b384..578e6200fe85 100644 --- a/generators/react/resources/package.json +++ b/generators/react/resources/package.json @@ -3,7 +3,7 @@ "@fortawesome/fontawesome-svg-core": "6.5.1", "@fortawesome/free-solid-svg-icons": "6.5.1", "@fortawesome/react-fontawesome": "0.2.0", - "@reduxjs/toolkit": "1.9.7", + "@reduxjs/toolkit": "2.0.1", "axios": "1.6.2", "bootstrap": "5.3.2", "bootswatch": "5.3.2", @@ -14,14 +14,14 @@ "react-hook-form": "7.48.2", "react-jhipster": "0.25.3", "react-loadable": "5.5.0", - "react-redux": "8.1.3", + "react-redux": "9.0.1", "react-redux-loading-bar": "5.0.5", "react-router-dom": "6.20.1", "react-toastify": "9.1.3", "react-transition-group": "4.4.5", "reactstrap": "9.2.1", - "redux": "4.2.1", - "redux-thunk": "2.4.2", + "redux": "5.0.0", + "redux-thunk": "3.1.0", "sonar-scanner": "3.1.0", "tslib": "2.6.2", "uuid": "9.0.1" @@ -34,7 +34,7 @@ "@types/node": "18.19.2", "@types/react": "18.2.42", "@types/react-dom": "18.2.17", - "@types/react-redux": "7.1.31", + "@types/react-redux": "7.1.32", "@types/redux": "3.6.31", "@types/webpack-env": "1.18.4", "@typescript-eslint/eslint-plugin": "6.13.2", diff --git a/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-reducer.spec.ts.ejs index 8e9a7330b352..57d0342e7a0e 100644 --- a/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-reducer.spec.ts.ejs @@ -271,7 +271,7 @@ describe('Entities reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.get = sinon.stub().returns(Promise.resolve(resolvedObject)); axios.post = sinon.stub().returns(Promise.resolve(resolvedObject)); diff --git a/generators/react/templates/src/main/webapp/app/modules/account/activate/activate.reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/modules/account/activate/activate.reducer.spec.ts.ejs index 06561a933386..38ff9147318b 100644 --- a/generators/react/templates/src/main/webapp/app/modules/account/activate/activate.reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/modules/account/activate/activate.reducer.spec.ts.ejs @@ -75,7 +75,7 @@ describe('Activate reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.get = sinon.stub().returns(Promise.resolve(resolvedObject)); }); diff --git a/generators/react/templates/src/main/webapp/app/modules/account/password/password.reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/modules/account/password/password.reducer.spec.ts.ejs index 3f0c6b253bb5..a92776ea238b 100644 --- a/generators/react/templates/src/main/webapp/app/modules/account/password/password.reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/modules/account/password/password.reducer.spec.ts.ejs @@ -91,7 +91,7 @@ describe('Password reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.post = sinon.stub().returns(Promise.resolve(resolvedObject)); }); diff --git a/generators/react/templates/src/main/webapp/app/modules/account/register/register.reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/modules/account/register/register.reducer.spec.ts.ejs index 14f983b09ac0..d32e762a1fc4 100644 --- a/generators/react/templates/src/main/webapp/app/modules/account/register/register.reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/modules/account/register/register.reducer.spec.ts.ejs @@ -99,7 +99,7 @@ describe('Creating account tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.post = sinon.stub().returns(Promise.resolve(resolvedObject)); }); diff --git a/generators/react/templates/src/main/webapp/app/modules/account/settings/settings.reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/modules/account/settings/settings.reducer.spec.ts.ejs index 5d9d72619eb0..a4cf48283fdb 100644 --- a/generators/react/templates/src/main/webapp/app/modules/account/settings/settings.reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/modules/account/settings/settings.reducer.spec.ts.ejs @@ -91,7 +91,7 @@ describe('Settings reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); <%_ if (enableTranslation) { _%> store = mockStore({ authentication: { account: { langKey: '<%= nativeLanguage %>' } } }); <%_ } else { _%> diff --git a/generators/react/templates/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs index f67ab5e22df7..aab2fe3c40f2 100644 --- a/generators/react/templates/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs @@ -266,7 +266,7 @@ describe('Administration reducer tests', () => { const resolvedObject = { value: 'whatever' }; <%_ if (applicationTypeGateway && serviceDiscoveryAny || withAdminUi) { _%> beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.get = sinon.stub().returns(Promise.resolve(resolvedObject)); axios.post = sinon.stub().returns(Promise.resolve(resolvedObject)); diff --git a/generators/react/templates/src/main/webapp/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs index 2168432fee5f..917230c03545 100644 --- a/generators/react/templates/src/main/webapp/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/modules/administration/user-management/user-management.reducer.spec.ts.ejs @@ -220,7 +220,7 @@ describe('User management reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.get = sinon.stub().returns(Promise.resolve(resolvedObject)); axios.put = sinon.stub().returns(Promise.resolve(resolvedObject)); diff --git a/generators/react/templates/src/main/webapp/app/shared/auth/private-route.spec.tsx.ejs b/generators/react/templates/src/main/webapp/app/shared/auth/private-route.spec.tsx.ejs index 44aacb190e0a..b555fd340370 100644 --- a/generators/react/templates/src/main/webapp/app/shared/auth/private-route.spec.tsx.ejs +++ b/generators/react/templates/src/main/webapp/app/shared/auth/private-route.spec.tsx.ejs @@ -22,7 +22,7 @@ describe('private-route component', () => { }); <%_ } _%> - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); const wrapper = (Elem: JSX.Element, authentication) => { const store = mockStore({ authentication }); return render( diff --git a/generators/react/templates/src/main/webapp/app/shared/reducers/application-profile.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/shared/reducers/application-profile.spec.ts.ejs index 9fb3f4063686..5fed3427ce3a 100644 --- a/generators/react/templates/src/main/webapp/app/shared/reducers/application-profile.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/shared/reducers/application-profile.spec.ts.ejs @@ -72,7 +72,7 @@ describe('Profile reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.get = sinon.stub().returns(Promise.resolve(resolvedObject)); }); diff --git a/generators/react/templates/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs index 4a14397d1eda..3e0081131d90 100644 --- a/generators/react/templates/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs @@ -205,7 +205,7 @@ describe('Authentication reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); <%_ if (enableTranslation) { _%> store = mockStore({ authentication: { account: { langKey: '<%= nativeLanguage %>' } }, locale: { loadedLocales: ['<%= nativeLanguage %>'] } }); <%_ } else { _%> @@ -305,7 +305,7 @@ describe('Authentication reducer tests', () => { describe('clearAuthToken', () => { let store; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({ authentication: { account: { langKey: 'en' } } }); }); it('clears the session token on clearAuthToken', async () => { diff --git a/generators/react/templates/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs index 4ac12673a27a..3fa68e8f6a95 100644 --- a/generators/react/templates/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs @@ -46,7 +46,7 @@ describe('Locale reducer tests', () => { describe('with default language loaded', () => { let store; beforeEach(() => { - store = configureStore([thunk])({ locale: { loadedLocales: [defaultLocale], loadedKeys: [] } }); + store = configureStore()({ locale: { loadedLocales: [defaultLocale], loadedKeys: [] } }); axios.get = sinon.stub().returns(Promise.resolve({ key: 'value' })); }); @@ -73,7 +73,7 @@ describe('Locale reducer tests', () => { describe('with no language loaded', () => { let store; beforeEach(() => { - store = configureStore([thunk])({ locale: { sourcePrefixes: [], loadedLocales: [], loadedKeys: [] } }); + store = configureStore()({ locale: { sourcePrefixes: [], loadedLocales: [], loadedKeys: [] } }); axios.get = sinon.stub().returns(Promise.resolve({ key: 'value' })); }); @@ -105,7 +105,7 @@ describe('Locale reducer tests', () => { describe('with no prefixes and keys loaded', () => { let store; beforeEach(() => { - store = configureStore([thunk])({ + store = configureStore()({ locale: { currentLocale: defaultLocale, sourcePrefixes: [], loadedLocales: [], loadedKeys: [] }, }); axios.get = sinon.stub().returns(Promise.resolve({ key: 'value' })); @@ -131,7 +131,7 @@ describe('Locale reducer tests', () => { describe('with prefix already added', () => { let store; beforeEach(() => { - store = configureStore([thunk])({ + store = configureStore()({ locale: { currentLocale: defaultLocale, sourcePrefixes: [sourcePrefix], loadedLocales: [], loadedKeys: [] }, }); axios.get = sinon.stub().returns(Promise.resolve({ key: 'value' })); @@ -156,7 +156,7 @@ describe('Locale reducer tests', () => { describe('with key already loaded', () => { let store; beforeEach(() => { - store = configureStore([thunk])({ + store = configureStore()({ locale: { currentLocale: defaultLocale, sourcePrefixes: [], loadedLocales: [], loadedKeys: [`${sourcePrefix}${defaultLocale}`] }, }); axios.get = sinon.stub().returns(Promise.resolve({ key: 'value' })); diff --git a/generators/react/templates/src/main/webapp/app/shared/reducers/user-management.spec.ts.ejs b/generators/react/templates/src/main/webapp/app/shared/reducers/user-management.spec.ts.ejs index a395e5af394a..cdbee4649547 100644 --- a/generators/react/templates/src/main/webapp/app/shared/reducers/user-management.spec.ts.ejs +++ b/generators/react/templates/src/main/webapp/app/shared/reducers/user-management.spec.ts.ejs @@ -68,7 +68,7 @@ describe('User management reducer tests', () => { const resolvedObject = { value: 'whatever' }; beforeEach(() => { - const mockStore = configureStore([thunk]); + const mockStore = configureStore(); store = mockStore({}); axios.get = sinon.stub().returns(Promise.resolve(resolvedObject)); });