[ARVADOS-WORKBENCH2] created: 1.2.0-849-gbf801d3
Git user
git at public.curoverse.com
Tue Nov 13 08:00:33 EST 2018
at bf801d31a42b40e6bfa5e99d2d2e17b236a372c2 (commit)
commit bf801d31a42b40e6bfa5e99d2d2e17b236a372c2
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Tue Nov 13 12:56:00 2018 +0100
Create function for creating correct file's parent id
Feature #14436
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/models/collection-file.ts b/src/models/collection-file.ts
index 37e18cf..97afcac 100644
--- a/src/models/collection-file.ts
+++ b/src/models/collection-file.ts
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import { Tree, createTree, setNode, TreeNodeStatus } from './tree';
+import { head, split, pipe, join } from 'lodash/fp';
export type CollectionFilesTree = Tree<CollectionDirectory | CollectionFile>;
@@ -59,7 +60,7 @@ export const createCollectionFilesTree = (data: Array<CollectionDirectory | Coll
.reduce((tree, item) => setNode({
children: [],
id: item.id,
- parent: item.path,
+ parent: getParentId(item),
value: item,
active: false,
selected: false,
@@ -67,4 +68,14 @@ export const createCollectionFilesTree = (data: Array<CollectionDirectory | Coll
status: TreeNodeStatus.INITIAL
})(tree), createTree<CollectionDirectory | CollectionFile>());
-};
\ No newline at end of file
+};
+
+const getParentId = (item: CollectionDirectory | CollectionFile) =>
+ item.path
+ ? join('', [getCollectionId(item.id), item.path])
+ : item.path;
+
+const getCollectionId = pipe(
+ split('/'),
+ head,
+);
\ No newline at end of file
commit c1d96828aa5050c9026afcd243c162bcf354b52b
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Tue Nov 13 12:23:27 2018 +0100
Fix slash duplications in file directory
Feature #14436
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/services/collection-service/collection-service-files-response.ts b/src/services/collection-service/collection-service-files-response.ts
index 1a4f990..619a4fc 100644
--- a/src/services/collection-service/collection-service-files-response.ts
+++ b/src/services/collection-service/collection-service-files-response.ts
@@ -46,7 +46,7 @@ export const extractFilesData = (document: Document) => {
url,
id: [
collectionUuid ? collectionUuid : '',
- directory ? '/' + directory : '',
+ directory ? '/' + directory.replace(/^\//, '') : '',
'/' + name
].join(''),
name,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list