[ARVADOS-WORKBENCH2] created: 1.4.1-451-g9f217a47

Git user git at public.arvados.org
Mon Oct 5 18:53:48 UTC 2020


        at  9f217a47500e8187e4e4e205d1ecd622664595e2 (commit)


commit 9f217a47500e8187e4e4e205d1ecd622664595e2
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Oct 5 14:53:20 2020 -0400

    16130: Remove "copy process"
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/src/store/processes/process-copy-actions.ts b/src/store/processes/process-copy-actions.ts
deleted file mode 100644
index 729d6a13..00000000
--- a/src/store/processes/process-copy-actions.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-// 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 { initialize, startSubmit } from 'redux-form';
-import { resetPickerProjectTree } from '~/store/project-tree-picker/project-tree-picker-actions';
-import { RootState } from '~/store/store';
-import { ServiceRepository } from '~/services/services';
-import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog';
-import { getProcess } from '~/store/processes/process';
-import {snackbarActions, SnackbarKind} from '~/store/snackbar/snackbar-actions';
-import { initProjectsTreePicker } from '~/store/tree-picker/tree-picker-actions';
-
-export const PROCESS_COPY_FORM_NAME = 'processCopyFormName';
-
-export const openCopyProcessDialog = (resource: { name: string, uuid: string }) =>
-    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const process = getProcess(resource.uuid)(getState().resources);
-        if (process) {
-            dispatch<any>(resetPickerProjectTree());
-            dispatch<any>(initProjectsTreePicker(PROCESS_COPY_FORM_NAME));
-            const initialData: CopyFormDialogData = { name: `Copy of: ${resource.name}`, uuid: resource.uuid, ownerUuid: '' };
-            dispatch<any>(initialize(PROCESS_COPY_FORM_NAME, initialData));
-            dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_COPY_FORM_NAME, data: {} }));
-        } else {
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process not found', hideDuration: 2000, kind: SnackbarKind.ERROR }));
-        }
-    };
-
-export const copyProcess = (resource: CopyFormDialogData) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        dispatch(startSubmit(PROCESS_COPY_FORM_NAME));
-        try {
-            const process = await services.containerRequestService.get(resource.uuid);
-            const { kind, containerImage, outputPath, outputName, containerCountMax, command, properties, requestingContainerUuid, mounts, runtimeConstraints, schedulingParameters, environment, cwd, outputTtl, priority, expiresAt, useExisting, filters } = process;
-            await services.containerRequestService.create({ command, containerImage, outputPath, ownerUuid: resource.ownerUuid, name: resource.name, kind, outputName, containerCountMax, properties, requestingContainerUuid, mounts, runtimeConstraints, schedulingParameters, environment, cwd, outputTtl, priority, expiresAt, useExisting, filters });
-            dispatch(dialogActions.CLOSE_DIALOG({ id: PROCESS_COPY_FORM_NAME }));
-            return process;
-        } catch (e) {
-            dispatch(dialogActions.CLOSE_DIALOG({ id: PROCESS_COPY_FORM_NAME }));
-            throw new Error('Could not copy the process.');
-        }
-    };
\ No newline at end of file
diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index 944c48cf..c2bd791c 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -47,7 +47,6 @@ import * as collectionMoveActions from '~/store/collections/collection-move-acti
 import * as processesActions from '~/store/processes/processes-actions';
 import * as processMoveActions from '~/store/processes/process-move-actions';
 import * as processUpdateActions from '~/store/processes/process-update-actions';
-import * as processCopyActions from '~/store/processes/process-copy-actions';
 import { trashPanelColumns } from "~/views/trash-panel/trash-panel";
 import { loadTrashPanel, trashPanelActions } from "~/store/trash-panel/trash-panel-action";
 import { initProcessLogsPanel } from '~/store/process-logs-panel/process-logs-panel-actions';
@@ -412,18 +411,6 @@ export const moveProcess = (data: MoveToFormDialogData) =>
         }
     };
 
-export const copyProcess = (data: CopyFormDialogData) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        try {
-            const process = await dispatch<any>(processCopyActions.copyProcess(data));
-            dispatch<any>(updateResources([process]));
-            dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process has been copied.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
-        } catch (e) {
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000, kind: SnackbarKind.ERROR }));
-        }
-    };
-
 export const loadProcessLog = (uuid: string) =>
     handleFirstTimeLoad(
         async (dispatch: Dispatch) => {
diff --git a/src/views-components/context-menu/action-sets/process-action-set.ts b/src/views-components/context-menu/action-sets/process-action-set.ts
index ae276094..f4ae55a8 100644
--- a/src/views-components/context-menu/action-sets/process-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-action-set.ts
@@ -6,14 +6,13 @@ import { ContextMenuActionSet } from "~/views-components/context-menu/context-me
 import { ToggleFavoriteAction } from "~/views-components/context-menu/actions/favorite-action";
 import { toggleFavorite } from "~/store/favorites/favorites-actions";
 import {
-    RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon,
+    RenameIcon, ShareIcon, MoveToIcon, DetailsIcon,
     AdvancedIcon, RemoveIcon, ReRunProcessIcon, LogIcon, InputIcon, CommandIcon, OutputIcon
 } from "~/components/icon/icon";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 import { navigateToProcessLogs } from '~/store/navigation/navigation-action';
 import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
-import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
 import { openProcessCommandDialog } from '~/store/processes/process-command-actions';
 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
 import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
@@ -53,23 +52,16 @@ export const processActionSet: ContextMenuActionSet = [[
             dispatch<any>(openMoveProcessDialog(resource));
         }
     },
-    {
-        icon: CopyIcon,
-        name: "Copy to project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCopyProcessDialog(resource));
-        }
-    },
     {
         icon: ReRunProcessIcon,
         name: "Re-run process",
         execute: (dispatch, resource) => {
-            if(resource.workflowUuid) {
+            if (resource.workflowUuid) {
                 dispatch<any>(reRunProcess(resource.uuid, resource.workflowUuid));
             } else {
                 dispatch(snackbarActions.OPEN_SNACKBAR({ message: `You can't re-run this process`, hideDuration: 2000, kind: SnackbarKind.ERROR }));
-            }        
-        }        
+            }
+        }
     },
     {
         icon: InputIcon,
@@ -82,7 +74,7 @@ export const processActionSet: ContextMenuActionSet = [[
         icon: OutputIcon,
         name: "Outputs",
         execute: (dispatch, resource) => {
-            if(resource.outputUuid){
+            if (resource.outputUuid) {
                 dispatch<any>(navigateToOutput(resource.outputUuid));
             }
         }
diff --git a/src/views-components/context-menu/action-sets/process-resource-action-set.ts b/src/views-components/context-menu/action-sets/process-resource-action-set.ts
index 8cab9bfd..db7744ba 100644
--- a/src/views-components/context-menu/action-sets/process-resource-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-resource-action-set.ts
@@ -5,11 +5,10 @@
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { ToggleFavoriteAction } from "../actions/favorite-action";
 import { toggleFavorite } from "~/store/favorites/favorites-actions";
-import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
+import { RenameIcon, ShareIcon, MoveToIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
-import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
 import { openRemoveProcessDialog } from "~/store/processes/processes-actions";
 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
@@ -44,13 +43,6 @@ export const processResourceActionSet: ContextMenuActionSet = [[
             dispatch<any>(openMoveProcessDialog(resource));
         }
     },
-    {
-        icon: CopyIcon,
-        name: "Copy to project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCopyProcessDialog(resource));
-        }
-    },
     {
         icon: DetailsIcon,
         name: "View details",
diff --git a/src/views-components/context-menu/action-sets/process-resource-admin-action-set.ts b/src/views-components/context-menu/action-sets/process-resource-admin-action-set.ts
index 5bac51fb..3f00e807 100644
--- a/src/views-components/context-menu/action-sets/process-resource-admin-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-resource-admin-action-set.ts
@@ -5,11 +5,10 @@
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { ToggleFavoriteAction } from "../actions/favorite-action";
 import { toggleFavorite } from "~/store/favorites/favorites-actions";
-import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
+import { RenameIcon, ShareIcon, MoveToIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
-import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
 import { openRemoveProcessDialog } from "~/store/processes/processes-actions";
 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
@@ -55,13 +54,6 @@ export const processResourceAdminActionSet: ContextMenuActionSet = [[
             dispatch<any>(openMoveProcessDialog(resource));
         }
     },
-    {
-        icon: CopyIcon,
-        name: "Copy to project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCopyProcessDialog(resource));
-        }
-    },
     {
         icon: DetailsIcon,
         name: "View details",
diff --git a/src/views-components/dialog-forms/copy-process-dialog.ts b/src/views-components/dialog-forms/copy-process-dialog.ts
deleted file mode 100644
index 89d38f83..00000000
--- a/src/views-components/dialog-forms/copy-process-dialog.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { compose } from "redux";
-import { withDialog } from "~/store/dialog/with-dialog";
-import { reduxForm } from 'redux-form';
-import { PROCESS_COPY_FORM_NAME } from '~/store/processes/process-copy-actions';
-import { DialogCopy } from "~/views-components/dialog-copy/dialog-copy";
-import { copyProcess } from '~/store/workbench/workbench-actions';
-import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog';
-import { pickerId } from "~/store/tree-picker/picker-id";
-
-export const CopyProcessDialog = compose(
-    withDialog(PROCESS_COPY_FORM_NAME),
-    reduxForm<CopyFormDialogData>({
-        form: PROCESS_COPY_FORM_NAME,
-        onSubmit: (data, dispatch) => {
-            dispatch(copyProcess(data));
-        }
-    }),
-    pickerId(PROCESS_COPY_FORM_NAME),
-)(DialogCopy);
\ No newline at end of file
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index b0f90894..1cce2c2c 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -25,7 +25,6 @@ import { ChangeWorkflowDialog } from '~/views-components/run-process-dialog/chan
 import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog';
 import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog';
 import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog';
-import { CopyProcessDialog } from '~/views-components/dialog-forms/copy-process-dialog';
 import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog';
 import { UpdateProcessDialog } from '~/views-components/dialog-forms/update-process-dialog';
 import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog';
@@ -150,18 +149,18 @@ const saveSplitterSize = (size: number) => localStorage.setItem('splitterSize',
 export const WorkbenchPanel =
     withStyles(styles)((props: WorkbenchPanelProps) =>
         <Grid container item xs className={props.classes.root}>
-            { props.sessionIdleTimeout > 0 && <AutoLogout />}
+            {props.sessionIdleTimeout > 0 && <AutoLogout />}
             <Grid container item xs className={props.classes.container}>
                 <SplitterLayout customClassName={props.classes.splitter} percentage={true}
                     primaryIndex={0} primaryMinSize={10}
                     secondaryInitialSize={getSplitterInitialSize()} secondaryMinSize={40}
                     onSecondaryPaneSizeChange={saveSplitterSize}>
-                    { props.isUserActive && props.isNotLinking && <Grid container item xs component='aside' direction='column' className={props.classes.asidePanel}>
+                    {props.isUserActive && props.isNotLinking && <Grid container item xs component='aside' direction='column' className={props.classes.asidePanel}>
                         <SidePanel />
-                    </Grid> }
+                    </Grid>}
                     <Grid container item xs component="main" direction="column" className={props.classes.contentWrapper}>
                         <Grid item xs>
-                            { props.isNotLinking && <MainContentBar /> }
+                            {props.isNotLinking && <MainContentBar />}
                         </Grid>
                         <Grid item xs className={props.classes.content}>
                             <Switch>
@@ -212,7 +211,6 @@ export const WorkbenchPanel =
             <ChangeWorkflowDialog />
             <ContextMenu />
             <CopyCollectionDialog />
-            <CopyProcessDialog />
             <CreateCollectionDialog />
             <CreateGroupDialog />
             <CreateProjectDialog />

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list