From 67d7540c8d035c70091457ea4b0f2d554a16bf84 Mon Sep 17 00:00:00 2001 From: Daniel Kos Date: Sun, 5 Aug 2018 18:59:20 +0200 Subject: [PATCH] Further rename updator -> updater Feature #13856 Arvados-DCO-1.1-Signed-off-by: Daniel Kos --- src/store/collections/collections-reducer.ts | 6 +++--- .../creator/collection-creator-action.ts | 6 +++--- .../creator/collection-creator-reducer.test.ts | 10 +++++----- .../creator/collection-creator-reducer.ts | 2 +- .../updater/collection-updater-action.ts | 14 +++++++------- .../updater/collection-updater-reducer.ts | 16 ++++++++-------- .../update-collection-dialog..tsx | 4 ++-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/store/collections/collections-reducer.ts b/src/store/collections/collections-reducer.ts index 155498a8..6edb8e4a 100644 --- a/src/store/collections/collections-reducer.ts +++ b/src/store/collections/collections-reducer.ts @@ -8,10 +8,10 @@ import * as updator from "./updater/collection-updater-reducer"; export type CollectionsState = { creator: creator.CollectionCreatorState; - updator: updator.CollectionUpdatorState; + updator: updator.CollectionUpdaterState; }; export const collectionsReducer = combineReducers({ - creator: creator.collectionCreationReducer, - updator: updator.collectionCreationReducer + creator: creator.collectionCreatorReducer, + updator: updator.collectionUpdaterReducer }); diff --git a/src/store/collections/creator/collection-creator-action.ts b/src/store/collections/creator/collection-creator-action.ts index 2f2b8385..b06cf0f5 100644 --- a/src/store/collections/creator/collection-creator-action.ts +++ b/src/store/collections/creator/collection-creator-action.ts @@ -15,9 +15,9 @@ export const collectionCreateActions = unionize({ CREATE_COLLECTION: ofType<{}>(), CREATE_COLLECTION_SUCCESS: ofType<{}>(), }, { - tag: 'type', - value: 'payload' - }); + tag: 'type', + value: 'payload' +}); export const createCollection = (collection: Partial) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { diff --git a/src/store/collections/creator/collection-creator-reducer.test.ts b/src/store/collections/creator/collection-creator-reducer.test.ts index fde58c43..5aa9dcfe 100644 --- a/src/store/collections/creator/collection-creator-reducer.test.ts +++ b/src/store/collections/creator/collection-creator-reducer.test.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { collectionCreationReducer } from "./collection-creator-reducer"; +import { collectionCreatorReducer } from "./collection-creator-reducer"; import { collectionCreateActions } from "./collection-creator-action"; describe('collection-reducer', () => { @@ -11,7 +11,7 @@ describe('collection-reducer', () => { const initialState = { opened: false, ownerUuid: "" }; const collection = { opened: true, ownerUuid: "" }; - const state = collectionCreationReducer(initialState, collectionCreateActions.OPEN_COLLECTION_CREATOR(initialState)); + const state = collectionCreatorReducer(initialState, collectionCreateActions.OPEN_COLLECTION_CREATOR(initialState)); expect(state).toEqual(collection); }); @@ -19,7 +19,7 @@ describe('collection-reducer', () => { const initialState = { opened: true, ownerUuid: "" }; const collection = { opened: false, ownerUuid: "" }; - const state = collectionCreationReducer(initialState, collectionCreateActions.CLOSE_COLLECTION_CREATOR()); + const state = collectionCreatorReducer(initialState, collectionCreateActions.CLOSE_COLLECTION_CREATOR()); expect(state).toEqual(collection); }); @@ -27,7 +27,7 @@ describe('collection-reducer', () => { const initialState = { opened: true, ownerUuid: "test" }; const collection = { opened: false, ownerUuid: "" }; - const state = collectionCreationReducer(initialState, collectionCreateActions.CREATE_COLLECTION_SUCCESS()); + const state = collectionCreatorReducer(initialState, collectionCreateActions.CREATE_COLLECTION_SUCCESS()); expect(state).toEqual(collection); }); -}); \ No newline at end of file +}); diff --git a/src/store/collections/creator/collection-creator-reducer.ts b/src/store/collections/creator/collection-creator-reducer.ts index 1a3cb0d2..140cbbea 100644 --- a/src/store/collections/creator/collection-creator-reducer.ts +++ b/src/store/collections/creator/collection-creator-reducer.ts @@ -21,7 +21,7 @@ const initialState: CollectionCreatorState = { ownerUuid: '' }; -export const collectionCreationReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => { +export const collectionCreatorReducer = (state: CollectionCreatorState = initialState, action: CollectionCreateAction) => { return collectionCreateActions.match(action, { OPEN_COLLECTION_CREATOR: ({ ownerUuid }) => updateCreator(state, { ownerUuid, opened: true }), CLOSE_COLLECTION_CREATOR: () => updateCreator(state, { opened: false }), diff --git a/src/store/collections/updater/collection-updater-action.ts b/src/store/collections/updater/collection-updater-action.ts index fff8b71b..baeb6387 100644 --- a/src/store/collections/updater/collection-updater-action.ts +++ b/src/store/collections/updater/collection-updater-action.ts @@ -11,21 +11,21 @@ import { CollectionResource } from '../../../models/collection'; import { initialize } from 'redux-form'; import { collectionPanelActions } from "../../collection-panel/collection-panel-action"; -export const collectionUpdatorActions = unionize({ +export const collectionUpdaterActions = unionize({ OPEN_COLLECTION_UPDATER: ofType<{ uuid: string }>(), CLOSE_COLLECTION_UPDATER: ofType<{}>(), UPDATE_COLLECTION_SUCCESS: ofType<{}>(), }, { - tag: 'type', - value: 'payload' - }); + tag: 'type', + value: 'payload' +}); export const COLLECTION_FORM_NAME = 'collectionEditDialog'; export const openUpdater = (uuid: string) => (dispatch: Dispatch, getState: () => RootState) => { - dispatch(collectionUpdatorActions.OPEN_COLLECTION_UPDATER({ uuid })); + dispatch(collectionUpdaterActions.OPEN_COLLECTION_UPDATER({ uuid })); const item = getState().collectionPanel.item; if(item) { dispatch(initialize(COLLECTION_FORM_NAME, { name: item.name, description: item.description })); @@ -39,9 +39,9 @@ export const updateCollection = (collection: Partial) => .update(uuid, collection) .then(collection => { dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection as CollectionResource })); - dispatch(collectionUpdatorActions.UPDATE_COLLECTION_SUCCESS()); + dispatch(collectionUpdaterActions.UPDATE_COLLECTION_SUCCESS()); } ); }; -export type CollectionUpdaterAction = UnionOf; +export type CollectionUpdaterAction = UnionOf; diff --git a/src/store/collections/updater/collection-updater-reducer.ts b/src/store/collections/updater/collection-updater-reducer.ts index e7d4e63d..b5fd232c 100644 --- a/src/store/collections/updater/collection-updater-reducer.ts +++ b/src/store/collections/updater/collection-updater-reducer.ts @@ -2,27 +2,27 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { collectionUpdatorActions, CollectionUpdaterAction } from './collection-updater-action'; +import { collectionUpdaterActions, CollectionUpdaterAction } from './collection-updater-action'; -export type CollectionUpdatorState = CollectionUpdator; +export type CollectionUpdaterState = CollectionUpdater; -interface CollectionUpdator { +interface CollectionUpdater { opened: boolean; uuid: string; } -const updateCollection = (state: CollectionUpdatorState, updator?: Partial) => ({ +const updateCollection = (state: CollectionUpdaterState, updater?: Partial) => ({ ...state, - ...updator + ...updater }); -const initialState: CollectionUpdatorState = { +const initialState: CollectionUpdaterState = { opened: false, uuid: '' }; -export const collectionCreationReducer = (state: CollectionUpdatorState = initialState, action: CollectionUpdaterAction) => { - return collectionUpdatorActions.match(action, { +export const collectionUpdaterReducer = (state: CollectionUpdaterState = initialState, action: CollectionUpdaterAction) => { + return collectionUpdaterActions.match(action, { OPEN_COLLECTION_UPDATER: ({ uuid }) => updateCollection(state, { uuid, opened: true }), CLOSE_COLLECTION_UPDATER: () => updateCollection(state, { opened: false }), UPDATE_COLLECTION_SUCCESS: () => updateCollection(state, { opened: false, uuid: "" }), diff --git a/src/views-components/update-collection-dialog/update-collection-dialog..tsx b/src/views-components/update-collection-dialog/update-collection-dialog..tsx index b067b132..2984b527 100644 --- a/src/views-components/update-collection-dialog/update-collection-dialog..tsx +++ b/src/views-components/update-collection-dialog/update-collection-dialog..tsx @@ -7,7 +7,7 @@ import { Dispatch } from "redux"; import { SubmissionError } from "redux-form"; import { RootState } from "../../store/store"; import { snackbarActions } from "../../store/snackbar/snackbar-actions"; -import { collectionUpdatorActions, updateCollection } from "../../store/collections/updater/collection-updater-action"; +import { collectionUpdaterActions, updateCollection } from "../../store/collections/updater/collection-updater-action"; import { dataExplorerActions } from "../../store/data-explorer/data-explorer-action"; import { PROJECT_PANEL_ID } from "../../views/project-panel/project-panel"; import { DialogCollectionUpdate } from "../dialog-update/dialog-collection-update"; @@ -18,7 +18,7 @@ const mapStateToProps = (state: RootState) => ({ const mapDispatchToProps = (dispatch: Dispatch) => ({ handleClose: () => { - dispatch(collectionUpdatorActions.CLOSE_COLLECTION_UPDATER()); + dispatch(collectionUpdaterActions.CLOSE_COLLECTION_UPDATER()); }, onSubmit: (data: { name: string, description: string }) => { return dispatch(editCollection(data)) -- 2.30.2