[ARVADOS-WORKBENCH2] updated: 1.1.4-584-gc4e5031
Git user
git at public.curoverse.com
Mon Aug 13 03:19:37 EDT 2018
Summary of changes:
src/common/config.ts | 12 ++---
src/common/webdav.test.ts | 40 +++++++--------
src/common/webdav.ts | 60 ++++++++--------------
src/index.tsx | 1 +
.../collection-service/collection-service.ts | 2 +-
src/services/services.ts | 8 +--
src/store/auth/auth-actions.test.ts | 4 +-
src/store/auth/auth-reducer.test.ts | 2 +-
8 files changed, 55 insertions(+), 74 deletions(-)
via c4e503180948300c3a6ef99e338d2e56b2931236 (commit)
via d5a3a1f9623e200dd1170e7b9279127e7f4f0936 (commit)
via 3b0011c6f2312bd6517cf470a80b921bd65e86fe (commit)
from a2cb695cb495ad156634b2caa4363a0753981203 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit c4e503180948300c3a6ef99e338d2e56b2931236
Merge: a2cb695 d5a3a1f
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Aug 13 09:19:20 2018 +0200
Merge changes from webdav-service
Feature #13990
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --cc src/services/collection-service/collection-service.ts
index 32eeac4,4d75036..4726825
--- a/src/services/collection-service/collection-service.ts
+++ b/src/services/collection-service/collection-service.ts
@@@ -21,52 -19,6 +21,52 @@@ export class CollectionService extends
super(serverApi, "collections");
}
+ async files(uuid: string) {
+ const request = await this.webdavClient.propfind(`/c=${uuid}`);
+ if (request.responseXML != null) {
+ return createCollectionFilesTree(this.extractFilesData(request.responseXML));
+ }
+ return Promise.reject();
+ }
+
+ async deleteFile(collectionUuid: string, filePath: string){
+ return this.webdavClient.delete(`/c=${collectionUuid}${filePath}`);
+ }
+
+
+ extractFilesData(document: Document) {
+ return Array
+ .from(document.getElementsByTagName('D:response'))
+ .slice(1)
+ .map(element => {
+ const [displayNameElement] = Array.from(element.getElementsByTagName('D:displayname'));
+ const name = displayNameElement ? displayNameElement.innerHTML : undefined;
+
+ const [sizeElement] = Array.from(element.getElementsByTagName('D:getcontentlength'));
+ const size = sizeElement ? parseInt(sizeElement.innerHTML, 10) : 0;
+
+ const [hrefElement] = Array.from(element.getElementsByTagName('D:href'));
+ const pathname = hrefElement ? hrefElement.innerHTML : undefined;
+ const directory = pathname && pathname.replace(/\/c=[0-9a-zA-Z\-]*/, '').replace(`/${name || ''}`, '');
+
- const href = this.webdavClient.defaults.baseUrl + pathname + '?api_token=' + this.authService.getApiToken();
++ const href = this.webdavClient.defaults.baseURL + pathname + '?api_token=' + this.authService.getApiToken();
+
+ const data = {
+ url: href,
+ id: `${directory}/${name}`,
+ name,
+ path: directory,
+ };
+
+ const [resourceTypeElement] = Array.from(element.getElementsByTagName('D:resourcetype'));
+ return resourceTypeElement && resourceTypeElement.innerHTML === ''
+ ? createCollectionFile({ ...data, size })
+ : createCollectionDirectory(data);
+
+ });
+ }
+
+
private readFile(file: File): Promise<ArrayBuffer> {
return new Promise<ArrayBuffer>(resolve => {
const reader = new FileReader();
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list