[ARVADOS-WORKBENCH2] updated: 1.1.4-688-gad819c3

Git user git at public.curoverse.com
Tue Aug 21 06:01:58 EDT 2018


Summary of changes:
 .../project-copy.tsx}                              |  7 +++---
 src/components/tree/tree.test.tsx                  | 10 ++++----
 src/components/tree/tree.tsx                       |  8 ++++--
 src/index.tsx                                      |  4 +--
 .../collection-panel-files-actions.ts              |  6 ++---
 .../action-sets/collection-action-set.ts           |  4 +--
 .../action-sets/collection-resource-action-set.ts  |  4 +--
 .../context-menu/action-sets/project-action-set.ts |  4 +--
 .../make-a-copy-dialog/make-a-copy-dialog.tsx      | 28 ---------------------
 .../project-copy-dialog/project-copy-dialog.tsx    | 29 ++++++++++++++++++++++
 src/views/workbench/workbench.tsx                  |  4 +--
 11 files changed, 56 insertions(+), 52 deletions(-)
 rename src/components/{make-a-copy/make-a-copy.tsx => project-copy/project-copy.tsx} (88%)
 delete mode 100644 src/views-components/make-a-copy-dialog/make-a-copy-dialog.tsx
 create mode 100644 src/views-components/project-copy-dialog/project-copy-dialog.tsx

       via  ad819c323f1623d357398e3b1344e0a8f1d38366 (commit)
      from  838af71bfe460c7f5a03121acf8a4d239893cdac (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 ad819c323f1623d357398e3b1344e0a8f1d38366
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Tue Aug 21 12:01:44 2018 +0200

    cr changes
    
    Feature #13988
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/components/make-a-copy/make-a-copy.tsx b/src/components/project-copy/project-copy.tsx
similarity index 88%
rename from src/components/make-a-copy/make-a-copy.tsx
rename to src/components/project-copy/project-copy.tsx
index f1098ff..34c8e6d 100644
--- a/src/components/make-a-copy/make-a-copy.tsx
+++ b/src/components/project-copy/project-copy.tsx
@@ -15,7 +15,7 @@ export interface CopyFormData {
     uuid: string;
 }
 
-export const MakeACopyDialog = (props: WithDialogProps<string> & InjectedFormProps<CopyFormData>) =>
+export const ProjectCopy = (props: WithDialogProps<string> & InjectedFormProps<CopyFormData>) =>
     <form>
         <Dialog open={props.open}
             disableBackdropClick={true}
@@ -46,8 +46,9 @@ export const MakeACopyDialog = (props: WithDialogProps<string> & InjectedFormPro
                     type='submit'
                     onClick={props.handleSubmit}
                     disabled={props.pristine || props.invalid || props.submitting}>
-                    {props.submitting ? <CircularProgress size={20} /> : 'Copy'}
-                </Button>
+                    {props.submitting && <CircularProgress size={20} style={{position: 'absolute'}}/>}
+                    Copy
+                </Button>                
             </DialogActions>
         </Dialog>
     </form>;
diff --git a/src/components/tree/tree.test.tsx b/src/components/tree/tree.test.tsx
index 45981d8..50d1368 100644
--- a/src/components/tree/tree.test.tsx
+++ b/src/components/tree/tree.test.tsx
@@ -7,7 +7,7 @@ import * as Enzyme from 'enzyme';
 import * as Adapter from 'enzyme-adapter-react-16';
 import ListItem from "@material-ui/core/ListItem/ListItem";
 
-import { Tree, TreeItem } from './tree';
+import { Tree, TreeItem, TreeItemStatus } from './tree';
 import { ProjectResource } from '../../models/project';
 import { mockProjectResource } from '../../models/test-utils';
 import { Checkbox } from '@material-ui/core';
@@ -22,7 +22,7 @@ describe("Tree component", () => {
             id: "3",
             open: true,
             active: true,
-            status: 1,
+            status: TreeItemStatus.LOADED
         };
         const wrapper = mount(<Tree
             render={project => <div />}
@@ -39,7 +39,7 @@ describe("Tree component", () => {
             id: "3",
             open: true,
             active: true,
-            status: 1,
+            status: TreeItemStatus.LOADED,
         };
         const wrapper = mount(<Tree
             render={project => <div />}
@@ -56,7 +56,7 @@ describe("Tree component", () => {
             id: "3",
             open: true,
             active: true,
-            status: 1,
+            status: TreeItemStatus.LOADED
         };
         const wrapper = mount(<Tree
             showSelection={true}
@@ -74,7 +74,7 @@ describe("Tree component", () => {
             id: "3",
             open: true,
             active: true,
-            status: 1,
+            status: TreeItemStatus.LOADED,
         };
         const spy = jest.fn();
         const onSelectionChanged = (event: any, item: TreeItem<any>) => spy(item);
diff --git a/src/components/tree/tree.tsx b/src/components/tree/tree.tsx
index 8a56739..8d657f8 100644
--- a/src/components/tree/tree.tsx
+++ b/src/components/tree/tree.tsx
@@ -141,9 +141,13 @@ export const Tree = withStyles(styles)(
         }
 
         getProperArrowAnimation = (status: string, items: Array<TreeItem<T>>) => {
+            return this.isSidePanelIconNotNeeded(status, items) ? <span /> : <SidePanelRightArrowIcon />;
+        }
+
+        isSidePanelIconNotNeeded = (status: string, items: Array<TreeItem<T>>) => {
             return status === TreeItemStatus.PENDING ||
-            (status === TreeItemStatus.LOADED && !items) || 
-            (status === TreeItemStatus.LOADED && items && items.length === 0) ? <span /> : <SidePanelRightArrowIcon />;
+                (status === TreeItemStatus.LOADED && !items) ||
+                (status === TreeItemStatus.LOADED && items && items.length === 0);
         }
 
         getToggableIconClassNames = (isOpen?: boolean, isActive?: boolean) => {
diff --git a/src/index.tsx b/src/index.tsx
index f5b1464..b368d3f 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -27,7 +27,6 @@ import { collectionFilesActionSet } from './views-components/context-menu/action
 import { collectionFilesItemActionSet } from './views-components/context-menu/action-sets/collection-files-item-action-set';
 import { collectionActionSet } from './views-components/context-menu/action-sets/collection-action-set';
 import { collectionResourceActionSet } from './views-components/context-menu/action-sets/collection-resource-action-set';
-import { initPickerProjectTree } from './store/project-tree-picker/project-tree-picker-actions';
 
 const getBuildNumber = () => "BN-" + (process.env.BUILD_NUMBER || "dev");
 const getGitCommit = () => "GIT-" + (process.env.GIT_COMMIT || "latest").substr(0, 7);
@@ -53,8 +52,7 @@ fetchConfig()
         const store = configureStore(history, services);
 
         store.dispatch(initAuth());
-        store.dispatch(getProjectList(services.authService.getUuid()));
-        store.dispatch(initPickerProjectTree());    
+        store.dispatch(getProjectList(services.authService.getUuid()));  
 
         const TokenComponent = (props: any) => <ApiToken authService={services.authService} {...props}/>;
         const WorkbenchComponent = (props: any) => <Workbench authService={services.authService} buildInfo={buildInfo} {...props}/>;
diff --git a/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts b/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
index e7a7ec8..3ad753f 100644
--- a/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
+++ b/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
@@ -11,9 +11,9 @@ import { snackbarActions } from "../../snackbar/snackbar-actions";
 import { dialogActions } from '../../dialog/dialog-actions';
 import { getNodeValue } from "~/models/tree";
 import { filterCollectionFilesBySelection } from './collection-panel-files-state';
-import { startSubmit, initialize, SubmissionError, stopSubmit } from 'redux-form';
-import { loadProjectTreePickerProjects } from '../../../views-components/project-tree-picker/project-tree-picker';
+import { startSubmit, initialize, stopSubmit } from 'redux-form';
 import { getCommonResourceServiceError, CommonResourceServiceError } from "~/common/api/common-resource-service";
+import { resetPickerProjectTree } from '../../project-tree-picker/project-tree-picker-actions';
 
 export const collectionPanelFilesAction = unionize({
     SET_COLLECTION_FILES: ofType<CollectionFilesTree>(),
@@ -103,7 +103,7 @@ export const openCollectionPartialCopyDialog = () =>
                 projectUuid: ''
             };
             dispatch(initialize(COLLECTION_PARTIAL_COPY, initialData));
-            dispatch<any>(loadProjectTreePickerProjects(''));
+            dispatch<any>(resetPickerProjectTree());
             dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_PARTIAL_COPY, data: {} }));
         }
     };
diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts
index 0f0125c..7d49e34 100644
--- a/src/views-components/context-menu/action-sets/collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-action-set.ts
@@ -8,7 +8,7 @@ import { toggleFavorite } from "~/store/favorites/favorites-actions";
 import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RemoveIcon } from "~/components/icon/icon";
 import { openUpdater } from "~/store/collections/updater/collection-updater-action";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
-import { openMakeACopyDialog } from "~/views-components/make-a-copy-dialog/make-a-copy-dialog";
+import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
 import { openMoveToDialog } from "../../move-to-dialog/move-to-dialog";
 
 export const collectionActionSet: ContextMenuActionSet = [[
@@ -43,7 +43,7 @@ export const collectionActionSet: ContextMenuActionSet = [[
         icon: CopyIcon,
         name: "Copy to project",
         execute: (dispatch, resource) => {
-            dispatch<any>(openMakeACopyDialog({name: resource.name, projectUuid: resource.uuid}));
+            dispatch<any>(openProjectCopyDialog({name: resource.name, projectUuid: resource.uuid}));
         }
     },
     {
diff --git a/src/views-components/context-menu/action-sets/collection-resource-action-set.ts b/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
index cf05aee..f988ee2 100644
--- a/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
@@ -8,7 +8,7 @@ import { toggleFavorite } from "~/store/favorites/favorites-actions";
 import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
 import { openUpdater } from "~/store/collections/updater/collection-updater-action";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
-import { openMakeACopyDialog } from "~/views-components/make-a-copy-dialog/make-a-copy-dialog";
+import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
 import { openMoveToDialog } from '../../move-to-dialog/move-to-dialog';
 
 export const collectionResourceActionSet: ContextMenuActionSet = [[
@@ -43,7 +43,7 @@ export const collectionResourceActionSet: ContextMenuActionSet = [[
         icon: CopyIcon,
         name: "Copy to project",
         execute: (dispatch, resource) => {
-            dispatch<any>(openMakeACopyDialog({name: resource.name, projectUuid: resource.uuid}));
+            dispatch<any>(openProjectCopyDialog({name: resource.name, projectUuid: resource.uuid}));
         },
     },
     {
diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts
index f7fc4f5..e5db66d 100644
--- a/src/views-components/context-menu/action-sets/project-action-set.ts
+++ b/src/views-components/context-menu/action-sets/project-action-set.ts
@@ -12,7 +12,7 @@ import { toggleFavorite } from "~/store/favorites/favorites-actions";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 import { openMoveToDialog } from "../../move-to-dialog/move-to-dialog";
 import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
-import { openMakeACopyDialog } from "~/views-components/make-a-copy-dialog/make-a-copy-dialog";
+import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
 
 export const projectActionSet: ContextMenuActionSet = [[
     {
@@ -48,7 +48,7 @@ export const projectActionSet: ContextMenuActionSet = [[
         icon: CopyIcon,
         name: "Copy to project",
         execute: (dispatch, resource) => {
-            dispatch<any>(openMakeACopyDialog({name: resource.name, projectUuid: resource.uuid}));
+            dispatch<any>(openProjectCopyDialog({name: resource.name, projectUuid: resource.uuid}));
         }
     }
 ]];
diff --git a/src/views-components/make-a-copy-dialog/make-a-copy-dialog.tsx b/src/views-components/make-a-copy-dialog/make-a-copy-dialog.tsx
deleted file mode 100644
index 8dd19d9..0000000
--- a/src/views-components/make-a-copy-dialog/make-a-copy-dialog.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-import { Dispatch, compose } from "redux";
-import { withDialog } from "../../store/dialog/with-dialog";
-import { dialogActions } from "../../store/dialog/dialog-actions";
-import { MakeACopyDialog, CopyFormData } from "../../components/make-a-copy/make-a-copy";
-import { reduxForm, startSubmit, stopSubmit, initialize } from 'redux-form';
-import { resetPickerProjectTree } from "~/store/project-tree-picker/project-tree-picker-actions";
-
-export const MAKE_A_COPY_DIALOG = 'makeACopyDialog';
-export const openMakeACopyDialog = (data: {projectUuid: string, name: string}) =>
-    (dispatch: Dispatch) => {
-        dispatch<any>(resetPickerProjectTree());
-        const initialData: CopyFormData = {name: "Copy of: " + data.name, projectUuid: '', uuid: data.projectUuid};
-        dispatch<any>(initialize(MAKE_A_COPY_DIALOG, initialData));
-        dispatch(dialogActions.OPEN_DIALOG({ id: MAKE_A_COPY_DIALOG, data: {} }));
-    };
-export const MakeACopyToProjectDialog = compose(
-    withDialog(MAKE_A_COPY_DIALOG),
-    reduxForm({
-        form: MAKE_A_COPY_DIALOG,
-        onSubmit: (data, dispatch) => {
-            dispatch(startSubmit(MAKE_A_COPY_DIALOG));
-            setTimeout(() => dispatch(stopSubmit(MAKE_A_COPY_DIALOG, { name: 'Invalid path' })), 2000);
-        }
-    })
-)(MakeACopyDialog);
\ No newline at end of file
diff --git a/src/views-components/project-copy-dialog/project-copy-dialog.tsx b/src/views-components/project-copy-dialog/project-copy-dialog.tsx
new file mode 100644
index 0000000..489e4f5
--- /dev/null
+++ b/src/views-components/project-copy-dialog/project-copy-dialog.tsx
@@ -0,0 +1,29 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+import { Dispatch, compose } from "redux";
+import { withDialog } from "../../store/dialog/with-dialog";
+import { dialogActions } from "../../store/dialog/dialog-actions";
+import { ProjectCopy, CopyFormData } from "../../components/project-copy/project-copy";
+import { reduxForm, startSubmit, stopSubmit, initialize } from 'redux-form';
+import { resetPickerProjectTree } from "~/store/project-tree-picker/project-tree-picker-actions";
+
+export const PROJECT_COPY_DIALOG = 'projectCopy';
+export const openProjectCopyDialog = (data: { projectUuid: string, name: string }) =>
+    (dispatch: Dispatch) => {
+        dispatch<any>(resetPickerProjectTree());
+        const initialData: CopyFormData = { name: `Copy of: ${data.name}`, projectUuid: '', uuid: data.projectUuid };
+        dispatch<any>(initialize(PROJECT_COPY_DIALOG, initialData));
+        dispatch(dialogActions.OPEN_DIALOG({ id: PROJECT_COPY_DIALOG, data: {} }));
+    };
+
+export const ProjectCopyDialog = compose(
+    withDialog(PROJECT_COPY_DIALOG),
+    reduxForm({
+        form: PROJECT_COPY_DIALOG,
+        onSubmit: (data, dispatch) => {
+            dispatch(startSubmit(PROJECT_COPY_DIALOG));
+            setTimeout(() => dispatch(stopSubmit(PROJECT_COPY_DIALOG, { name: 'Invalid path' })), 2000);
+        }
+    })
+)(ProjectCopy);
\ No newline at end of file
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index d84119e..f5f62a2 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -51,7 +51,7 @@ import { MoveToProjectDialog } from '../../views-components/move-to-dialog/move-
 import { COLLECTION_CREATE_DIALOG } from '~/views-components/dialog-create/dialog-collection-create';
 import { PROJECT_CREATE_DIALOG } from '~/views-components/dialog-create/dialog-project-create';
 import { UploadCollectionFilesDialog } from '~/views-components/upload-collection-files-dialog/upload-collection-files-dialog';
-import { MakeACopyToProjectDialog } from '~/views-components/make-a-copy-dialog/make-a-copy-dialog';
+import { ProjectCopyDialog } from '~/views-components/project-copy-dialog/project-copy-dialog';
 import { CollectionPartialCopyDialog } from '../../views-components/collection-partial-copy-dialog/collection-partial-copy-dialog';
 
 const DRAWER_WITDH = 240;
@@ -250,7 +250,7 @@ export const Workbench = withStyles(styles)(
                         <MoveToProjectDialog />
                         <DialogCollectionCreateWithSelectedFile />
                         <FileRemoveDialog />
-                        <MakeACopyToProjectDialog />
+                        <ProjectCopyDialog />
                         <MultipleFilesRemoveDialog />
                         <UpdateCollectionDialog />
                         <UploadCollectionFilesDialog />

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list