From: Lisa Knox Date: Mon, 27 Nov 2023 16:44:28 +0000 (-0500) Subject: 21128: added optional allActionNames filter Arvados-DCO-1.1-Signed-off-by: Lisa Knox... X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/84d3e7312bb90b5f45640e8b0e4f434ed7dc6738 21128: added optional allActionNames filter Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- diff --git a/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts b/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts index f921cd1f..9ad80f7d 100644 --- a/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts +++ b/src/components/multiselect-toolbar/ms-toolbar-action-filters.ts @@ -31,8 +31,10 @@ const { VIEW_DETAILS, } = MultiSelectMenuActionNames; -//these sets govern what actions are on the ms toolbar for each resource kind -const collectionMSActionsFilter = new Set([MAKE_A_COPY, MOVE_TO, ADD_TO_TRASH]); +const allActionNames = (actionSet: MultiSelectMenuActionSet): Set => new Set(actionSet[0].map((action) => action.name)); + +//use allActionNames or filter manually below + const processResourceMSActionsFilter = new Set([MOVE_TO, REMOVE]); const projectMSActionsFilter = new Set([ ADD_TO_FAVORITES, @@ -56,7 +58,7 @@ const workflowMSActionFilter = new Set([OPEN_IN_NEW_TAB, COPY_TO_CLIPBOARD, VIEW const { COLLECTION, PROCESS, PROJECT, WORKFLOW } = ResourceKind; export const multiselectActionsFilters: TMultiselectActionsFilters = { - [COLLECTION]: [msCollectionActionSet, collectionMSActionsFilter], + [COLLECTION]: [msCollectionActionSet, allActionNames(msCollectionActionSet)], [PROCESS]: [msProcessActionSet, processResourceMSActionsFilter], [PROJECT]: [msProjectActionSet, projectMSActionsFilter], [WORKFLOW]: [msWorkflowActionSet, workflowMSActionFilter]