[arvados-workbench2] updated: 2.6.0-71-gc68eb6b3

git repository hosting git at public.arvados.org
Mon Aug 28 18:24:11 UTC 2023


Summary of changes:
 src/store/workbench/workbench-actions.ts | 56 ++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 21 deletions(-)

       via  c68eb6b39deba5d850d1b0ba7b59ec42850d8cdb (commit)
      from  3bce3f7ad3a50e6e8c7da962691e53d45d808894 (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 c68eb6b39deba5d850d1b0ba7b59ec42850d8cdb
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Mon Aug 28 14:24:08 2023 -0400

    15768: multimove collections works Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index 9b928ce3..4d717c48 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -289,7 +289,7 @@ export const moveProject = (data: MoveToFormDialogData) => async (dispatch: Disp
         await moveSingleProject(uuid);
     }
 
-    async function moveSingleProject(uuid) {
+    async function moveSingleProject(uuid: string) {
         const originalItem = getResource(uuid)(getState().resources) as Resource & { name: string };
         if (originalItem.kind === ResourceKind.PROJECT) {
             try {
@@ -435,25 +435,39 @@ export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dis
 };
 
 export const moveCollection = (data: MoveToFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-    try {
-        const collection = await dispatch<any>(collectionMoveActions.moveCollection(data));
-        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,
-            })
-        );
+    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);
+    }
+
+    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,
+                    })
+                );
+            }
+        }
     }
 };
 
@@ -536,7 +550,7 @@ export const moveProcess = (data: MoveToFormDialogData) => async (dispatch: Disp
         await moveSingleProcess(uuid);
     }
 
-    async function moveSingleProcess(uuid) {
+    async function moveSingleProcess(uuid: string) {
         const originalItem = getResource(uuid)(getState().resources) as Resource & { name: string };
         if (originalItem.kind === ResourceKind.PROCESS) {
             try {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list