X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e63198a93d7b537ffbb68b8210c99f76041fd112..f0d3e4427d463f778beca4d3fe8330da963c9e5d:/src/store/tree-picker/tree-picker.ts diff --git a/src/store/tree-picker/tree-picker.ts b/src/store/tree-picker/tree-picker.ts index ee45becc..259a4b8d 100644 --- a/src/store/tree-picker/tree-picker.ts +++ b/src/store/tree-picker/tree-picker.ts @@ -2,22 +2,24 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { Tree } from "../../models/tree"; -import { TreeItemStatus } from "../../components/tree/tree"; +import { Tree } from "~/models/tree"; +import { TreeItemStatus } from "~/components/tree/tree"; -export type TreePicker = Tree; +export type TreePicker = { [key: string]: Tree }; -export interface TreePickerNode { - id: string; - value: any; +export interface TreePickerNode { + nodeId: string; + value: Value; selected: boolean; collapsed: boolean; status: TreeItemStatus; } -export const createTreePickerNode = (data: {id: string, value: any}) => ({ +export const createTreePickerNode = (data: { nodeId: string, value: any }) => ({ ...data, selected: false, collapsed: true, status: TreeItemStatus.INITIAL -}); \ No newline at end of file +}); + +export const getTreePicker = (id: string) => (state: TreePicker): Tree> | undefined => state[id]; \ No newline at end of file