Create basic cumulative projects picker
[arvados-workbench2.git] / src / models / tree.ts
index 69d2e9376939f5a3d8ba6fa6180a1b1e0558b626..cce27b125a1053c053b6df04227bd0e4e23a52df 100644 (file)
@@ -109,6 +109,8 @@ export const mapIdsToNodes = (ids: string[]) => <T>(tree: Tree<T>) =>
 export const activateNode = (id: string) => <T>(tree: Tree<T>) =>
     mapTree(node => node.id === id ? { ...node, active: true } : { ...node, active: false })(tree);
 
+export const deactivateNode = <T>(tree: Tree<T>) =>
+    mapTree(node => node.active ? { ...node, active: false } : node)(tree);
 
 export const expandNode = (...ids: string[]) => <T>(tree: Tree<T>) =>
     mapTree(node => ids.some(id => id === node.id) ? { ...node, expanded: true } : node)(tree);