[zanata/zanata-platform] a1c0e8: refactor(editor): use FSAs and handleActions (#545...
GitHub
noreply at github.com
Mon Oct 16 05:29:05 UTC 2017
Branch: refs/heads/master
Home: https://github.com/zanata/zanata-platform
Commit: a1c0e844d8089e74d45fe2c619ed9cd50ba9536e
https://github.com/zanata/zanata-platform/commit/a1c0e844d8089e74d45fe2c619ed9cd50ba9536e
Author: David Mason <drdmason at gmail.com>
Date: 2017-10-16 (Mon, 16 Oct 2017)
Changed paths:
M server/zanata-frontend/src/frontend/app/editor/actions/action-types.js
M server/zanata-frontend/src/frontend/app/editor/actions/controls-header-actions.js
M server/zanata-frontend/src/frontend/app/editor/actions/glossary-action-types.js
M server/zanata-frontend/src/frontend/app/editor/actions/glossary-actions.js
M server/zanata-frontend/src/frontend/app/editor/actions/header-action-types.js
M server/zanata-frontend/src/frontend/app/editor/actions/header-actions.js
M server/zanata-frontend/src/frontend/app/editor/actions/index.js
M server/zanata-frontend/src/frontend/app/editor/actions/key-shortcuts-actions.js
M server/zanata-frontend/src/frontend/app/editor/actions/phrase-navigation-actions.js
M server/zanata-frontend/src/frontend/app/editor/actions/phrases-action-types.js
M server/zanata-frontend/src/frontend/app/editor/actions/phrases-actions.js
M server/zanata-frontend/src/frontend/app/editor/actions/suggestions-action-types.js
M server/zanata-frontend/src/frontend/app/editor/actions/suggestions-actions.js
M server/zanata-frontend/src/frontend/app/editor/middlewares/new-context-fetch.js
M server/zanata-frontend/src/frontend/app/editor/reducers/context-reducer.js
M server/zanata-frontend/src/frontend/app/editor/reducers/context-reducer.test.js
M server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.js
M server/zanata-frontend/src/frontend/app/editor/reducers/dropdown-reducer.test.js
M server/zanata-frontend/src/frontend/app/editor/reducers/glossary-reducer.js
M server/zanata-frontend/src/frontend/app/editor/reducers/glossary-reducer.test.js
M server/zanata-frontend/src/frontend/app/editor/reducers/header-data-reducer.js
M server/zanata-frontend/src/frontend/app/editor/reducers/header-data-reducer.test.js
M server/zanata-frontend/src/frontend/app/editor/reducers/phrase-reducer/index.js
M server/zanata-frontend/src/frontend/app/editor/reducers/phrase-reducer/phrase-reducer.test.js
M server/zanata-frontend/src/frontend/app/editor/reducers/suggestions-reducer.js
M server/zanata-frontend/src/frontend/app/editor/reducers/suggestions-reducer.test.js
M server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.js
M server/zanata-frontend/src/frontend/app/editor/reducers/ui-reducer.test.js
Log Message:
-----------
refactor(editor): use FSAs and handleActions (#545)
* refactor(actions): make ROUTING_PARAMS_CHANGED a FSA
* refactor(actions): make SET_SIDEBAR_VISIBLITY a FSA
Resolved conflicts during rebase in editor/reducers/ui-reducer and
editor/actions/index.js since some actions were changed for the settings
component, and this branch updates some actions.
* refactor(actions): make TOGGLE_DROPDOWN a FSA
* refactor(actions): make OPEN_DROPDOWN and CLOSE_DROPDOWN FSAs
* refactor(actions): make CLAMP_PAGE an FSA
* refactor(actions): make UPDATE_PAGE an FSA
* refactor(actions): make GLOSSARY_SEARCH_TEXT_CHANGE an FSA
* refactor(actions): make COPY_GLOSSARY_TERM an FSA
* refactor(actions): use string for GLOSSARY_TERMS_REQUEST
* refactor(actions): use string for GLOSSARY_TERMS_SUCCESS
* refactor(actions): use string for GLOSSARY_TERMS_FAILURE
* refactor(actions): simplify payload of SET_GLOSSARY_DETAILS_INDEX
* refactor(actions): simplify payload of SHOW_GLOSSARY_DETAILS
* refactor(actions): use string for GLOSSARY_DETAILS_REQUEST
* refactor(actions): use string for GLOSSARY_DETAILS_SUCCESS
* refactor(actions): use string for GLOSSARY_DETAILS_FAILURE
* refactor(actions): reduce code for TOGGLE_HEADER
* refactor(actions): reduce code for TOGGLE_KEY_SHORTCUTS
* refactor(actions): remove unused action FETCH_FAILED
The action was not handled by any reducer. It was only used in places where
we should be using api middleware and handling errors in the standard way,
so I have just put some comments in the code and will handle that soon when
updating all the code to use api middleware.
* refactor(actions): make UI_LOCALES_FETCHED an FSA
* refactor(actions): make CHANGE_UI_LOCALE an FSA
* refactor(actions): make DOCUMENT_SELECTED an FSA
* refactor(actions): make LOCALE_SELECTED an FSA
* refactor(actions): make STATS_FETCHED an FSA
* refactor(actions): make HEADER_DATA_FETCHED an FSA
* refactor(actions): remove unused action type
* refactor(editor): remove unused document list fetch
The document list is fetched in the composite "header data" promise.
Not sure why there was duplicate code for it.
* refactor(actions): make SET_SAVE_AS_MODE an FSA
* refactor(actions): use string action type for MOVE_NEXT and MOVE_PREVIOUS
* refactor(actions): remove unused action creators
These actions are created exclusively by redux API middleware now.
* refactor(actions): make COPY_FROM_SOURCE an FSA
* refactor(actions): use string action type for COPY_FROM_ALIGNED_SOURCE
* refactor(actions): use string action type for CANCEL_EDIT
* refactor(actions): use string action type for UNDO_EDIT
* refactor(actions): make SELECT_PHRASE an FSA
* refactor(actions): make SELECT_PHRASE_SPECIFIC_PLURAL an FSA
* refactor(actions): use string action type for PHRASE_TEXT_SELECTION_RANGE
* refactor(actions): make TRANSLATION_TEXT_INPUT_CHANGED an FSA
* refactor(actions): remove unused action type
* refactor(actions): make QUEUE_SAVE an FSA
* refactor(actions): make SAVE_INITIATED an FSA
* refactor(actions): make PENDING_SAVE_INITIATED an FSA
* refactor(actions): make SAVE_FINISHED an FSA
* refactor(actions): use string action type for TOGGLE_SUGGESTIONS
* refactor(actions): use string action type for DIFF_SETTING_CHANGED
* refactor(actions): make SET_SUGGESTION_SEARCH_TYPE an FSA
* refactor(actions): remove unused action
* refactor(actions): remove unused action type
* refactor(actions): make COPY_SUGGESTION an FSA
* refactor(actions): make TEXT_SUGGESTION_STARTED_COPYING an FSA
* refactor(actions): make TEXT_SUGGESTION_FINISHED_COPYING an FSA
* refactor(actions): make PHRASE_SUGGESTION_STARTED_COPYING an FSA
* refactor(actions): make PHRASE_SUGGESTION_FINISHED_COPYING an FSA
* refactor(actions): make TEXT_SUGGESTIONS_UPDATED an FSA
* refactor(actions): make SUGGESTION_SEARCH_TEXT_CHANGE an FSA
* refactor(actions): make PHRASE_SUGGESTIONS_UPDATED an FSA
* refactor(actions): make SUGGESTION_PANEL_HEIGHT_CHANGE an FSA
* refactor(actions): make SHOW_DETAIL_FOR_SUGGESTION_BY_INDEX an FSA
* refactor(reducers): use handleActions for phrase-reducer
Some other refactors are possible, but I purposely left those so that
the structure change is not mixed with other changes.
* refactor(reducers): use handleAction for context-reducer
Also changed the variable name to match the module name.
* refactor(reducers): use handleActions for dropdown-reducer
Removes a comment that is no longer true.
Also replaces some Symbol keys with strings so that state is serializable.
* refactor(reducers): use handleActions for glossary-reducer
* refactor(reducers): use handleActions for header-data-reducer
* refactor(reducers): use handleActions for suggestions-reducer
* refactor(reducers): use handleActions for ui-reducer
* fix: remove excess newline (fixes lint error)
More information about the zanata-commits
mailing list