16212: Uses getUserDisplayName() wherever needed to show a user's name.
[arvados-workbench2.git] / src / models / tree.ts
index bec2f758a478335e6ef437afe6592dde144ce729..de2f7b71a1b6861ccd6af42e262f652d8e7d67b0 100644 (file)
@@ -27,7 +27,8 @@ export enum TreeNodeStatus {
 export enum TreePickerId {
     PROJECTS = 'Projects',
     SHARED_WITH_ME = 'Shared with me',
-    FAVORITES = 'Favorites'
+    FAVORITES = 'Favorites',
+    PUBLIC_FAVORITES = 'Public Favorites'
 }
 
 export const createTree = <T>(): Tree<T> => ({});
@@ -237,6 +238,9 @@ const getRootNodeChildrenIds = <T>(tree: Tree<T>) =>
 
 
 const addChild = (parentId: string, childId: string) => <T>(tree: Tree<T>): Tree<T> => {
+    if (childId === "") {
+        return tree;
+    }
     const node = getNode(parentId)(tree);
     if (node) {
         const children = node.children.some(id => id === childId)