Merge branch '17595-Selecting-multiple-collections-as-inputs-to-a-workflow'
[arvados-workbench2.git] / src / store / tree-picker / tree-picker.ts
index 259a4b8d53de78e1b7d9992ae85b4d69d5fe40ca..a4127fa3bba31a2b584459e93214d9d90d824414 100644 (file)
@@ -3,17 +3,10 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Tree } from "~/models/tree";
-import { TreeItemStatus } from "~/components/tree/tree";
+import { TreeItemStatus } from '~/components/tree/tree';
+export type TreePicker = { [key: string]: Tree<any> };
 
-export type TreePicker = { [key: string]: Tree<TreePickerNode> };
-
-export interface TreePickerNode<Value = any> {
-    nodeId: string;
-    value: Value;
-    selected: boolean;
-    collapsed: boolean;
-    status: TreeItemStatus;
-}
+export const getTreePicker = <Value = {}>(id: string) => (state: TreePicker): Tree<Value> | undefined => state[id];
 
 export const createTreePickerNode = (data: { nodeId: string, value: any }) => ({
     ...data,
@@ -21,5 +14,3 @@ export const createTreePickerNode = (data: { nodeId: string, value: any }) => ({
     collapsed: true,
     status: TreeItemStatus.INITIAL
 });
-
-export const getTreePicker = <Value = {}>(id: string) => (state: TreePicker): Tree<TreePickerNode<Value>> | undefined => state[id];
\ No newline at end of file