[arvados-workbench2] updated: 2.6.0-121-g72a8bf21

git repository hosting git at public.arvados.org
Tue Oct 3 18:05:40 UTC 2023


Summary of changes:
 .../context-menu/action-sets/project-action-set.ts | 34 ++++++++++------------
 1 file changed, 15 insertions(+), 19 deletions(-)

       via  72a8bf2138429b61dfc9710cc41932396b6f5b4f (commit)
      from  e4342872b52b88c232952317041fb4426faceb9b (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 72a8bf2138429b61dfc9710cc41932396b6f5b4f
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Tue Oct 3 14:05:37 2023 -0400

    15768: removed vestigial foreach loops in project-actions Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

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 9a4d924d..27063151 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
@@ -25,11 +25,9 @@ export const toggleFavoriteAction = {
     component: ToggleFavoriteAction,
     name: "ToggleFavoriteAction",
     execute: (dispatch, resources) => {
-        resources.forEach(resource =>
-            dispatch(toggleFavorite(resource)).then(() => {
-                dispatch(favoritePanelActions.REQUEST_ITEMS());
-            })
-        );
+        dispatch(toggleFavorite(resources[0])).then(() => {
+            dispatch(favoritePanelActions.REQUEST_ITEMS());
+        });
     },
 };
 
@@ -37,7 +35,7 @@ export const openInNewTabMenuAction = {
     icon: OpenIcon,
     name: "Open in new tab",
     execute: (dispatch, resources) => {
-        resources.forEach(resource => dispatch(openInNewTabAction(resource)));
+        dispatch(openInNewTabAction(resources[0]));
     },
 };
 
@@ -61,7 +59,7 @@ export const advancedAction = {
     icon: AdvancedIcon,
     name: "API Details",
     execute: (dispatch, resources) => {
-        resources.forEach(resource => dispatch(openAdvancedTabDialog(resource.uuid)));
+        dispatch(openAdvancedTabDialog(resources[0].uuid));
     },
 };
 
@@ -69,7 +67,7 @@ export const openWith3rdPartyClientAction = {
     icon: FolderSharedIcon,
     name: "Open with 3rd party client",
     execute: (dispatch, resources) => {
-        resources.forEach(resource => dispatch(openWebDavS3InfoDialog(resource.uuid)));
+        dispatch(openWebDavS3InfoDialog(resources[0].uuid));
     },
 };
 
@@ -77,15 +75,15 @@ export const editProjectAction = {
     icon: RenameIcon,
     name: "Edit project",
     execute: (dispatch, resources) => {
-        resources.forEach(resource => dispatch(openProjectUpdateDialog(resource)));
+        dispatch(openProjectUpdateDialog(resources[0]));
     },
 };
 
 export const shareAction = {
     icon: ShareIcon,
     name: "Share",
-    execute: (dispatch, processes) => {
-        processes.forEach(process => dispatch(openSharingDialog(process.uuid)));
+    execute: (dispatch, resources) => {
+        dispatch(openSharingDialog(resources[0].uuid));
     },
 };
 
@@ -101,7 +99,7 @@ export const toggleTrashAction = {
     component: ToggleTrashAction,
     name: "ToggleTrashAction",
     execute: (dispatch, resources) => {
-        resources.forEach(resource => dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!, resources.length > 1)));
+        dispatch(toggleProjectTrashed(resources[0].uuid, resources[0].ownerUuid, resources[0].isTrashed!!, resources.length > 1));
     },
 };
 
@@ -109,13 +107,11 @@ export const freezeProjectAction = {
     component: ToggleLockAction,
     name: "ToggleLockAction",
     execute: (dispatch, resources) => {
-        resources.forEach(resource => {
-            if (resource.isFrozen) {
-                dispatch(unfreezeProject(resource.uuid));
-            } else {
-                dispatch(freezeProject(resource.uuid));
-            }
-        });
+        if (resources[0].isFrozen) {
+            dispatch(unfreezeProject(resources[0].uuid));
+        } else {
+            dispatch(freezeProject(resources[0].uuid));
+        }
     },
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list