store - change collection update action name, create collection form fields
[arvados.git] / src / store / tree-picker / tree-picker-actions.ts
index 5b29c4c2b5168616a6a80f70f6709c8ab328dc3b..34f1303717e0097a723c4851af8e94481f4f213d 100644 (file)
@@ -5,48 +5,16 @@
 import { default as unionize, ofType, UnionOf } from "unionize";
 
 import { TreePickerNode } from "./tree-picker";
-import { receiveTreePickerData, TreePickerKind } from "../../views-components/project-tree-picker/project-tree-picker";
-import { mockProjectResource } from "../../models/test-utils";
-import { Dispatch } from "redux";
-import { RootState } from "../store";
-import { ServiceRepository } from "../../services/services";
 
 export const treePickerActions = unionize({
-    LOAD_TREE_PICKER_NODE: ofType<{ id: string, pickerId: string }>(),
-    LOAD_TREE_PICKER_NODE_SUCCESS: ofType<{ id: string, nodes: Array<TreePickerNode>, pickerId: string }>(),
-    TOGGLE_TREE_PICKER_NODE_COLLAPSE: ofType<{ id: string, pickerId: string }>(),
-    TOGGLE_TREE_PICKER_NODE_SELECT: ofType<{ id: string, pickerId: string }>()
+    LOAD_TREE_PICKER_NODE: ofType<{ nodeId: string, pickerId: string }>(),
+    LOAD_TREE_PICKER_NODE_SUCCESS: ofType<{ nodeId: string, nodes: Array<TreePickerNode>, pickerId: string }>(),
+    TOGGLE_TREE_PICKER_NODE_COLLAPSE: ofType<{ nodeId: string, pickerId: string }>(),
+    TOGGLE_TREE_PICKER_NODE_SELECT: ofType<{ nodeId: string, pickerId: string }>(),
+    RESET_TREE_PICKER: ofType<{ pickerId: string }>()
 }, {
         tag: 'type',
         value: 'payload'
     });
 
-export const initPickerProjectTree = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-    const uuid = services.authService.getUuid();
-
-    dispatch<any>(getPickerTreeProjects(uuid));
-    dispatch<any>(getSharedWithMeProjectsPickerTree(uuid));
-    dispatch<any>(getFavoritesProjectsPickerTree(uuid));
-};
-
-const getPickerTreeProjects = (uuid: string = '') => {
-    return getProjectsPickerTree(uuid, TreePickerKind.PROJECTS);
-};
-
-const getSharedWithMeProjectsPickerTree = (uuid: string = '') => {
-    return getProjectsPickerTree(uuid, TreePickerKind.SHARED_WITH_ME);
-};
-
-const getFavoritesProjectsPickerTree = (uuid: string = '') => {
-    return getProjectsPickerTree(uuid, TreePickerKind.FAVORITES);
-};
-
-const getProjectsPickerTree = (uuid: string, kind: string) => {
-    return receiveTreePickerData(
-        '',
-        [mockProjectResource({ uuid, name: kind })],
-        kind
-    );
-};
-
 export type TreePickerAction = UnionOf<typeof treePickerActions>;