From eff2166262bdc6c49b25bf6817912264c78bf957 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Fri, 10 Feb 2023 17:34:17 +0530 Subject: [PATCH] chore: rename redux actions (#49320) --- client/gatsby-browser.js | 2 +- client/gatsby-ssr.js | 2 +- client/src/components/Intro/intro.test.tsx | 2 +- client/src/components/app-mount-notifier.test.tsx | 2 +- .../components/profile/components/time-line.test.tsx | 2 +- .../profile/components/timeline-buttons.test.js | 2 +- client/src/components/settings/certification.test.tsx | 2 +- client/src/redux/{cookieValues.js => cookie-values.js} | 0 client/src/redux/{createStore.js => create-store.js} | 10 +++++----- client/src/redux/fetch-user-saga.js | 2 +- client/src/redux/{rootEpic.js => root-epic.js} | 2 +- client/src/redux/{rootReducer.js => root-reducer.js} | 2 +- client/src/redux/{rootSaga.js => root-saga.js} | 2 +- client/utils/gatsby/layout-selector.test.tsx | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) rename client/src/redux/{cookieValues.js => cookie-values.js} (100%) rename client/src/redux/{createStore.js => create-store.js} (86%) rename client/src/redux/{rootEpic.js => root-epic.js} (84%) rename client/src/redux/{rootReducer.js => root-reducer.js} (95%) rename client/src/redux/{rootSaga.js => root-saga.js} (89%) diff --git a/client/gatsby-browser.js b/client/gatsby-browser.js index 513cc8d8a55..f93c9c10a26 100644 --- a/client/gatsby-browser.js +++ b/client/gatsby-browser.js @@ -6,7 +6,7 @@ import { Provider } from 'react-redux'; import i18n from './i18n/config'; import AppMountNotifier from './src/components/app-mount-notifier'; -import { createStore } from './src/redux/createStore'; +import { createStore } from './src/redux/create-store'; import layoutSelector from './utils/gatsby/layout-selector'; import GrowthBookProvider from './src/components/growth-book/growth-book-wrapper'; diff --git a/client/gatsby-ssr.js b/client/gatsby-ssr.js index e7995a365d0..c0f6e4237c6 100644 --- a/client/gatsby-ssr.js +++ b/client/gatsby-ssr.js @@ -4,7 +4,7 @@ import { I18nextProvider } from 'react-i18next'; import { Provider } from 'react-redux'; import i18n from './i18n/config'; -import { createStore } from './src/redux/createStore'; +import { createStore } from './src/redux/create-store'; import layoutSelector from './utils/gatsby/layout-selector'; import { getheadTagComponents, getPostBodyComponents } from './utils/tags'; import GrowthBookProvider from './src/components/growth-book/growth-book-wrapper'; diff --git a/client/src/components/Intro/intro.test.tsx b/client/src/components/Intro/intro.test.tsx index d1000de9fa0..61a55fe76f0 100644 --- a/client/src/components/Intro/intro.test.tsx +++ b/client/src/components/Intro/intro.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; -import { createStore } from '../../redux/createStore'; +import { createStore } from '../../redux/create-store'; import Intro from '.'; diff --git a/client/src/components/app-mount-notifier.test.tsx b/client/src/components/app-mount-notifier.test.tsx index 94121daba6c..215d99c94c0 100644 --- a/client/src/components/app-mount-notifier.test.tsx +++ b/client/src/components/app-mount-notifier.test.tsx @@ -5,7 +5,7 @@ import { Provider } from 'react-redux'; import { i18nextCodes } from '../../../config/i18n'; import i18nTestConfig from '../../i18n/config-for-tests'; -import { createStore } from '../redux/createStore'; +import { createStore } from '../redux/create-store'; import AppMountNotifier from './app-mount-notifier'; jest.unmock('react-i18next'); diff --git a/client/src/components/profile/components/time-line.test.tsx b/client/src/components/profile/components/time-line.test.tsx index 5d0dd9a1da1..2fb3e4c8669 100644 --- a/client/src/components/profile/components/time-line.test.tsx +++ b/client/src/components/profile/components/time-line.test.tsx @@ -4,7 +4,7 @@ import { useStaticQuery } from 'gatsby'; import React from 'react'; import { render, screen } from '../../../../utils/test-utils'; -import { createStore } from '../../../redux/createStore'; +import { createStore } from '../../../redux/create-store'; import TimeLine from './time-line'; const store = createStore(); diff --git a/client/src/components/profile/components/timeline-buttons.test.js b/client/src/components/profile/components/timeline-buttons.test.js index 33337e2aa7b..6a4b619bb1b 100644 --- a/client/src/components/profile/components/timeline-buttons.test.js +++ b/client/src/components/profile/components/timeline-buttons.test.js @@ -3,7 +3,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; import { Provider } from 'react-redux'; -import { createStore } from '../../../redux/createStore'; +import { createStore } from '../../../redux/create-store'; import completedChallenges from '../../../__mocks__/completed-challenges.json'; import Timeline from './time-line'; diff --git a/client/src/components/settings/certification.test.tsx b/client/src/components/settings/certification.test.tsx index 195b64dd920..2c6e033ace1 100644 --- a/client/src/components/settings/certification.test.tsx +++ b/client/src/components/settings/certification.test.tsx @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; -import { createStore } from '../../redux/createStore'; +import { createStore } from '../../redux/create-store'; import { CertificationSettings } from './certification'; diff --git a/client/src/redux/cookieValues.js b/client/src/redux/cookie-values.js similarity index 100% rename from client/src/redux/cookieValues.js rename to client/src/redux/cookie-values.js diff --git a/client/src/redux/createStore.js b/client/src/redux/create-store.js similarity index 86% rename from client/src/redux/createStore.js rename to client/src/redux/create-store.js index 75e19ea5017..93918f35dea 100644 --- a/client/src/redux/createStore.js +++ b/client/src/redux/create-store.js @@ -5,9 +5,9 @@ import createSagaMiddleware from 'redux-saga'; import envData from '../../../config/env.json'; import { isBrowser } from '../../utils'; -import rootEpic from './rootEpic'; -import rootReducer from './rootReducer'; -import rootSaga from './rootSaga'; +import rootEpic from './root-epic'; +import rootReducer from './root-reducer'; +import rootSaga from './root-saga'; const { environment } = envData; @@ -47,8 +47,8 @@ export const createStore = () => { epicMiddleware.run(rootEpic); if (module.hot) { // Enable Webpack hot module replacement for reducers - module.hot.accept('./rootReducer', () => { - const nextRootReducer = require('./rootReducer'); + module.hot.accept('./root-reducer', () => { + const nextRootReducer = require('./root-reducer'); store.replaceReducer(nextRootReducer); }); } diff --git a/client/src/redux/fetch-user-saga.js b/client/src/redux/fetch-user-saga.js index 20b4d65ddae..826cccc0697 100644 --- a/client/src/redux/fetch-user-saga.js +++ b/client/src/redux/fetch-user-saga.js @@ -7,7 +7,7 @@ import { fetchUserComplete, fetchUserError } from './actions'; -import { jwt } from './cookieValues'; +import { jwt } from './cookie-values'; function* fetchSessionUser() { if (!jwt) { diff --git a/client/src/redux/rootEpic.js b/client/src/redux/root-epic.js similarity index 84% rename from client/src/redux/rootEpic.js rename to client/src/redux/root-epic.js index dd956348596..81a0a6d7712 100644 --- a/client/src/redux/rootEpic.js +++ b/client/src/redux/root-epic.js @@ -1,7 +1,7 @@ import { combineEpics } from 'redux-observable'; import { epics as challengeEpics } from '../templates/Challenges/redux'; -import { epics as appEpics } from './'; +import { epics as appEpics } from '.'; const rootEpic = combineEpics(...appEpics, ...challengeEpics); diff --git a/client/src/redux/rootReducer.js b/client/src/redux/root-reducer.js similarity index 95% rename from client/src/redux/rootReducer.js rename to client/src/redux/root-reducer.js index 6c20a0672dd..056083926f1 100644 --- a/client/src/redux/rootReducer.js +++ b/client/src/redux/root-reducer.js @@ -16,7 +16,7 @@ import { import { ns as appNameSpace } from './action-types'; import { ns as settingsNameSpace, reducer as settings } from './settings'; import { FlashApp as flashNameSpace } from './types'; -import { reducer as app } from './'; +import { reducer as app } from '.'; export default combineReducers({ [appNameSpace]: app, diff --git a/client/src/redux/rootSaga.js b/client/src/redux/root-saga.js similarity index 89% rename from client/src/redux/rootSaga.js rename to client/src/redux/root-saga.js index ec83d4a5b6e..f2d293bebd3 100644 --- a/client/src/redux/rootSaga.js +++ b/client/src/redux/root-saga.js @@ -3,7 +3,7 @@ import { all } from 'redux-saga/effects'; import { sagas as challengeSagas } from '../templates/Challenges/redux'; import errorSagas from './error-saga'; import { sagas as settingsSagas } from './settings'; -import { sagas as appSagas } from './'; +import { sagas as appSagas } from '.'; export default function* rootSaga() { yield all([...errorSagas, ...appSagas, ...challengeSagas, ...settingsSagas]); diff --git a/client/utils/gatsby/layout-selector.test.tsx b/client/utils/gatsby/layout-selector.test.tsx index ac769f44d1a..f56a25a68fb 100644 --- a/client/utils/gatsby/layout-selector.test.tsx +++ b/client/utils/gatsby/layout-selector.test.tsx @@ -6,7 +6,7 @@ import ShallowRenderer from 'react-test-renderer/shallow'; import FourOhFourPage from '../../src/pages/404'; import Certification from '../../src/pages/certification'; import Learn from '../../src/pages/learn'; -import { createStore } from '../../src/redux/createStore'; +import { createStore } from '../../src/redux/create-store'; import layoutSelector from './layout-selector'; jest.mock('../../src/analytics');