[ARVADOS-WORKBENCH2] updated: 1.3.1-381-gafb58864

Git user git at public.curoverse.com
Tue Feb 26 08:22:18 EST 2019


Summary of changes:
 src/common/webdav.ts                               | 15 ++++-----------
 src/store/collections/collection-upload-actions.ts |  9 +++++++--
 2 files changed, 11 insertions(+), 13 deletions(-)

       via  afb588643e62c20e94e284877913f60b4754c1cf (commit)
      from  ec2ce1a965e15cb272737251b56bca2c1529ebff (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 afb588643e62c20e94e284877913f60b4754c1cf
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Tue Feb 26 14:22:04 2019 +0100

    refs #14857-new-workbench-affects-files-content
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/common/webdav.ts b/src/common/webdav.ts
index 8aea568a..1a7da835 100644
--- a/src/common/webdav.ts
+++ b/src/common/webdav.ts
@@ -29,17 +29,11 @@ export class WebDAV {
         })
 
     upload = (url: string, path: string, files: File[], config: WebDAVRequestConfig = {}) => {
-        const fd = new FormData();
-        fd.append('path', path);
-        files.forEach((f, idx) => {
-            fd.append(`file-${idx}`, f);
-        });
-
-        return this.request({
+        return files.map(file => this.request({
             ...config, url,
             method: 'PUT',
-            data: fd
-        });
+            data: file
+        }));
     }
 
     copy = (url: string, destination: string, config: WebDAVRequestConfig = {}) =>
@@ -66,7 +60,6 @@ export class WebDAV {
         return new Promise<XMLHttpRequest>((resolve, reject) => {
             const r = this.createRequest();
             r.open(config.method, this.defaults.baseURL + config.url);
-
             const headers = { ...this.defaults.headers, ...config.headers };
             Object
                 .keys(headers)
@@ -115,4 +108,4 @@ interface RequestConfig {
     headers?: { [key: string]: string };
     data?: any;
     onUploadProgress?: (event: ProgressEvent) => void;
-}
+}
\ No newline at end of file
diff --git a/src/store/collections/collection-upload-actions.ts b/src/store/collections/collection-upload-actions.ts
index cf8c37c8..268d5ddf 100644
--- a/src/store/collections/collection-upload-actions.ts
+++ b/src/store/collections/collection-upload-actions.ts
@@ -11,6 +11,9 @@ import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions
 import { fileUploaderActions } from '~/store/file-uploader/file-uploader-actions';
 import { reset, startSubmit, stopSubmit } from 'redux-form';
 import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
+import { collectionPanelFilesAction } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
+import { createTree } from '~/models/tree';
+import { loadCollectionPanel } from '../collection-panel/collection-panel-action';
 
 export const uploadCollectionFiles = (collectionUuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
@@ -35,8 +38,10 @@ export const submitCollectionFiles = () =>
             try {
                 dispatch(progressIndicatorActions.START_WORKING(COLLECTION_UPLOAD_FILES_DIALOG));
                 dispatch(startSubmit(COLLECTION_UPLOAD_FILES_DIALOG));
-                await dispatch<any>(uploadCollectionFiles(currentCollection.uuid));
+                await dispatch<any>(uploadCollectionFiles(currentCollection.uuid))
+                    .then(() => dispatch<any>(collectionPanelFilesAction.SET_COLLECTION_FILES({ files: createTree() })));
                 dispatch<any>(loadCollectionFiles(currentCollection.uuid));
+                dispatch<any>(loadCollectionPanel(currentCollection.uuid));
                 dispatch(closeUploadCollectionFilesDialog());
                 dispatch(snackbarActions.OPEN_SNACKBAR({
                     message: 'Data has been uploaded.',
@@ -61,4 +66,4 @@ export const closeUploadCollectionFilesDialog = () => dialogActions.CLOSE_DIALOG
 
 const handleUploadProgress = (dispatch: Dispatch) => (fileId: number, loaded: number, total: number, currentTime: number) => {
     dispatch(fileUploaderActions.SET_UPLOAD_PROGRESS({ fileId, loaded, total, currentTime }));
-};
+};
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list