Further rename updator -> updater
authorDaniel Kos <unodgs@gmail.com>
Sun, 5 Aug 2018 16:59:20 +0000 (18:59 +0200)
committerDaniel Kos <unodgs@gmail.com>
Sun, 5 Aug 2018 16:59:20 +0000 (18:59 +0200)
Feature #13856

Arvados-DCO-1.1-Signed-off-by: Daniel Kos <unodgs@gmail.com>

src/store/collections/collections-reducer.ts
src/store/collections/creator/collection-creator-action.ts
src/store/collections/creator/collection-creator-reducer.test.ts
src/store/collections/creator/collection-creator-reducer.ts
src/store/collections/updater/collection-updater-action.ts
src/store/collections/updater/collection-updater-reducer.ts
src/views-components/update-collection-dialog/update-collection-dialog..tsx

index 155498a8823849288195568501835acc227b4397..6edb8e4ab69155e9b5bd1338a4cdb540dec5acc6 100644 (file)
@@ -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
 });
index 2f2b83850e5f226aeb9e3a857e1c5f937aa5e3e8..b06cf0f5970346ffe22d74cf0f3454f20c20fe3a 100644 (file)
@@ -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<CollectionResource>) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
index fde58c433602aea0725ce09cb59f3006483bc4b2..5aa9dcfe5a86f6c6cc51f6bf987f1ad42bacb6d0 100644 (file)
@@ -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
+});
index 1a3cb0d2ea5f1082de69e0c796321df6295f6d07..140cbbea45e4bf423eda511d9a393133507f0334 100644 (file)
@@ -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 }),
index fff8b71b84fc91e21ab4e6f4d30aa0ea51ca8507..baeb6387b601556f3fbbbd1dacf274afc4ae2a50 100644 (file)
@@ -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<CollectionResource>) =>
             .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<typeof collectionUpdatorActions>;
+export type CollectionUpdaterAction = UnionOf<typeof collectionUpdaterActions>;
index e7d4e63d6ba38da3d67ccdab9f3f209b66611343..b5fd232c515bcca580cb5c8eced77c3d276c1b74 100644 (file)
@@ -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<CollectionUpdator>) => ({
+const updateCollection = (state: CollectionUpdaterState, updater?: Partial<CollectionUpdater>) => ({
     ...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: "" }),
index b067b132f604fe8dd83da5ab83b1b190face2144..2984b527af60cc59c4993cb7582e7dd39747b34e 100644 (file)
@@ -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<any>(editCollection(data))