Merge branch '14436-bugfix-expanding-collection-files-tree'
[arvados-workbench2.git] / src / services / collection-service / collection-service-files-response.ts
index a4b527a23ab4f1d442d2bd2840f6dc7085cc9970..619a4fc78582270558aa51ac07986ba578ed1c02 100644 (file)
@@ -26,7 +26,7 @@ export const sortFilesTree = (tree: Tree<CollectionDirectory | CollectionFile>)
 };
 
 export const extractFilesData = (document: Document) => {
-    const collectionUrlPrefix = /\/c=([0-9a-zA-Z\-]*)/;
+    const collectionUrlPrefix = /\/c=([^\/]*)/;
     return Array
         .from(document.getElementsByTagName('D:response'))
         .slice(1) // omit first element which is collection itself
@@ -46,7 +46,7 @@ export const extractFilesData = (document: Document) => {
                 url,
                 id: [
                     collectionUuid ? collectionUuid : '',
-                    directory ? '/' + directory : '',
+                    directory ? '/' + directory.replace(/^\//, '') : '',
                     '/' + name
                 ].join(''),
                 name,