diff --git a/server/zanata-frontend/src/frontend/app/editor/actions/action-types.js b/server/zanata-frontend/src/frontend/app/editor/actions/action-types.js index 6005248f95..7a75815021 100644 --- a/server/zanata-frontend/src/frontend/app/editor/actions/action-types.js +++ b/server/zanata-frontend/src/frontend/app/editor/actions/action-types.js @@ -1,5 +1,5 @@ export const ROUTING_PARAMS_CHANGED = 'ROUTING_PARAMS_CHANGED' export const SET_SIDEBAR_VISIBILITY = 'SET_SIDEBAR_VISIBILITY' export const TOGGLE_DROPDOWN = 'TOGGLE_DROPDOWN' -export const OPEN_DROPDOWN = Symbol('OPEN_DROPDOWN') -export const CLOSE_DROPDOWN = Symbol('CLOSE_DROPDOWN') +export const OPEN_DROPDOWN = 'OPEN_DROPDOWN' +export const CLOSE_DROPDOWN = 'CLOSE_DROPDOWN' diff --git a/server/zanata-frontend/src/frontend/app/editor/actions/index.js b/server/zanata-frontend/src/frontend/app/editor/actions/index.js index 67664492de..f4d235754e 100644 --- a/server/zanata-frontend/src/frontend/app/editor/actions/index.js +++ b/server/zanata-frontend/src/frontend/app/editor/actions/index.js @@ -14,14 +14,8 @@ export const routingParamsChanged = createAction(ROUTING_PARAMS_CHANGED) * Every dropdown should have a reference-unique key. */ export const toggleDropdown = createAction(TOGGLE_DROPDOWN) - -export function openDropdown (dropdownKey) { - return { type: OPEN_DROPDOWN, key: dropdownKey } -} - -export function closeDropdown () { - return { type: CLOSE_DROPDOWN } -} +export const openDropdown = createAction(OPEN_DROPDOWN) +export const closeDropdown = createAction(CLOSE_DROPDOWN) /** * Fetch the list of documents for the current project-version diff --git a/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.js b/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.js index cde0ee5b9a..47c13f42cd 100644 --- a/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.js +++ b/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.js @@ -18,7 +18,7 @@ const dropdownReducer = (state = defaultState, action) => { switch (action.type) { case OPEN_DROPDOWN: return update({ - openDropdownKey: {$set: action.key} + openDropdownKey: {$set: action.payload} }) case CLOSE_DROPDOWN: diff --git a/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.test.js b/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.test.js index cce807fb67..b7bcc39a40 100644 --- a/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.test.js +++ b/server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.test.js @@ -26,7 +26,7 @@ describe('dropdown-reducer test', () => { const initial = dropdownReducer(undefined, { type: 'any' }) const localeOpen = dropdownReducer(initial, { type: OPEN_DROPDOWN, - key: initial.localeKey + payload: initial.localeKey }) expect(localeOpen).toEqual(expect.objectContaining({ openDropdownKey: initial.localeKey @@ -34,7 +34,7 @@ describe('dropdown-reducer test', () => { expect(dropdownReducer(localeOpen, { type: OPEN_DROPDOWN, - key: initial.docsKey + payload: initial.docsKey })).toEqual(expect.objectContaining({ openDropdownKey: initial.docsKey })) @@ -44,7 +44,7 @@ describe('dropdown-reducer test', () => { const initial = dropdownReducer(undefined, { type: 'any' }) const localeOpen = dropdownReducer(initial, { type: OPEN_DROPDOWN, - key: initial.localeKey + payload: initial.localeKey }) expect(dropdownReducer(localeOpen, { type: CLOSE_DROPDOWN