[arvados-workbench2] updated: 2.6.0-45-gfb10daa7

git repository hosting git at public.arvados.org
Fri Jun 23 16:52:45 UTC 2023


Summary of changes:
 .../multiselectToolbar/MultiselectToolbar.tsx      | 24 ++++++++--------------
 1 file changed, 8 insertions(+), 16 deletions(-)

       via  fb10daa75864def53d1f0ffa7da3cece8cebe9d0 (commit)
      from  f7a4118c87ae1df4a42efdad3695e6fcb5d60854 (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 fb10daa75864def53d1f0ffa7da3cece8cebe9d0
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Fri Jun 23 12:52:40 2023 -0400

    15768: made new filters.ts file 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 d2796322..e6e8c62e 100644
--- a/src/components/multiselectToolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselectToolbar/MultiselectToolbar.tsx
@@ -22,6 +22,7 @@ import { CopyProcessDialog, CopyManyProcessesDialog } from 'views-components/dia
 import { collectionActionSet } from 'views-components/context-menu/action-sets/collection-action-set';
 import { ContextMenuAction, ContextMenuActionSet } from 'views-components/context-menu/context-menu-action-set';
 import { TrashIcon } from 'components/icon/icon';
+import { multiselectActionsFilters, TMultiselectActionsFilters } from './ms-toolbar-action-filters';
 
 type CssRules = 'root' | 'button';
 
@@ -52,22 +53,12 @@ export type MultiselectToolbarProps = {
     executeMulti: (fn, checkedList: TCheckedList, resources: ResourcesState) => void;
 };
 
-const collectionMSActionsFilter = {
-    MAKE_A_COPY: 'Make a copy',
-    MOVE_TO: 'Move to',
-    TOGGLE_TRASH_ACTION: 'ToggleTrashAction',
-};
-
-const multiselectActionsFilters = {
-    'arvados#collection': [collectionActionSet, collectionMSActionsFilter],
-};
-
 export const MultiselectToolbar = connect(
     mapStateToProps,
     mapDispatchToProps
 )(
     withStyles(styles)((props: MultiselectToolbarProps & WithStyles<CssRules>) => {
-        const { classes, isVisible, checkedList, resources } = props;
+        const { classes, checkedList } = props;
         const currentResourceKinds = Array.from(selectedToKindSet(checkedList));
 
         const buttons = selectActionsByKind(currentResourceKinds, multiselectActionsFilters);
@@ -117,13 +108,15 @@ function selectedToKindSet(checkedList: TCheckedList): Set<string> {
     return setifiedList;
 }
 
-function filterActions(actionArray: ContextMenuActionSet, filters: Record<string, string>): Array<ContextMenuAction> {
-    return actionArray[0].filter((action) => Object.values(filters).includes(action.name as string));
+function filterActions(actionArray: ContextMenuActionSet, filters: Array<string>): Array<ContextMenuAction> {
+    return actionArray[0].filter((action) => filters.includes(action.name as string));
 }
 
-function selectActionsByKind(resourceKinds: Array<string>, filterSet: any) {
+function selectActionsByKind(resourceKinds: Array<string>, filterSet: TMultiselectActionsFilters) {
     const result: Array<ContextMenuAction> = [];
-    resourceKinds.forEach((kind) => result.push(...filterActions(filterSet[kind][0], filterSet[kind][1])));
+    resourceKinds.forEach((kind) => {
+        if (filterSet[kind]) result.push(...filterActions(...filterSet[kind]));
+    });
     return result;
 }
 
@@ -142,7 +135,6 @@ function mapDispatchToProps(dispatch: Dispatch) {
     return {
         executeMulti: (fn, checkedList: TCheckedList, resources: ResourcesState) =>
             selectedToArray(checkedList).forEach((uuid) => {
-                console.log(uuid);
                 fn(dispatch, getResource(uuid)(resources));
             }),
     };

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list