[ARVADOS-WORKBENCH2] updated: 1.1.4-713-gdd30e03

Git user git at public.curoverse.com
Tue Aug 21 08:35:14 EDT 2018


Summary of changes:
 .env                                               |   1 -
 src/common/config.ts                               | 102 ++++++++++++++++++---
 .../project-copy.tsx}                              |  32 ++++---
 src/components/tree/tree.test.tsx                  |  10 +-
 src/components/tree/tree.tsx                       |   8 +-
 src/index.tsx                                      |   4 +-
 src/services/services.ts                           |   6 +-
 src/store/auth/auth-actions.test.ts                |   7 +-
 src/store/auth/auth-reducer.test.ts                |   3 +-
 .../collection-panel-files-actions.ts              |   6 +-
 .../move-collection-dialog.ts                      |   2 +
 .../move-project-dialog/move-project-dialog.ts     |   2 +
 .../project-tree-picker-actions.ts                 |  46 ++++++++++
 src/store/tree-picker/tree-picker-actions.ts       |   3 +-
 src/store/tree-picker/tree-picker-reducer.ts       |  10 +-
 src/validators/validators.tsx                      |   5 +-
 .../action-sets/collection-action-set.ts           |   3 +-
 .../action-sets/collection-resource-action-set.ts  |   5 +-
 .../context-menu/action-sets/project-action-set.ts |  10 +-
 .../create-collection-dialog-with-selected.tsx     |   2 +
 .../project-copy-dialog/project-copy-dialog.tsx    |  29 ++++++
 .../project-tree-picker/project-tree-picker.tsx    |  28 ------
 src/views/collection-panel/collection-panel.tsx    |  18 +++-
 src/views/workbench/workbench.tsx                  |   2 +
 24 files changed, 261 insertions(+), 83 deletions(-)
 copy src/components/{move-to-dialog/move-to-dialog.tsx => project-copy/project-copy.tsx} (61%)
 create mode 100644 src/store/project-tree-picker/project-tree-picker-actions.ts
 create mode 100644 src/views-components/project-copy-dialog/project-copy-dialog.tsx

       via  dd30e03643f9b093c1fe05b05481f75906faa0e7 (commit)
       via  5607033651dbfd135a49ac5af65def77269f7a7d (commit)
       via  90df34ba0e84b5735c48382362284b5f0382dd0e (commit)
       via  c067c93c2159b21980551e2d87ebb10f985cba84 (commit)
       via  a1310aae9f24935feae463542e9bfde298a5d9e4 (commit)
       via  da38a12dc33bcab311dcb73153b2ebf3483d2a60 (commit)
       via  7e52071485e119755819308658d10e461ed1c28a (commit)
       via  b12a180cf035192be3e22dfa5a2200d4969ce51a (commit)
       via  ad819c323f1623d357398e3b1344e0a8f1d38366 (commit)
       via  838af71bfe460c7f5a03121acf8a4d239893cdac (commit)
       via  d6a65f155ca546aea3a777e73076c2c80f2c88cc (commit)
       via  8d493281629ff304711a1175f59f6d477ae510e2 (commit)
       via  e2396eed71c581a862a151a8acd00abaae76a5e9 (commit)
       via  964b7f2cea81f087bbaddc94c9eeb08bab945742 (commit)
      from  1700eb6123c054b185034c420d69ac41e2a749e6 (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 dd30e03643f9b093c1fe05b05481f75906faa0e7
Merge: 1700eb6 5607033
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Tue Aug 21 14:35:00 2018 +0200

    Merge branch 'master'
    
    Feature #13831
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --cc src/store/move-collection-dialog/move-collection-dialog.ts
index 375f2e2,0000000..5950679
mode 100644,000000..100644
--- a/src/store/move-collection-dialog/move-collection-dialog.ts
+++ b/src/store/move-collection-dialog/move-collection-dialog.ts
@@@ -1,41 -1,0 +1,43 @@@
 +// Copyright (C) The Arvados Authors. All rights reserved.
 +//
 +// SPDX-License-Identifier: AGPL-3.0
 +
 +import { Dispatch } from "redux";
 +import { dialogActions } from "~/store/dialog/dialog-actions";
 +import { startSubmit, stopSubmit, initialize } from 'redux-form';
 +import { ServiceRepository } from '~/services/services';
 +import { RootState } from '~/store/store';
 +import { getCommonResourceServiceError, CommonResourceServiceError } from "~/common/api/common-resource-service";
 +import { snackbarActions } from '~/store/snackbar/snackbar-actions';
 +import { projectPanelActions } from '~/store/project-panel/project-panel-action';
 +import { MoveToFormDialogData } from '../move-to-dialog/move-to-dialog';
++import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree-picker-actions';
 +
 +export const MOVE_COLLECTION_DIALOG = 'moveCollectionDialog';
 +
 +export const openMoveCollectionDialog = (resource: { name: string, uuid: string }) =>
 +    (dispatch: Dispatch) => {
++        dispatch<any>(resetPickerProjectTree());
 +        dispatch(initialize(MOVE_COLLECTION_DIALOG, resource));
 +        dispatch(dialogActions.OPEN_DIALOG({ id: MOVE_COLLECTION_DIALOG, data: {} }));
 +    };
 +
 +export const moveCollection = (resource: MoveToFormDialogData) =>
 +    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 +        dispatch(startSubmit(MOVE_COLLECTION_DIALOG));
 +        try {
 +            const collection = await services.collectionService.get(resource.uuid);
 +            await services.collectionService.update(resource.uuid, { ...collection, ownerUuid: resource.ownerUuid });
 +            dispatch(projectPanelActions.REQUEST_ITEMS());
 +            dispatch(dialogActions.CLOSE_DIALOG({ id: MOVE_COLLECTION_DIALOG }));
 +            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection has been moved', hideDuration: 2000 }));
 +        } catch (e) {
 +            const error = getCommonResourceServiceError(e);
 +            if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
 +                dispatch(stopSubmit(MOVE_COLLECTION_DIALOG, { ownerUuid: 'A collection with the same name already exists in the target project.' }));
 +            } else {
 +                dispatch(dialogActions.CLOSE_DIALOG({ id: MOVE_COLLECTION_DIALOG }));
 +                dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not move the collection.', hideDuration: 2000 }));
 +            }
 +        }
 +    };
diff --cc src/store/move-project-dialog/move-project-dialog.ts
index 797707f,0000000..51d40f7
mode 100644,000000..100644
--- a/src/store/move-project-dialog/move-project-dialog.ts
+++ b/src/store/move-project-dialog/move-project-dialog.ts
@@@ -1,46 -1,0 +1,48 @@@
 +// Copyright (C) The Arvados Authors. All rights reserved.
 +//
 +// SPDX-License-Identifier: AGPL-3.0
 +
 +import { Dispatch } from "redux";
 +import { dialogActions } from "~/store/dialog/dialog-actions";
 +import { startSubmit, stopSubmit, initialize } from 'redux-form';
 +import { ServiceRepository } from '~/services/services';
 +import { RootState } from '~/store/store';
 +import { getCommonResourceServiceError, CommonResourceServiceError } from "~/common/api/common-resource-service";
 +import { snackbarActions } from '~/store/snackbar/snackbar-actions';
 +import { projectPanelActions } from '~/store/project-panel/project-panel-action';
 +import { getProjectList } from '~/store/project/project-action';
 +import { MoveToFormDialogData } from '../move-to-dialog/move-to-dialog';
++import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree-picker-actions';
 +
 +export const MOVE_PROJECT_DIALOG = 'moveProjectDialog';
 +
 +export const openMoveProjectDialog = (resource: { name: string, uuid: string }) =>
 +    (dispatch: Dispatch) => {
++        dispatch<any>(resetPickerProjectTree());
 +        dispatch(initialize(MOVE_PROJECT_DIALOG, resource));
 +        dispatch(dialogActions.OPEN_DIALOG({ id: MOVE_PROJECT_DIALOG, data: {} }));
 +    };
 +
 +export const moveProject = (resource: MoveToFormDialogData) =>
 +    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 +        dispatch(startSubmit(MOVE_PROJECT_DIALOG));
 +        try {
 +            const project = await services.projectService.get(resource.uuid);
 +            await services.projectService.update(resource.uuid, { ...project, ownerUuid: resource.ownerUuid });
 +            dispatch(projectPanelActions.REQUEST_ITEMS());
 +            dispatch<any>(getProjectList(project.ownerUuid));
 +            dispatch<any>(getProjectList(resource.ownerUuid));
 +            dispatch(dialogActions.CLOSE_DIALOG({ id: MOVE_PROJECT_DIALOG }));
 +            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Project has been moved', hideDuration: 2000 }));
 +        } catch (e) {
 +            const error = getCommonResourceServiceError(e);
 +            if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
 +                dispatch(stopSubmit(MOVE_PROJECT_DIALOG, { ownerUuid: 'A project with the same name already exists in the target project.' }));
 +            } else if (error === CommonResourceServiceError.OWNERSHIP_CYCLE) {
 +                dispatch(stopSubmit(MOVE_PROJECT_DIALOG, { ownerUuid: 'Cannot move a project into itself.' }));
 +            } else {
 +                dispatch(dialogActions.CLOSE_DIALOG({ id: MOVE_PROJECT_DIALOG }));
 +                dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not move the project.', hideDuration: 2000 }));
 +            }
 +        }
 +    };
diff --cc src/views-components/context-menu/action-sets/collection-action-set.ts
index 7b1c4d5,7d49e34..5fb4f2d
--- 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,8 +8,8 @@@ import { toggleFavorite } from "~/store
  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 { openMoveCollectionDialog } from '~/store/move-collection-dialog/move-collection-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 = [[
      {
diff --cc src/views-components/context-menu/action-sets/collection-resource-action-set.ts
index 3866cc0,056ea7b..ab93f6b
--- 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,8 +8,8 @@@ import { toggleFavorite } from "~/store
  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 { openMoveCollectionDialog } from '~/store/move-collection-dialog/move-collection-dialog';
+ import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
 -import { openMoveToDialog } from "~/views-components/move-to-dialog/move-to-dialog";
  
  export const collectionResourceActionSet: ContextMenuActionSet = [[
      {
diff --cc src/views-components/context-menu/action-sets/project-action-set.ts
index 2f1f05e,e5db66d..01e6004
--- a/src/views-components/context-menu/action-sets/project-action-set.ts
+++ b/src/views-components/context-menu/action-sets/project-action-set.ts
@@@ -10,8 -10,9 +10,9 @@@ import { NewProjectIcon, RenameIcon, Co
  import { ToggleFavoriteAction } from "../actions/favorite-action";
  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 { openMoveProjectDialog } from '~/store/move-project-dialog/move-project-dialog';
+ import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
  
  export const projectActionSet: ContextMenuActionSet = [[
      {
@@@ -41,6 -42,13 +42,13 @@@
      {
          icon: MoveToIcon,
          name: "Move to",
 -        execute: dispatch => dispatch<any>(openMoveToDialog())       
 +        execute: (dispatch, resource) => dispatch<any>(openMoveProjectDialog(resource))
      },
+     {
+         icon: CopyIcon,
+         name: "Copy to project",
+         execute: (dispatch, resource) => {
+             dispatch<any>(openProjectCopyDialog({name: resource.name, projectUuid: resource.uuid}));
+         }
+     }
  ]];
diff --cc src/views/workbench/workbench.tsx
index eba11d2,f5f62a2..ed11eb1
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@@ -50,9 -50,9 +50,10 @@@ import { DialogCollectionCreateWithSele
  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 { ProjectCopyDialog } from '~/views-components/project-copy-dialog/project-copy-dialog';
  import { CollectionPartialCopyDialog } from '../../views-components/collection-partial-copy-dialog/collection-partial-copy-dialog';
 +import { MoveProjectDialog } from '~/views-components/move-project-dialog/move-project-dialog';
 +import { MoveCollectionDialog } from '~/views-components/move-collection-dialog/move-collection-dialog';
  
  const DRAWER_WITDH = 240;
  const APP_BAR_HEIGHT = 100;
@@@ -247,8 -247,10 +248,9 @@@ export const Workbench = withStyles(sty
                          <CreateCollectionDialog />
                          <RenameFileDialog />
                          <CollectionPartialCopyDialog />
 -                        <MoveToProjectDialog />
                          <DialogCollectionCreateWithSelectedFile />
                          <FileRemoveDialog />
+                         <ProjectCopyDialog />
                          <MultipleFilesRemoveDialog />
                          <UpdateCollectionDialog />
                          <UploadCollectionFilesDialog />

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list