Fix CR comments
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Fri, 3 Aug 2018 11:01:38 +0000 (13:01 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Fri, 3 Aug 2018 11:01:38 +0000 (13:01 +0200)
Feature #13855

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/models/tree.ts
src/store/collection-panel/collection-panel-action.ts
src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
src/store/collection-panel/collection-panel-files/collection-panel-files-reducer.test.ts
src/store/collection-panel/collection-panel-files/collection-panel-files-reducer.ts [moved from src/store/collection-panel/collection-panel-files/collections-panel-files-reducer.ts with 98% similarity]
src/store/store.ts

index b9ef77293e67d404999ec76aa817ed91b7822e9e..8b66e50da7961df58c5c60f0b8fd23556f749467 100644 (file)
@@ -21,7 +21,7 @@ export const setNode = <T>(node: TreeNode<T>) => (tree: Tree<T>): Tree<T> => {
     const [newTree] = [tree]
         .map(tree => getNode(node.id)(tree) === node
             ? tree
-            : Object.assign({}, tree, { [node.id]: node }))
+            : {...tree, [node.id]: node})
         .map(addChild(node.parent, node.id));
     return newTree;
 };
index 419f04049b83ffaceff9f4c871c5319487163fa6..ee95590c064446d3d614c2bc2b9640f293bf8aba 100644 (file)
@@ -29,7 +29,7 @@ export const loadCollection = (uuid: string, kind: ResourceKind) =>
                 return services.collectionFilesService.getFiles(item.uuid);
             })
             .then(files => {
-                dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES({ files }));
+                dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES(files));
             });
     };
 
index 7423c4916cec392fea776405bc303639f49864d1..463d49c5ef9de106349e7bd22135fe2fb5aa8882 100644 (file)
@@ -3,11 +3,10 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { default as unionize, ofType, UnionOf } from "unionize";
-import { KeepManifest } from "../../../models/keep-manifest";
 import { CollectionFilesTree } from "../../../models/collection-file";
 
 export const collectionPanelFilesAction = unionize({
-    SET_COLLECTION_FILES: ofType<{ files: CollectionFilesTree }>(),
+    SET_COLLECTION_FILES: ofType<CollectionFilesTree>(),
     TOGGLE_COLLECTION_FILE_COLLAPSE: ofType<{ id: string }>(),
     TOGGLE_COLLECTION_FILE_SELECTION: ofType<{ id: string }>(),
     SELECT_ALL_COLLECTION_FILES: ofType<{}>(),
index 636b59258c3f8746c00184c73a09239ea24e9d2b..1a6bb7d7964447873e389f8e51567bd1c4f83e42 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { collectionPanelFilesReducer } from "./collections-panel-files-reducer";
+import { collectionPanelFilesReducer } from "./collection-panel-files-reducer";
 import { collectionPanelFilesAction } from "./collection-panel-files-actions";
 import { CollectionFile, CollectionDirectory, createCollectionFile, createCollectionDirectory } from "../../../models/collection-file";
 import { createTree, setNode, getNodeValue, mapTreeValues, Tree } from "../../../models/tree";
@@ -31,7 +31,7 @@ describe('CollectionPanelFilesReducer', () => {
 
     const collectionPanelFilesTree = collectionPanelFilesReducer(
         createTree<CollectionPanelFile | CollectionPanelDirectory>(),
-        collectionPanelFilesAction.SET_COLLECTION_FILES({ files: collectionFilesTree }));
+        collectionPanelFilesAction.SET_COLLECTION_FILES(collectionFilesTree));
 
     it('SET_COLLECTION_FILES', () => {
         expect(getNodeValue('Directory 1')(collectionPanelFilesTree)).toEqual({
similarity index 98%
rename from src/store/collection-panel/collection-panel-files/collections-panel-files-reducer.ts
rename to src/store/collection-panel/collection-panel-files/collection-panel-files-reducer.ts
index c27000e2227de7f941991b2ca7aaf77f25fdc3ac..ca518f0ea52e018f697eefe78de5b65937adb7e9 100644 (file)
@@ -9,7 +9,7 @@ import { CollectionFileType } from "../../../models/collection-file";
 
 export const collectionPanelFilesReducer = (state: CollectionPanelFilesState = createTree(), action: CollectionPanelFilesAction) => {
     return collectionPanelFilesAction.match(action, {
-        SET_COLLECTION_FILES: ({ files }) =>
+        SET_COLLECTION_FILES: files =>
             mapTree(mapCollectionFileToCollectionPanelFile)(files),
 
         TOGGLE_COLLECTION_FILE_COLLAPSE: data =>
index 6e57465cc388a8e3e83d720ff9b9606918482a50..aeb6a09cd388af3e559a41142590adcfc31234c1 100644 (file)
@@ -17,7 +17,7 @@ import { reducer as formReducer } from 'redux-form';
 import { FavoritesState, favoritesReducer } from './favorites/favorites-reducer';
 import { snackbarReducer, SnackbarState } from './snackbar/snackbar-reducer';
 import { CollectionPanelFilesState } from './collection-panel/collection-panel-files/collection-panel-files-state';
-import { collectionPanelFilesReducer } from './collection-panel/collection-panel-files/collections-panel-files-reducer';
+import { collectionPanelFilesReducer } from './collection-panel/collection-panel-files/collection-panel-files-reducer';
 import { dataExplorerMiddleware } from "./data-explorer/data-explorer-middleware";
 import { FAVORITE_PANEL_ID } from "./favorite-panel/favorite-panel-action";
 import { PROJECT_PANEL_ID } from "./project-panel/project-panel-action";