[arvados-workbench2] updated: 2.6.0-52-g577e47a4
git repository hosting
git at public.arvados.org
Tue Jul 11 14:39:21 UTC 2023
Summary of changes:
src/components/multiselectToolbar/MultiselectToolbar.tsx | 8 ++------
src/components/multiselectToolbar/ms-toolbar-action-filters.ts | 8 ++++----
2 files changed, 6 insertions(+), 10 deletions(-)
via 577e47a434702a8bdad5669b3d470cfde5241033 (commit)
from 55c0fe472ca9938c93a78bbff0e0fb1b5e51a54e (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 577e47a434702a8bdad5669b3d470cfde5241033
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Jul 11 10:39:16 2023 -0400
15768: setified filter lists 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 6b16fd31..7f48333c 100644
--- a/src/components/multiselectToolbar/MultiselectToolbar.tsx
+++ b/src/components/multiselectToolbar/MultiselectToolbar.tsx
@@ -114,8 +114,8 @@ function selectedToKindSet(checkedList: TCheckedList): Set<string> {
//num of currentResourceKinds * num of actions (in ContextMenuActionSet) * num of filters
//worst case: 14 * n * n -oof
-function filterActions(actionArray: ContextMenuActionSet, filters: Array<string>): Array<ContextMenuAction> {
- return actionArray[0].filter((action) => filters.includes(action.name as string));
+function filterActions(actionArray: ContextMenuActionSet, filters: Set<string>): Array<ContextMenuAction> {
+ return actionArray[0].filter((action) => filters.has(action.name as string));
}
//this might be the least efficient algorithm I've ever written
@@ -137,14 +137,12 @@ function selectActionsByKind(currentResourceKinds: Array<string>, filterSet: TMu
});
}
});
- // console.log(result, fullFilterArray);
///take fullFilterSet, make it into an array of string sets
const filteredNameSet = fullFilterArray.map((filterArray) => {
const resultSet = new Set();
filterArray.forEach((action) => resultSet.add(action.name || ''));
return resultSet;
});
- console.log('filteredNameSet', filteredNameSet);
//filter results so that the name of each action is present in all of this string arrays
const filteredResult = result.filter((action) => {
for (let i = 0; i < filteredNameSet.length; i++) {
@@ -153,8 +151,6 @@ function selectActionsByKind(currentResourceKinds: Array<string>, filterSet: TMu
return true;
});
- console.log('filteredResult', filteredResult);
-
//return sorted array of actions
return filteredResult.sort((a, b) => {
a.name = a.name || '';
diff --git a/src/components/multiselectToolbar/ms-toolbar-action-filters.ts b/src/components/multiselectToolbar/ms-toolbar-action-filters.ts
index 1d8f24cc..a56b7455 100644
--- a/src/components/multiselectToolbar/ms-toolbar-action-filters.ts
+++ b/src/components/multiselectToolbar/ms-toolbar-action-filters.ts
@@ -8,7 +8,7 @@ import { collectionActionSet } from 'views-components/context-menu/action-sets/c
import { projectActionSet } from 'views-components/context-menu/action-sets/project-action-set';
import { processResourceActionSet } from 'views-components/context-menu/action-sets/process-resource-action-set';
-export type TMultiselectActionsFilters = Record<string, [ContextMenuActionSet, Array<string>]>;
+export type TMultiselectActionsFilters = Record<string, [ContextMenuActionSet, Set<string>]>;
export const contextMenuActionConsts = {
MAKE_A_COPY: 'Make a copy',
@@ -22,9 +22,9 @@ export const contextMenuActionConsts = {
const { MAKE_A_COPY, MOVE_TO, TOGGLE_TRASH_ACTION, COPY_TO_CLIPBOARD, COPY_AND_RERUN_PROCESS, REMOVE } =
contextMenuActionConsts;
-const collectionMSActionsFilter = [MAKE_A_COPY, MOVE_TO, TOGGLE_TRASH_ACTION];
-const projectMSActionsFilter = [COPY_TO_CLIPBOARD, MOVE_TO, TOGGLE_TRASH_ACTION];
-const processResourceMSActionsFilter = [COPY_AND_RERUN_PROCESS, MOVE_TO, REMOVE];
+const collectionMSActionsFilter = new Set([MAKE_A_COPY, MOVE_TO, TOGGLE_TRASH_ACTION]);
+const projectMSActionsFilter = new Set([COPY_TO_CLIPBOARD, MOVE_TO, TOGGLE_TRASH_ACTION]);
+const processResourceMSActionsFilter = new Set([COPY_AND_RERUN_PROCESS, MOVE_TO, REMOVE]);
const { COLLECTION, PROJECT, PROCESS } = ResourceKind;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list