From d13462f6c6674639c95b30eeaeb682a1d4c40c43 Mon Sep 17 00:00:00 2001 From: CD Cabrera Date: Fri, 26 Jan 2024 11:37:11 -0500 Subject: [PATCH] refactor(redux): rename user to appReducer (#1262) --- src/app.js | 2 +- .../__tests__/authenticationContext.test.js | 4 +- .../authentication/authenticationContext.js | 6 +- src/components/optinView/optinView.js | 2 +- src/redux/README.md | 63 +++++++++---------- .../actions/__tests__/platformActions.test.js | 6 +- .../actions/__tests__/userActions.test.js | 12 ++-- src/redux/actions/userActions.js | 10 +-- ...r.test.js.snap => appReducer.test.js.snap} | 0 ...userReducer.test.js => appReducer.test.js} | 20 +++--- .../{userReducer.js => appReducer.js} | 18 +++--- src/redux/reducers/index.js | 6 +- .../__snapshots__/index.test.js.snap | 40 +++++------- src/redux/types/index.js | 29 +++------ 14 files changed, 97 insertions(+), 121 deletions(-) rename src/redux/reducers/__tests__/__snapshots__/{userReducer.test.js.snap => appReducer.test.js.snap} (100%) rename src/redux/reducers/__tests__/{userReducer.test.js => appReducer.test.js} (85%) rename src/redux/reducers/{userReducer.js => appReducer.js} (72%) diff --git a/src/app.js b/src/app.js index bba3d9c95..593474eed 100644 --- a/src/app.js +++ b/src/app.js @@ -30,7 +30,7 @@ import { helpers } from './common'; */ const App = ({ getLocale, useDispatch: useAliasDispatch, useSelector: useAliasSelector }) => { const dispatch = useAliasDispatch(); - const { value: locale } = useAliasSelector(({ user }) => user?.locale?.data, {}); + const { value: locale } = useAliasSelector(({ app }) => app?.locale?.data, {}); let platformNotifications = null; useMount(() => { diff --git a/src/components/authentication/__tests__/authenticationContext.test.js b/src/components/authentication/__tests__/authenticationContext.test.js index 5730d1796..a940af7cc 100644 --- a/src/components/authentication/__tests__/authenticationContext.test.js +++ b/src/components/authentication/__tests__/authenticationContext.test.js @@ -54,7 +54,7 @@ describe('AuthenticationContext', () => { const { result: mockStoreSuccessResponse } = await renderHook(() => useGetAuthorization(), { state: { - user: { + app: { auth: { fulfilled: true, data: [ @@ -90,7 +90,7 @@ describe('AuthenticationContext', () => { const { result: mockStoreErrorResponse } = await renderHook(() => useGetAuthorization(), { state: { - user: { + app: { auth: { error: true, data: [] diff --git a/src/components/authentication/authenticationContext.js b/src/components/authentication/authenticationContext.js index 7361a4014..ceca78846 100644 --- a/src/components/authentication/authenticationContext.js +++ b/src/components/authentication/authenticationContext.js @@ -49,11 +49,11 @@ const useGetAuthorization = ({ const dispatch = useAliasDispatch(); const { updateDocumentTitle = helpers.noop } = useAliasChrome(); const { data, error, fulfilled, pending, responses } = useAliasSelectorsResponse([ - { id: 'auth', selector: ({ user }) => user?.auth }, - { id: 'locale', selector: ({ user }) => user?.locale }, + { id: 'auth', selector: ({ app }) => app?.auth }, + { id: 'locale', selector: ({ app }) => app?.locale }, { id: 'errors', - selector: ({ user }) => (user?.errors?.error === true && user.errors) || { fulfilled: true, data: [] } + selector: ({ app }) => (app?.errors?.error === true && app.errors) || { fulfilled: true, data: [] } } ]); diff --git a/src/components/optinView/optinView.js b/src/components/optinView/optinView.js index 9a9f43ebd..504afe605 100644 --- a/src/components/optinView/optinView.js +++ b/src/components/optinView/optinView.js @@ -51,7 +51,7 @@ const OptinView = ({ }) => { const dispatch = useAliasDispatch(); const { errorStatus } = useAliasSession(); - const { error, fulfilled, pending } = useAliasSelectorsResponse(({ user }) => user?.optin); + const { error, fulfilled, pending } = useAliasSelectorsResponse(({ app }) => app?.optin); /** * Submit and update account opt-in. diff --git a/src/redux/README.md b/src/redux/README.md index ef1d0b42c..7ee824760 100644 --- a/src/redux/README.md +++ b/src/redux/README.md @@ -21,6 +21,9 @@
StatusMiddleware
+
AppReducer
+

Application related state reducer.

+
GraphReducer

Graph/Chart related API and user state reducer.

@@ -33,9 +36,6 @@
ToolbarReducer

Toolbar related user state reducer.

-
UserReducer
-

User related API, platform and user state reducer.

-
ViewReducer

View query related user state reducer.

@@ -1018,6 +1018,31 @@ Apply a status type based on actions, such as those generated from redux-promise + + +## AppReducer +Application related state reducer. + + + +### AppReducer~appReducer(state, action) ⇒ object \| Object +Apply application observer/reducer logic to state, against actions. + +**Kind**: inner method of [AppReducer](#Reducers.module_AppReducer) + + + + + + + + + + + + +
ParamType
stateobject
actionobject
+ ## GraphReducer @@ -1121,31 +1146,6 @@ Apply user observer/reducer logic for toolbar to state, against actions. - - -## UserReducer -User related API, platform and user state reducer. - - - -### UserReducer~userReducer(state, action) ⇒ object \| Object -Apply user observer/reducer logic for session to state, against actions. - -**Kind**: inner method of [UserReducer](#Reducers.module_UserReducer) - - - - - - - - - - - - -
ParamType
stateobject
actionobject
- ## ViewReducer @@ -1195,7 +1195,6 @@ Create a Redux store. * [~queryTypes](#Types.module_ReduxTypes..queryTypes) : Object * [~rhsmTypes](#Types.module_ReduxTypes..rhsmTypes) : Object * [~toolbarTypes](#Types.module_ReduxTypes..toolbarTypes) : Object - * [~userTypes](#Types.module_ReduxTypes..userTypes) : Object @@ -1244,12 +1243,6 @@ RHSM API action, reducer types. ### ReduxTypes~toolbarTypes : Object Filter, toolbar action, reducer types. -**Kind**: inner constant of [ReduxTypes](#Types.module_ReduxTypes) - - -### ReduxTypes~userTypes : Object -User action, reducer types. - **Kind**: inner constant of [ReduxTypes](#Types.module_ReduxTypes) diff --git a/src/redux/actions/__tests__/platformActions.test.js b/src/redux/actions/__tests__/platformActions.test.js index 7d2f173e2..38b18d8d2 100644 --- a/src/redux/actions/__tests__/platformActions.test.js +++ b/src/redux/actions/__tests__/platformActions.test.js @@ -1,14 +1,14 @@ import promiseMiddleware from 'redux-promise-middleware'; import { applyMiddleware, combineReducers, createStore } from 'redux'; import { platformActions } from '../platformActions'; -import { userReducer } from '../../reducers'; +import { appReducer } from '../../reducers'; describe('PlatformActions', () => { const middleware = [promiseMiddleware]; const generateStore = () => createStore( combineReducers({ - user: userReducer + app: appReducer }), applyMiddleware(...middleware) ); @@ -18,7 +18,7 @@ describe('PlatformActions', () => { const dispatcher = platformActions.authorizeUser(); dispatcher(store.dispatch).then(() => { - const response = store.getState().user; + const response = store.getState().app; expect(response.auth.fulfilled).toBe(true); done(); diff --git a/src/redux/actions/__tests__/userActions.test.js b/src/redux/actions/__tests__/userActions.test.js index 137e4113b..c4ea01104 100644 --- a/src/redux/actions/__tests__/userActions.test.js +++ b/src/redux/actions/__tests__/userActions.test.js @@ -1,7 +1,7 @@ import promiseMiddleware from 'redux-promise-middleware'; import { applyMiddleware, combineReducers, createStore } from 'redux'; import moxios from 'moxios'; -import { userReducer } from '../../reducers'; +import { appReducer } from '../../reducers'; import { userActions } from '../userActions'; describe('UserActions', () => { @@ -9,7 +9,7 @@ describe('UserActions', () => { const generateStore = () => createStore( combineReducers({ - user: userReducer + app: appReducer }), applyMiddleware(...middleware) ); @@ -36,7 +36,7 @@ describe('UserActions', () => { const dispatcher = userActions.getLocale(); dispatcher(store.dispatch).then(() => { - const response = store.getState().user; + const response = store.getState().app; expect(response.locale.fulfilled).toBe(true); done(); @@ -48,7 +48,7 @@ describe('UserActions', () => { const dispatcher = userActions.deleteAccountOptIn(); dispatcher(store.dispatch).then(() => { - const response = store.getState().user; + const response = store.getState().app; expect(response.optin.fulfilled).toBe(true); done(); }); @@ -59,7 +59,7 @@ describe('UserActions', () => { const dispatcher = userActions.getAccountOptIn(); dispatcher(store.dispatch).then(() => { - const response = store.getState().user; + const response = store.getState().app; expect(response.optin.fulfilled).toBe(true); done(); }); @@ -70,7 +70,7 @@ describe('UserActions', () => { const dispatcher = userActions.updateAccountOptIn(); dispatcher(store.dispatch).then(() => { - const response = store.getState().user; + const response = store.getState().app; expect(response.optin.fulfilled).toBe(true); done(); }); diff --git a/src/redux/actions/userActions.js b/src/redux/actions/userActions.js index 99f8c6d5a..ac9b75da4 100644 --- a/src/redux/actions/userActions.js +++ b/src/redux/actions/userActions.js @@ -1,4 +1,4 @@ -import { userTypes } from '../types'; +import { appTypes } from '../types'; import { userServices } from '../../services/user/userServices'; import { helpers } from '../../common/helpers'; import { translate } from '../../components/i18n/i18n'; @@ -17,7 +17,7 @@ import { translate } from '../../components/i18n/i18n'; */ const getLocale = () => dispatch => dispatch({ - type: userTypes.USER_LOCALE, + type: appTypes.USER_LOCALE, payload: userServices.getLocale() }); @@ -28,7 +28,7 @@ const getLocale = () => dispatch => */ const deleteAccountOptIn = () => dispatch => dispatch({ - type: userTypes.DELETE_USER_OPTIN, + type: appTypes.DELETE_USER_OPTIN, payload: userServices.deleteAccountOptIn(), meta: { notifications: {} @@ -42,7 +42,7 @@ const deleteAccountOptIn = () => dispatch => */ const getAccountOptIn = () => dispatch => dispatch({ - type: userTypes.GET_USER_OPTIN, + type: appTypes.GET_USER_OPTIN, payload: userServices.getAccountOptIn(), meta: { notifications: {} @@ -59,7 +59,7 @@ const updateAccountOptIn = (query = {}) => dispatch => dispatch({ - type: userTypes.UPDATE_USER_OPTIN, + type: appTypes.UPDATE_USER_OPTIN, payload: userServices.updateAccountOptIn(query), meta: { query, diff --git a/src/redux/reducers/__tests__/__snapshots__/userReducer.test.js.snap b/src/redux/reducers/__tests__/__snapshots__/appReducer.test.js.snap similarity index 100% rename from src/redux/reducers/__tests__/__snapshots__/userReducer.test.js.snap rename to src/redux/reducers/__tests__/__snapshots__/appReducer.test.js.snap diff --git a/src/redux/reducers/__tests__/userReducer.test.js b/src/redux/reducers/__tests__/appReducer.test.js similarity index 85% rename from src/redux/reducers/__tests__/userReducer.test.js rename to src/redux/reducers/__tests__/appReducer.test.js index acf2380eb..6b82567df 100644 --- a/src/redux/reducers/__tests__/userReducer.test.js +++ b/src/redux/reducers/__tests__/appReducer.test.js @@ -1,19 +1,19 @@ -import userReducer from '../userReducer'; +import appReducer from '../appReducer'; import { rhsmConstants } from '../../../services/rhsm/rhsmConstants'; import { platformConstants } from '../../../services/platform/platformConstants'; -import { appTypes, platformTypes, userTypes as types } from '../../types'; +import { appTypes as types, platformTypes } from '../../types'; import { reduxHelpers } from '../../common'; describe('UserReducer', () => { it('should return the initial state', () => { - expect(userReducer.initialState).toBeDefined(); + expect(appReducer.initialState).toBeDefined(); }); it('should handle specific http status types', () => { const specificTypes = [ - { type: appTypes.STATUS_4XX, status: 400 }, - { type: appTypes.STATUS_4XX, status: 401 }, - { type: appTypes.STATUS_4XX, status: 403 } + { type: types.STATUS_4XX, status: 400 }, + { type: types.STATUS_4XX, status: 401 }, + { type: types.STATUS_4XX, status: 403 } ]; specificTypes.forEach(value => { @@ -37,7 +37,7 @@ describe('UserReducer', () => { } }; - const resultState = userReducer(undefined, dispatched); + const resultState = appReducer(undefined, dispatched); expect({ type: value.type, result: resultState }).toMatchSnapshot(`http status ${value.type} ${value.status}`); }); @@ -68,7 +68,7 @@ describe('UserReducer', () => { } }; - const resultState = userReducer(undefined, dispatched); + const resultState = appReducer(undefined, dispatched); expect({ type: reduxHelpers.REJECTED_ACTION(value), result: resultState }).toMatchSnapshot( `rejected types ${value}` @@ -90,7 +90,7 @@ describe('UserReducer', () => { type: reduxHelpers.PENDING_ACTION(value) }; - const resultState = userReducer(undefined, dispatched); + const resultState = appReducer(undefined, dispatched); expect({ type: reduxHelpers.PENDING_ACTION(value), result: resultState }).toMatchSnapshot( `pending types ${value}` @@ -125,7 +125,7 @@ describe('UserReducer', () => { } }; - const resultState = userReducer(undefined, dispatched); + const resultState = appReducer(undefined, dispatched); expect({ type: reduxHelpers.FULFILLED_ACTION(value), result: resultState }).toMatchSnapshot( `fulfilled types ${value}` diff --git a/src/redux/reducers/userReducer.js b/src/redux/reducers/appReducer.js similarity index 72% rename from src/redux/reducers/userReducer.js rename to src/redux/reducers/appReducer.js index fe1942f53..16e17de82 100644 --- a/src/redux/reducers/userReducer.js +++ b/src/redux/reducers/appReducer.js @@ -1,13 +1,13 @@ import _get from 'lodash/get'; -import { appTypes, platformTypes, userTypes } from '../types'; +import { appTypes, platformTypes } from '../types'; import { rhsmConstants } from '../../services/rhsm/rhsmConstants'; import { reduxHelpers } from '../common'; /** - * User related API, platform and user state reducer. + * Application related state reducer. * * @memberof Reducers - * @module UserReducer + * @module AppReducer */ /** @@ -24,13 +24,13 @@ const initialState = { }; /** - * Apply user observer/reducer logic for session to state, against actions. + * Apply application observer/reducer logic to state, against actions. * * @param {object} state * @param {object} action * @returns {object|{}} */ -const userReducer = (state = initialState, action) => { +const appReducer = (state = initialState, action) => { switch (action.type) { case reduxHelpers.HTTP_STATUS_RANGE(appTypes.STATUS_4XX): const actionStatus = reduxHelpers.getStatusFromResults(action); @@ -58,8 +58,8 @@ const userReducer = (state = initialState, action) => { default: return reduxHelpers.generatedPromiseActionReducer( [ - { ref: 'locale', type: userTypes.USER_LOCALE }, - { ref: 'optin', type: [userTypes.DELETE_USER_OPTIN, userTypes.GET_USER_OPTIN, userTypes.UPDATE_USER_OPTIN] }, + { ref: 'locale', type: appTypes.USER_LOCALE }, + { ref: 'optin', type: [appTypes.DELETE_USER_OPTIN, appTypes.GET_USER_OPTIN, appTypes.UPDATE_USER_OPTIN] }, { ref: 'auth', type: platformTypes.PLATFORM_USER_AUTH } ], state, @@ -68,6 +68,6 @@ const userReducer = (state = initialState, action) => { } }; -userReducer.initialState = initialState; +appReducer.initialState = initialState; -export { userReducer as default, initialState, userReducer }; +export { appReducer as default, initialState, appReducer }; diff --git a/src/redux/reducers/index.js b/src/redux/reducers/index.js index 2ddd3a132..acce90e9e 100644 --- a/src/redux/reducers/index.js +++ b/src/redux/reducers/index.js @@ -1,19 +1,19 @@ import { combineReducers } from 'redux'; import { notifications } from '@redhat-cloud-services/frontend-components-notifications'; +import appReducer from './appReducer'; import graphReducer from './graphReducer'; import inventoryReducer from './inventoryReducer'; import messagesReducer from './messagesReducer'; import toolbarReducer from './toolbarReducer'; -import userReducer from './userReducer'; import viewReducer from './viewReducer'; const reducers = { + app: appReducer, notifications, graph: graphReducer, inventory: inventoryReducer, messages: messagesReducer, toolbar: toolbarReducer, - user: userReducer, view: viewReducer }; @@ -22,10 +22,10 @@ const reduxReducers = combineReducers(reducers); export { reduxReducers as default, reduxReducers, + appReducer, graphReducer, inventoryReducer, messagesReducer, toolbarReducer, - userReducer, viewReducer }; diff --git a/src/redux/types/__tests__/__snapshots__/index.test.js.snap b/src/redux/types/__tests__/__snapshots__/index.test.js.snap index 7694b16e4..ed3ff4228 100644 --- a/src/redux/types/__tests__/__snapshots__/index.test.js.snap +++ b/src/redux/types/__tests__/__snapshots__/index.test.js.snap @@ -3,19 +3,27 @@ exports[`ReduxTypes should have specific type properties: all redux types 1`] = ` { "appTypes": { + "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", + "GET_USER_OPTIN": "GET_USER_OPTIN", "SET_PRODUCT": "SET_PRODUCT", "SET_PRODUCT_VARIANT": "SET_PRODUCT_VARIANT", "SET_PRODUCT_VARIANT_QUERY_RESET_ALL": "SET_PRODUCT_VARIANT_QUERY_RESET_ALL", "STATUS_4XX": "4XX", "STATUS_5XX": "5XX", + "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", + "USER_LOCALE": "USER_LOCALE", }, "default": { "app": { + "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", + "GET_USER_OPTIN": "GET_USER_OPTIN", "SET_PRODUCT": "SET_PRODUCT", "SET_PRODUCT_VARIANT": "SET_PRODUCT_VARIANT", "SET_PRODUCT_VARIANT_QUERY_RESET_ALL": "SET_PRODUCT_VARIANT_QUERY_RESET_ALL", "STATUS_4XX": "4XX", "STATUS_5XX": "5XX", + "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", + "USER_LOCALE": "USER_LOCALE", }, "graph": { "SET_GRAPH_LEGEND": "SET_GRAPH_LEGEND", @@ -56,12 +64,6 @@ exports[`ReduxTypes should have specific type properties: all redux types 1`] = "SET_ACTIVE_FILTERS": "SET_ACTIVE_FILTERS", "SET_FILTER_TYPE": "SET_FILTER_TYPE", }, - "user": { - "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", - "GET_USER_OPTIN": "GET_USER_OPTIN", - "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", - "USER_LOCALE": "USER_LOCALE", - }, }, "graphTypes": { "SET_GRAPH_LEGEND": "SET_GRAPH_LEGEND", @@ -93,11 +95,15 @@ exports[`ReduxTypes should have specific type properties: all redux types 1`] = }, "reduxTypes": { "app": { + "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", + "GET_USER_OPTIN": "GET_USER_OPTIN", "SET_PRODUCT": "SET_PRODUCT", "SET_PRODUCT_VARIANT": "SET_PRODUCT_VARIANT", "SET_PRODUCT_VARIANT_QUERY_RESET_ALL": "SET_PRODUCT_VARIANT_QUERY_RESET_ALL", "STATUS_4XX": "4XX", "STATUS_5XX": "5XX", + "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", + "USER_LOCALE": "USER_LOCALE", }, "graph": { "SET_GRAPH_LEGEND": "SET_GRAPH_LEGEND", @@ -138,12 +144,6 @@ exports[`ReduxTypes should have specific type properties: all redux types 1`] = "SET_ACTIVE_FILTERS": "SET_ACTIVE_FILTERS", "SET_FILTER_TYPE": "SET_FILTER_TYPE", }, - "user": { - "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", - "GET_USER_OPTIN": "GET_USER_OPTIN", - "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", - "USER_LOCALE": "USER_LOCALE", - }, }, "rhsmTypes": { "GET_GRAPH_CAPACITY_RHSM": "GET_GRAPH_CAPACITY_RHSM", @@ -156,23 +156,21 @@ exports[`ReduxTypes should have specific type properties: all redux types 1`] = "SET_ACTIVE_FILTERS": "SET_ACTIVE_FILTERS", "SET_FILTER_TYPE": "SET_FILTER_TYPE", }, - "userTypes": { - "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", - "GET_USER_OPTIN": "GET_USER_OPTIN", - "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", - "USER_LOCALE": "USER_LOCALE", - }, } `; exports[`ReduxTypes should have specific type properties: specific types 1`] = ` { "app": { + "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", + "GET_USER_OPTIN": "GET_USER_OPTIN", "SET_PRODUCT": "SET_PRODUCT", "SET_PRODUCT_VARIANT": "SET_PRODUCT_VARIANT", "SET_PRODUCT_VARIANT_QUERY_RESET_ALL": "SET_PRODUCT_VARIANT_QUERY_RESET_ALL", "STATUS_4XX": "4XX", "STATUS_5XX": "5XX", + "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", + "USER_LOCALE": "USER_LOCALE", }, "graph": { "SET_GRAPH_LEGEND": "SET_GRAPH_LEGEND", @@ -213,11 +211,5 @@ exports[`ReduxTypes should have specific type properties: specific types 1`] = ` "SET_ACTIVE_FILTERS": "SET_ACTIVE_FILTERS", "SET_FILTER_TYPE": "SET_FILTER_TYPE", }, - "user": { - "DELETE_USER_OPTIN": "DELETE_USER_OPTIN", - "GET_USER_OPTIN": "GET_USER_OPTIN", - "UPDATE_USER_OPTIN": "UPDATE_USER_OPTIN", - "USER_LOCALE": "USER_LOCALE", - }, } `; diff --git a/src/redux/types/index.js b/src/redux/types/index.js index 8ceadc888..dd8588695 100644 --- a/src/redux/types/index.js +++ b/src/redux/types/index.js @@ -12,15 +12,20 @@ import { /** * Application action, reducer types. * - * @type {{STATUS_4XX: string, SET_PRODUCT_VARIANT: string, SET_PRODUCT_VARIANT_QUERY_RESET_ALL: string, - * SET_PRODUCT: string, STATUS_5XX: string}} + * @type {{STATUS_4XX: string, USER_LOCALE: string, SET_PRODUCT_VARIANT: string, GET_USER_OPTIN: string, + * SET_PRODUCT_VARIANT_QUERY_RESET_ALL: string, UPDATE_USER_OPTIN: string, SET_PRODUCT: string, + * STATUS_5XX: string, DELETE_USER_OPTIN: string}} */ const appTypes = { STATUS_4XX: '4XX', STATUS_5XX: '5XX', SET_PRODUCT: 'SET_PRODUCT', SET_PRODUCT_VARIANT: 'SET_PRODUCT_VARIANT', - SET_PRODUCT_VARIANT_QUERY_RESET_ALL: 'SET_PRODUCT_VARIANT_QUERY_RESET_ALL' + SET_PRODUCT_VARIANT_QUERY_RESET_ALL: 'SET_PRODUCT_VARIANT_QUERY_RESET_ALL', + DELETE_USER_OPTIN: 'DELETE_USER_OPTIN', + GET_USER_OPTIN: 'GET_USER_OPTIN', + UPDATE_USER_OPTIN: 'UPDATE_USER_OPTIN', + USER_LOCALE: 'USER_LOCALE' }; /** @@ -109,18 +114,6 @@ const toolbarTypes = { SET_FILTER_TYPE: 'SET_FILTER_TYPE' }; -/** - * User action, reducer types. - * - * @type {{USER_LOCALE: string, GET_USER_OPTIN: string, UPDATE_USER_OPTIN: string, DELETE_USER_OPTIN: string}} - */ -const userTypes = { - DELETE_USER_OPTIN: 'DELETE_USER_OPTIN', - GET_USER_OPTIN: 'GET_USER_OPTIN', - UPDATE_USER_OPTIN: 'UPDATE_USER_OPTIN', - USER_LOCALE: 'USER_LOCALE' -}; - const reduxTypes = { app: appTypes, graph: graphTypes, @@ -129,8 +122,7 @@ const reduxTypes = { platform: platformTypes, query: queryTypes, rhsm: rhsmTypes, - toolbar: toolbarTypes, - user: userTypes + toolbar: toolbarTypes }; export { @@ -143,6 +135,5 @@ export { platformTypes, queryTypes, rhsmTypes, - toolbarTypes, - userTypes + toolbarTypes };