diff --git a/server/zanata-frontend/src/frontend/app/editor/actions/header-action-types.js b/server/zanata-frontend/src/frontend/app/editor/actions/header-action-types.js index d4ba7262e3..aaad48dddb 100644 --- a/server/zanata-frontend/src/frontend/app/editor/actions/header-action-types.js +++ b/server/zanata-frontend/src/frontend/app/editor/actions/header-action-types.js @@ -1,7 +1,7 @@ export const TOGGLE_GLOSSARY = 'TOGGLE_GLOSSARY' export const TOGGLE_HEADER = 'TOGGLE_HEADER' export const TOGGLE_KEY_SHORTCUTS = 'TOGGLE_KEY_SHORTCUTS' -export const UI_LOCALES_FETCHED = Symbol('UI_LOCALES_FETCHED') +export const UI_LOCALES_FETCHED = 'UI_LOCALES_FETCHED' export const CHANGE_UI_LOCALE = Symbol('CHANGE_UI_LOCALE') export const DOCUMENT_SELECTED = Symbol('DOCUMENT_SELECTED') export const LOCALE_SELECTED = Symbol('LOCALE_SELECTED') diff --git a/server/zanata-frontend/src/frontend/app/editor/actions/header-actions.js b/server/zanata-frontend/src/frontend/app/editor/actions/header-actions.js index 65255e62a1..780943eaa5 100644 --- a/server/zanata-frontend/src/frontend/app/editor/actions/header-actions.js +++ b/server/zanata-frontend/src/frontend/app/editor/actions/header-actions.js @@ -33,12 +33,8 @@ const unwrapResponse = (dispatch, errorMsg, response) => { return response.json() } -export function uiLocaleFetched (uiLocales) { - return { - type: UI_LOCALES_FETCHED, - data: uiLocales - } -} +export const uiLocaleFetched = createAction(UI_LOCALES_FETCHED) + export function fetchUiLocales () { return (dispatch) => { fetchLocales() diff --git a/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.js b/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.js index 157ae6f416..b0debd4371 100644 --- a/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.js +++ b/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.js @@ -92,7 +92,7 @@ const ui = (state = defaultState, action) => { }) case UI_LOCALES_FETCHED: - const locales = prepareLocales(action.data) + const locales = prepareLocales(action.payload) return update({ uiLocales: { $set: locales diff --git a/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.test.js b/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.test.js index a57d6b147d..ab23efecaf 100644 --- a/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.test.js +++ b/server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.test.js @@ -102,7 +102,7 @@ describe('ui-reducer test', () => { it('can record fetched UI locales', () => { const withUiLocales = uiReducer(undefined, { type: UI_LOCALES_FETCHED, - data: [ + payload: [ { localeId: 'en-US', displayName: 'English (United States)'