X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/89c3c647797787377f4d950b38d320ee3b28e92c..172ba18e43743d90b8a1110d62209be2ab7627d1:/src/models/collection-file.ts diff --git a/src/models/collection-file.ts b/src/models/collection-file.ts index 97afcac6..91008d1f 100644 --- a/src/models/collection-file.ts +++ b/src/models/collection-file.ts @@ -52,7 +52,7 @@ export const createCollectionFile = (data: Partial): CollectionF ...data }); -export const createCollectionFilesTree = (data: Array) => { +export const createCollectionFilesTree = (data: Array, joinParents: Boolean = true) => { const directories = data.filter(item => item.type === CollectionFileType.DIRECTORY); directories.sort((a, b) => a.path.localeCompare(b.path)); const files = data.filter(item => item.type === CollectionFileType.FILE); @@ -60,13 +60,12 @@ export const createCollectionFilesTree = (data: Array setNode({ children: [], id: item.id, - parent: getParentId(item), + parent: joinParents ? getParentId(item) : '', value: item, active: false, selected: false, expanded: false, status: TreeNodeStatus.INITIAL - })(tree), createTree()); };