X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7da8834efcac17c997d6a7f7a557b7865b1c1137..5248f137a53e981e6c6207c212688fbd08e2cdc9:/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()); };