[arvados-workbench2] updated: 2.6.0-76-gd9c4c823

git repository hosting git at public.arvados.org
Thu Aug 31 19:35:45 UTC 2023


Summary of changes:
 .../multiselectToolbar/MultiselectToolbar.tsx      | 50 +++++++++++++---------
 .../action-sets/collection-action-set.ts           |  4 +-
 2 files changed, 31 insertions(+), 23 deletions(-)

       via  d9c4c82329d110b180003a36142e0a8e4d11ccc8 (commit)
      from  cb8dda3b04dc65e5b9a87593ae3d985d008b6f0b (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 d9c4c82329d110b180003a36142e0a8e4d11ccc8
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Thu Aug 31 15:35:40 2023 -0400

    15768: clipboard works 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 b072652f..f9ebb76a 100644
--- a/src/components/multiselectToolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselectToolbar/MultiselectToolbar.tsx
@@ -18,6 +18,7 @@ import { RestoreFromTrashIcon, TrashIcon } from "components/icon/icon";
 import { multiselectActionsFilters, TMultiselectActionsFilters, contextMenuActionConsts } from "./ms-toolbar-action-filters";
 import { kindToActionSet, findActionByName } from "./ms-kind-action-differentiator";
 import { toggleTrashAction } from "views-components/context-menu/action-sets/project-action-set";
+import { copyToClipboardAction } from "store/open-in-new-tab/open-in-new-tab.actions";
 
 type CssRules = "root" | "button";
 
@@ -114,6 +115,16 @@ export function selectedToKindSet(checkedList: TCheckedList): Set<string> {
     return setifiedList;
 }
 
+function groupByKind(checkedList: TCheckedList, resources: ResourcesState): Record<string, ContextMenuResource[]> {
+    const result = {};
+    selectedToArray(checkedList).forEach(uuid => {
+        const resource = getResource(uuid)(resources) as Resource;
+        if (!result[resource.kind]) result[resource.kind] = [];
+        result[resource.kind].push(resource);
+    });
+    return result;
+}
+
 function filterActions(actionArray: ContextMenuActionSet, filters: Set<string>): Array<ContextMenuAction> {
     return actionArray[0].filter(action => filters.has(action.name as string));
 }
@@ -176,31 +187,28 @@ function mapDispatchToProps(dispatch: Dispatch) {
     return {
         executeMulti: (selectedAction: ContextMenuAction, checkedList: TCheckedList, resources: ResourcesState): void => {
             const kindGroups = groupByKind(checkedList, resources);
-            if (selectedAction.name === contextMenuActionConsts.MOVE_TO) {
-                const firstResource = getResource(selectedToArray(checkedList)[0])(resources) as Resource;
-
-                const actionSet = kindToActionSet[firstResource.kind];
-                const action = findActionByName(selectedAction.name as string, actionSet);
+            switch (selectedAction.name) {
+                case contextMenuActionConsts.MOVE_TO:
+                    const firstResource = getResource(selectedToArray(checkedList)[0])(resources) as Resource;
 
-                if (action) action.execute(dispatch, kindGroups[firstResource.kind]);
-            } else {
-                for (const kind in kindGroups) {
-                    const actionSet = kindToActionSet[kind];
+                    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]);
+                    break;
+                case contextMenuActionConsts.COPY_TO_CLIPBOARD:
+                    const selectedResources = selectedToArray(checkedList).map(uuid => getResource(uuid)(resources));
+                    dispatch<any>(copyToClipboardAction(selectedResources));
+                    break;
+                default:
+                    for (const kind in kindGroups) {
+                        const actionSet = kindToActionSet[kind];
+                        const action = findActionByName(selectedAction.name as string, actionSet);
+
+                        if (action) action.execute(dispatch, kindGroups[kind]);
+                    }
+                    break;
             }
         },
     };
 }
-
-function groupByKind(checkedList: TCheckedList, resources: ResourcesState): Record<string, ContextMenuResource[]> {
-    const result = {};
-    selectedToArray(checkedList).forEach(uuid => {
-        const resource = getResource(uuid)(resources) as Resource;
-        if (!result[resource.kind]) result[resource.kind] = [];
-        result[resource.kind].push(resource);
-    });
-    return result;
-}
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 d40cffb6..c93d5859 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
@@ -58,8 +58,8 @@ const commonActionSet: ContextMenuActionSet = [
         {
             icon: Link,
             name: "Copy to clipboard",
-            execute: (dispatch, resource) => {
-                dispatch<any>(copyToClipboardAction(resource));
+            execute: (dispatch, resources) => {
+                dispatch<any>(copyToClipboardAction(resources));
             },
         },
         {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list