[arvados-workbench2] updated: 2.6.0-73-g3b5ffa7c

git repository hosting git at public.arvados.org
Thu Aug 31 15:14:00 UTC 2023


Summary of changes:
 .../multiselectToolbar/MultiselectToolbar.tsx      |  17 ++-
 src/store/projects/project-move-actions.ts         |   4 +-
 src/store/workbench/workbench-actions.ts           | 133 +++++++++++++--------
 .../action-sets/collection-action-set.ts           |  85 +++++++------
 .../action-sets/process-resource-action-set.ts     |  74 ++++++------
 .../context-menu/action-sets/project-action-set.ts |   4 +-
 .../dialog-forms/move-project-dialog.ts            |  17 ++-
 7 files changed, 187 insertions(+), 147 deletions(-)

       via  3b5ffa7cf6d51c5842b3421b41804b925d6cde3f (commit)
       via  d8b1191390b3d56740f133b021936f352ca49d55 (commit)
      from  c68eb6b39deba5d850d1b0ba7b59ec42850d8cdb (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 3b5ffa7cf6d51c5842b3421b41804b925d6cde3f
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Thu Aug 31 11:13:52 2023 -0400

    15768: first stage of multimove propagation up Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/components/multiselectToolbar/MultiselectToolbar.tsx b/src/components/multiselectToolbar/MultiselectToolbar.tsx
index 47fd380e..85e6dd3a 100644
--- a/src/components/multiselectToolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselectToolbar/MultiselectToolbar.tsx
@@ -104,7 +104,7 @@ export function selectedToArray(checkedList: TCheckedList): Array<string> {
     return arrayifiedSelectedList;
 }
 
-function selectedToKindSet(checkedList: TCheckedList): Set<string> {
+export function selectedToKindSet(checkedList: TCheckedList): Set<string> {
     const setifiedList = new Set<string>();
     for (const [key, value] of Object.entries(checkedList)) {
         if (value === true) {
diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index 4d717c48..1517f34c 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -100,7 +100,7 @@ import { loadAllProcessesPanel, allProcessesPanelActions } from "../all-processe
 import { allProcessesPanelColumns } from "views/all-processes-panel/all-processes-panel";
 import { AdminMenuIcon } from "components/icon/icon";
 import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root";
-import { selectedToArray } from "components/multiselectToolbar/MultiselectToolbar";
+import { selectedToArray, selectedToKindSet } from "components/multiselectToolbar/MultiselectToolbar";
 
 export const WORKBENCH_LOADING_SCREEN = "workbenchLoadingScreen";
 
@@ -278,22 +278,39 @@ export const createProject = (data: projectCreateActions.ProjectCreateFormDialog
     }
 };
 
-export const moveProject = (data: MoveToFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-    const itemsToMove: string[] = selectedToArray(getState().multiselect.checkedList);
-    //if no items in checkedlist, default to normal context menu behavior
-    if (!itemsToMove.length) itemsToMove.push(data.uuid);
-    const sourceUuid = getResource(data.uuid)(getState().resources)?.ownerUuid;
-    const destinationUuid = data.ownerUuid;
+export const moveProject =
+    (data: MoveToFormDialogData, secondaryMoveKind: string = "") =>
+    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+        const checkedList = getState().multiselect.checkedList;
+        const uuidsToMove: string[] = selectedToArray(checkedList);
 
-    for (const uuid of itemsToMove) {
-        await moveSingleProject(uuid);
-    }
+        //if no items in checkedlist && no items passed in, default to normal context menu behavior
+        if (!secondaryMoveKind.length && !uuidsToMove.length) uuidsToMove.push(data.uuid);
 
-    async function moveSingleProject(uuid: string) {
-        const originalItem = getResource(uuid)(getState().resources) as Resource & { name: string };
-        if (originalItem.kind === ResourceKind.PROJECT) {
+        const sourceUuid = getResource(data.uuid)(getState().resources)?.ownerUuid;
+        const destinationUuid = data.ownerUuid;
+
+        const projectsToMove: MoveableResource[] = uuidsToMove
+            .map(uuid => getResource(uuid)(getState().resources) as MoveableResource)
+            .filter(resource => resource.kind === ResourceKind.PROJECT);
+
+        for (const project of projectsToMove) {
+            await moveSingleProject(project);
+        }
+
+        if (!secondaryMoveKind.length) {
+            const kindsToMove: Set<string> = selectedToKindSet(checkedList);
+            kindsToMove.delete(ResourceKind.PROJECT);
+
+            kindsToMove.forEach(kind => {
+                secondaryMove[kind](data, kind)(dispatch, getState, services);
+                console.log(secondaryMove[kind]);
+            });
+        }
+
+        async function moveSingleProject(project: MoveableResource) {
             try {
-                const oldProject: MoveToFormDialogData = { name: originalItem.name, uuid: originalItem.uuid, ownerUuid: data.ownerUuid };
+                const oldProject: MoveToFormDialogData = { name: project.name, uuid: project.uuid, ownerUuid: data.ownerUuid };
                 const oldOwnerUuid = oldProject ? oldProject.ownerUuid : "";
                 const movedProject = await dispatch<any>(projectMoveActions.moveProject(oldProject));
                 if (movedProject) {
@@ -314,12 +331,12 @@ export const moveProject = (data: MoveToFormDialogData) => async (dispatch: Disp
                         kind: SnackbarKind.ERROR,
                     })
                 );
+                // }
             }
         }
-    }
-    if (sourceUuid) await dispatch<any>(loadSidePanelTreeProjects(sourceUuid));
-    await dispatch<any>(loadSidePanelTreeProjects(destinationUuid));
-};
+        if (sourceUuid) await dispatch<any>(loadSidePanelTreeProjects(sourceUuid));
+        await dispatch<any>(loadSidePanelTreeProjects(destinationUuid));
+    };
 
 export const updateProject = (data: projectUpdateActions.ProjectUpdateFormDialogData) => async (dispatch: Dispatch) => {
     const updatedProject = await dispatch<any>(projectUpdateActions.updateProject(data));
@@ -434,42 +451,45 @@ export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dis
     }
 };
 
-export const moveCollection = (data: MoveToFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-    const itemsToMove: string[] = selectedToArray(getState().multiselect.checkedList);
-    //if no items in checkedlist, default to normal context menu behavior
-    if (!itemsToMove.length) itemsToMove.push(data.uuid);
+export const moveCollection =
+    (data: MoveToFormDialogData, secondaryMoveKind: string = "") =>
+    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+        console.log("MoveCollection?", data, secondaryMoveKind);
+        const itemsToMove: string[] = selectedToArray(getState().multiselect.checkedList);
+        //if no items in checkedlist, default to normal context menu behavior
+        if (!itemsToMove.length) itemsToMove.push(data.uuid);
 
-    for (const uuid of itemsToMove) {
-        await moveSingleCollection(uuid);
-    }
+        for (const uuid of itemsToMove) {
+            await moveSingleCollection(uuid);
+        }
 
-    async function moveSingleCollection(uuid: string) {
-        const originalItem = getResource(uuid)(getState().resources) as Resource & { name: string };
-        if (originalItem.kind === ResourceKind.COLLECTION) {
-            try {
-                const oldCollection: MoveToFormDialogData = { name: originalItem.name, uuid: originalItem.uuid, ownerUuid: data.ownerUuid };
-                const collection = await dispatch<any>(collectionMoveActions.moveCollection(oldCollection));
-                dispatch<any>(updateResources([collection]));
-                dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
-                dispatch(
-                    snackbarActions.OPEN_SNACKBAR({
-                        message: "Collection has been moved.",
-                        hideDuration: 2000,
-                        kind: SnackbarKind.SUCCESS,
-                    })
-                );
-            } catch (e) {
-                dispatch(
-                    snackbarActions.OPEN_SNACKBAR({
-                        message: e.message,
-                        hideDuration: 2000,
-                        kind: SnackbarKind.ERROR,
-                    })
-                );
+        async function moveSingleCollection(uuid: string) {
+            const originalItem = getResource(uuid)(getState().resources) as Resource & { name: string };
+            if (originalItem.kind === ResourceKind.COLLECTION) {
+                try {
+                    const oldCollection: MoveToFormDialogData = { name: originalItem.name, uuid: originalItem.uuid, ownerUuid: data.ownerUuid };
+                    const collection = await dispatch<any>(collectionMoveActions.moveCollection(oldCollection));
+                    dispatch<any>(updateResources([collection]));
+                    dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
+                    dispatch(
+                        snackbarActions.OPEN_SNACKBAR({
+                            message: "Collection has been moved.",
+                            hideDuration: 2000,
+                            kind: SnackbarKind.SUCCESS,
+                        })
+                    );
+                } catch (e) {
+                    dispatch(
+                        snackbarActions.OPEN_SNACKBAR({
+                            message: e.message,
+                            hideDuration: 2000,
+                            kind: SnackbarKind.ERROR,
+                        })
+                    );
+                }
             }
         }
-    }
-};
+    };
 
 export const loadProcess = (uuid: string) =>
     handleFirstTimeLoad(async (dispatch: Dispatch, getState: () => RootState) => {
@@ -764,3 +784,16 @@ const groupContentsHandlersRecord = {
 const groupContentsHandlers = unionize(groupContentsHandlersRecord);
 
 type GroupContentsHandler = UnionOf<typeof groupContentsHandlers>;
+
+type MoveableResource = Resource & { name: string };
+
+type MoveFunc = (
+    data: MoveToFormDialogData,
+    secondaryMoveKind?: string
+) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>;
+
+const secondaryMove: Record<string, MoveFunc> = {
+    [ResourceKind.PROJECT]: moveProject,
+    [ResourceKind.PROCESS]: moveProcess,
+    [ResourceKind.COLLECTION]: moveCollection,
+};
diff --git a/src/views-components/dialog-forms/move-project-dialog.ts b/src/views-components/dialog-forms/move-project-dialog.ts
index 0729e29c..345040d5 100644
--- a/src/views-components/dialog-forms/move-project-dialog.ts
+++ b/src/views-components/dialog-forms/move-project-dialog.ts
@@ -4,12 +4,12 @@
 
 import { compose } from "redux";
 import { withDialog } from "store/dialog/with-dialog";
-import { reduxForm } from 'redux-form';
-import { PROJECT_MOVE_FORM_NAME } from 'store/projects/project-move-actions';
-import { MoveToFormDialogData } from 'store/move-to-dialog/move-to-dialog';
-import { DialogMoveTo } from 'views-components/dialog-move/dialog-move-to';
-import { moveProject } from 'store/workbench/workbench-actions';
-import { pickerId } from 'store/tree-picker/picker-id';
+import { reduxForm } from "redux-form";
+import { PROJECT_MOVE_FORM_NAME } from "store/projects/project-move-actions";
+import { MoveToFormDialogData } from "store/move-to-dialog/move-to-dialog";
+import { DialogMoveTo } from "views-components/dialog-move/dialog-move-to";
+import { moveProject } from "store/workbench/workbench-actions";
+import { pickerId } from "store/tree-picker/picker-id";
 
 export const MoveProjectDialog = compose(
     withDialog(PROJECT_MOVE_FORM_NAME),
@@ -17,8 +17,7 @@ export const MoveProjectDialog = compose(
         form: PROJECT_MOVE_FORM_NAME,
         onSubmit: (data, dispatch) => {
             dispatch(moveProject(data));
-        }
+        },
     }),
-    pickerId(PROJECT_MOVE_FORM_NAME),
+    pickerId(PROJECT_MOVE_FORM_NAME)
 )(DialogMoveTo);
-

commit d8b1191390b3d56740f133b021936f352ca49d55
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Wed Aug 30 10:00:43 2023 -0400

    15768: standardized types between identitical functions Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/components/multiselectToolbar/MultiselectToolbar.tsx b/src/components/multiselectToolbar/MultiselectToolbar.tsx
index faf65db3..47fd380e 100644
--- a/src/components/multiselectToolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselectToolbar/MultiselectToolbar.tsx
@@ -176,11 +176,20 @@ function mapDispatchToProps(dispatch: Dispatch) {
     return {
         executeMulti: (selectedAction: ContextMenuAction, checkedList: TCheckedList, resources: ResourcesState): void => {
             const kindGroups = groupByKind(checkedList, resources);
-            for (const kind in kindGroups) {
-                const actionSet = kindToActionSet[kind];
+            if (selectedAction.name === "Move to") {
+                const firstResource = getResource(selectedToArray(checkedList)[0])(resources) as Resource;
+
+                const actionSet = kindToActionSet[firstResource.kind];
                 const action = findActionByName(selectedAction.name as string, actionSet);
 
-                if (action) action.execute(dispatch, kindGroups[kind]);
+                if (action) action.execute(dispatch, kindGroups[firstResource.kind]);
+            } else {
+                for (const kind in kindGroups) {
+                    const actionSet = kindToActionSet[kind];
+                    const action = findActionByName(selectedAction.name as string, actionSet);
+
+                    if (action) action.execute(dispatch, kindGroups[kind]);
+                }
             }
         },
     };
diff --git a/src/store/projects/project-move-actions.ts b/src/store/projects/project-move-actions.ts
index 618ce21e..0684fc9c 100644
--- a/src/store/projects/project-move-actions.ts
+++ b/src/store/projects/project-move-actions.ts
@@ -17,11 +17,11 @@ import { loadSidePanelTreeProjects } from "../side-panel-tree/side-panel-tree-ac
 
 export const PROJECT_MOVE_FORM_NAME = "projectMoveFormName";
 
-export const openMoveProjectDialog = (resources: Array<any>) => {
+export const openMoveProjectDialog = (resource: any) => {
     return (dispatch: Dispatch) => {
         dispatch<any>(resetPickerProjectTree());
         dispatch<any>(initProjectsTreePicker(PROJECT_MOVE_FORM_NAME));
-        dispatch(initialize(PROJECT_MOVE_FORM_NAME, resources[0]));
+        dispatch(initialize(PROJECT_MOVE_FORM_NAME, resource));
         dispatch(dialogActions.OPEN_DIALOG({ id: PROJECT_MOVE_FORM_NAME, 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 fec40794..d40cffb6 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
@@ -2,9 +2,9 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuAction, ContextMenuActionSet } from '../context-menu-action-set';
-import { ToggleFavoriteAction } from '../actions/favorite-action';
-import { toggleFavorite } from 'store/favorites/favorites-actions';
+import { ContextMenuAction, ContextMenuActionSet } from "../context-menu-action-set";
+import { ToggleFavoriteAction } from "../actions/favorite-action";
+import { toggleFavorite } from "store/favorites/favorites-actions";
 import {
     RenameIcon,
     ShareIcon,
@@ -16,29 +16,29 @@ import {
     Link,
     RestoreVersionIcon,
     FolderSharedIcon,
-} from 'components/icon/icon';
-import { openCollectionUpdateDialog } from 'store/collections/collection-update-actions';
-import { favoritePanelActions } from 'store/favorite-panel/favorite-panel-action';
-import { openMoveCollectionDialog } from 'store/collections/collection-move-actions';
-import { openCollectionCopyDialog } from 'store/collections/collection-copy-actions';
-import { openWebDavS3InfoDialog } from 'store/collections/collection-info-actions';
-import { ToggleTrashAction } from 'views-components/context-menu/actions/trash-action';
-import { toggleCollectionTrashed } from 'store/trash/trash-actions';
-import { openSharingDialog } from 'store/sharing-dialog/sharing-dialog-actions';
-import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
-import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
-import { copyToClipboardAction, openInNewTabAction } from 'store/open-in-new-tab/open-in-new-tab.actions';
-import { openRestoreCollectionVersionDialog } from 'store/collections/collection-version-actions';
-import { TogglePublicFavoriteAction } from '../actions/public-favorite-action';
-import { togglePublicFavorite } from 'store/public-favorites/public-favorites-actions';
-import { publicFavoritePanelActions } from 'store/public-favorites-panel/public-favorites-action';
-import { ContextMenuResource } from 'store/context-menu/context-menu-actions';
+} from "components/icon/icon";
+import { openCollectionUpdateDialog } from "store/collections/collection-update-actions";
+import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
+import { openMoveCollectionDialog } from "store/collections/collection-move-actions";
+import { openCollectionCopyDialog } from "store/collections/collection-copy-actions";
+import { openWebDavS3InfoDialog } from "store/collections/collection-info-actions";
+import { ToggleTrashAction } from "views-components/context-menu/actions/trash-action";
+import { toggleCollectionTrashed } from "store/trash/trash-actions";
+import { openSharingDialog } from "store/sharing-dialog/sharing-dialog-actions";
+import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab";
+import { toggleDetailsPanel } from "store/details-panel/details-panel-action";
+import { copyToClipboardAction, openInNewTabAction } from "store/open-in-new-tab/open-in-new-tab.actions";
+import { openRestoreCollectionVersionDialog } from "store/collections/collection-version-actions";
+import { TogglePublicFavoriteAction } from "../actions/public-favorite-action";
+import { togglePublicFavorite } from "store/public-favorites/public-favorites-actions";
+import { publicFavoritePanelActions } from "store/public-favorites-panel/public-favorites-action";
+import { ContextMenuResource } from "store/context-menu/context-menu-actions";
 
 const toggleFavoriteAction: ContextMenuAction = {
     component: ToggleFavoriteAction,
-    name: 'ToggleFavoriteAction',
+    name: "ToggleFavoriteAction",
     execute: (dispatch, resources) => {
-        resources.forEach((resource) =>
+        resources.forEach(resource =>
             dispatch<any>(toggleFavorite(resource)).then(() => {
                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
             })
@@ -50,37 +50,37 @@ const commonActionSet: ContextMenuActionSet = [
     [
         {
             icon: OpenIcon,
-            name: 'Open in new tab',
+            name: "Open in new tab",
             execute: (dispatch, resource) => {
                 dispatch<any>(openInNewTabAction(resource));
             },
         },
         {
             icon: Link,
-            name: 'Copy to clipboard',
+            name: "Copy to clipboard",
             execute: (dispatch, resource) => {
                 dispatch<any>(copyToClipboardAction(resource));
             },
         },
         {
             icon: CopyIcon,
-            name: 'Make a copy',
+            name: "Make a copy",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openCollectionCopyDialog(resource)));
+                resources.forEach(resource => dispatch<any>(openCollectionCopyDialog(resource)));
             },
         },
         {
             icon: DetailsIcon,
-            name: 'View details',
-            execute: (dispatch) => {
+            name: "View details",
+            execute: dispatch => {
                 dispatch<any>(toggleDetailsPanel());
             },
         },
         {
             icon: AdvancedIcon,
-            name: 'API Details',
+            name: "API Details",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                resources.forEach(resource => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
             },
         },
     ],
@@ -92,9 +92,9 @@ export const readOnlyCollectionActionSet: ContextMenuActionSet = [
         toggleFavoriteAction,
         {
             icon: FolderSharedIcon,
-            name: 'Open with 3rd party client',
+            name: "Open with 3rd party client",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openWebDavS3InfoDialog(resource.uuid)));
+                resources.forEach(resource => dispatch<any>(openWebDavS3InfoDialog(resource.uuid)));
             },
         },
     ],
@@ -105,29 +105,28 @@ export const collectionActionSet: ContextMenuActionSet = [
         ...readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             icon: RenameIcon,
-            name: 'Edit collection',
+            name: "Edit collection",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openCollectionUpdateDialog(resource)));
+                resources.forEach(resource => dispatch<any>(openCollectionUpdateDialog(resource)));
             },
         },
         {
             icon: ShareIcon,
-            name: 'Share',
+            name: "Share",
             execute: (dispatch, resources) => {
                 resources.forEach(({ uuid }) => dispatch<any>(openSharingDialog(uuid)));
             },
         },
         {
             icon: MoveToIcon,
-            name: 'Move to',
-            execute: (dispatch, resources) => resources.forEach((resource) => dispatch<any>(openMoveCollectionDialog(resource))),
+            name: "Move to",
+            execute: (dispatch, resources) => dispatch<any>(openMoveCollectionDialog(resources[0])),
         },
         {
             component: ToggleTrashAction,
-            name: 'ToggleTrashAction',
-            // execute: (dispatch, resource) => {
+            name: "ToggleTrashAction",
             execute: (dispatch, resources: ContextMenuResource[]) => {
-                resources.forEach((resource) => dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!)));
+                resources.forEach(resource => dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!)));
             },
         },
     ],
@@ -138,9 +137,9 @@ export const collectionAdminActionSet: ContextMenuActionSet = [
         ...collectionActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             component: TogglePublicFavoriteAction,
-            name: 'TogglePublicFavoriteAction',
+            name: "TogglePublicFavoriteAction",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) =>
+                resources.forEach(resource =>
                     dispatch<any>(togglePublicFavorite(resource)).then(() => {
                         dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
                     })
@@ -155,7 +154,7 @@ export const oldCollectionVersionActionSet: ContextMenuActionSet = [
         ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             icon: RestoreVersionIcon,
-            name: 'Restore version',
+            name: "Restore version",
             execute: (dispatch, resources) => {
                 resources.forEach(({ uuid }) => dispatch<any>(openRestoreCollectionVersionDialog(uuid)));
             },
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 9ea1dc62..d9ad424e 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
@@ -2,9 +2,9 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from '../context-menu-action-set';
-import { ToggleFavoriteAction } from '../actions/favorite-action';
-import { toggleFavorite } from 'store/favorites/favorites-actions';
+import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ToggleFavoriteAction } from "../actions/favorite-action";
+import { toggleFavorite } from "store/favorites/favorites-actions";
 import {
     RenameIcon,
     ShareIcon,
@@ -15,27 +15,27 @@ import {
     OutputIcon,
     AdvancedIcon,
     OpenIcon,
-} 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';
-import { navigateToOutput } from 'store/process-panel/process-panel-actions';
-import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
-import { TogglePublicFavoriteAction } from '../actions/public-favorite-action';
-import { togglePublicFavorite } from 'store/public-favorites/public-favorites-actions';
-import { publicFavoritePanelActions } from 'store/public-favorites-panel/public-favorites-action';
-import { openInNewTabAction } from 'store/open-in-new-tab/open-in-new-tab.actions';
+} 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";
+import { navigateToOutput } from "store/process-panel/process-panel-actions";
+import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab";
+import { TogglePublicFavoriteAction } from "../actions/public-favorite-action";
+import { togglePublicFavorite } from "store/public-favorites/public-favorites-actions";
+import { publicFavoritePanelActions } from "store/public-favorites-panel/public-favorites-action";
+import { openInNewTabAction } from "store/open-in-new-tab/open-in-new-tab.actions";
 
 export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
     [
         {
             component: ToggleFavoriteAction,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) =>
+                resources.forEach(resource =>
                     dispatch<any>(toggleFavorite(resource)).then(() => {
                         dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
                     })
@@ -44,23 +44,23 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
         },
         {
             icon: OpenIcon,
-            name: 'Open in new tab',
+            name: "Open in new tab",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openInNewTabAction(resource)));
+                resources.forEach(resource => dispatch<any>(openInNewTabAction(resource)));
             },
         },
         {
             icon: ReRunProcessIcon,
-            name: 'Copy and re-run process',
+            name: "Copy and re-run process",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openCopyProcessDialog(resource)));
+                resources.forEach(resource => dispatch<any>(openCopyProcessDialog(resource)));
             },
         },
         {
             icon: OutputIcon,
-            name: 'Outputs',
+            name: "Outputs",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => {
+                resources.forEach(resource => {
                     if (resource.outputUuid) {
                         dispatch<any>(navigateToOutput(resource.outputUuid));
                     }
@@ -69,16 +69,16 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
         },
         {
             icon: DetailsIcon,
-            name: 'View details',
-            execute: (dispatch) => {
+            name: "View details",
+            execute: dispatch => {
                 dispatch<any>(toggleDetailsPanel());
             },
         },
         {
             icon: AdvancedIcon,
-            name: 'API Details',
+            name: "API Details",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                resources.forEach(resource => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
             },
         },
     ],
@@ -89,30 +89,30 @@ export const processResourceActionSet: ContextMenuActionSet = [
         ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             icon: RenameIcon,
-            name: 'Edit process',
+            name: "Edit process",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openProcessUpdateDialog(resource)));
+                resources.forEach(resource => dispatch<any>(openProcessUpdateDialog(resource)));
             },
         },
         {
             icon: ShareIcon,
-            name: 'Share',
+            name: "Share",
             execute: (dispatch, resources) => {
                 resources.forEach(({ uuid }) => dispatch<any>(openSharingDialog(uuid)));
             },
         },
         {
             icon: MoveToIcon,
-            name: 'Move to',
+            name: "Move to",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openMoveProcessDialog(resource)));
+                dispatch<any>(openMoveProcessDialog(resources[0]));
             },
         },
         {
-            name: 'Remove',
+            name: "Remove",
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openRemoveProcessDialog(resource.uuid)));
+                resources.forEach(resource => dispatch<any>(openRemoveProcessDialog(resource.uuid)));
             },
         },
     ],
@@ -123,9 +123,9 @@ export const processResourceAdminActionSet: ContextMenuActionSet = [
         ...processResourceActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             component: TogglePublicFavoriteAction,
-            name: 'Add to public favorites',
+            name: "Add to public favorites",
             execute: (dispatch, resources) => {
-                resources.forEach((resource) =>
+                resources.forEach(resource =>
                     dispatch<any>(togglePublicFavorite(resource)).then(() => {
                         dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
                     })
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 877c34b9..9a4d924d 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
@@ -92,8 +92,8 @@ export const shareAction = {
 export const moveToAction = {
     icon: MoveToIcon,
     name: "Move to",
-    execute: (dispatch, resources) => {
-        dispatch(openMoveProjectDialog(resources));
+    execute: (dispatch, resource) => {
+        dispatch(openMoveProjectDialog(resource[0]));
     },
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list