18834: Fixed uploading file to a subdirectory, added tests
[arvados-workbench2.git] / src / components / collection-panel-files / collection-panel-files.tsx
index 1f7e8603c5ec25bb9afa8a1a68b8565b7c7a909d..56833f64bade2376fd68b157679d7d041bc78869 100644 (file)
@@ -28,7 +28,7 @@ export interface CollectionPanelFilesProps {
     isWritable: boolean;
     isLoading: boolean;
     tooManyFiles: boolean;
-    onUploadDataClick: () => void;
+    onUploadDataClick: (targetLocation?: string) => void;
     onSearchChange: (searchValue: string) => void;
     onItemMenuOpen: (event: React.MouseEvent<HTMLElement>, item: TreeItem<FileTreeData>, isWritable: boolean) => void;
     onOptionsMenuOpen: (event: React.MouseEvent<HTMLElement>, isWritable: boolean) => void;
@@ -508,7 +508,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
                             className={classes.uploadButton}
                             data-cy='upload-button'
                             onClick={() => {
-                                onUploadDataClick();
+                                onUploadDataClick(rightKey === leftKey ? undefined : rightKey);
                             }}
                             variant='contained'
                             color='primary'