21535: changed test spec from select all to select each individually Arvados-DCO...
[arvados.git] / services / workbench2 / src / components / multiselect-toolbar / ms-kind-action-differentiator.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ResourceKind } from "models/resource";
6 import { MultiSelectMenuActionSet} from "views-components/multiselect-toolbar/ms-menu-actions";
7 import { msCollectionActionSet } from "views-components/multiselect-toolbar/ms-collection-action-set";
8 import { msProjectActionSet } from "views-components/multiselect-toolbar/ms-project-action-set";
9 import { msProcessActionSet } from "views-components/multiselect-toolbar/ms-process-action-set";
10 import { msWorkflowActionSet } from "views-components/multiselect-toolbar/ms-workflow-action-set";
11
12 export function findActionByName(name: string, actionSet: MultiSelectMenuActionSet) {
13     return actionSet[0].find(action => action.name === name);
14 }
15
16 const { COLLECTION, PROCESS, PROJECT, WORKFLOW } = ResourceKind;
17
18 export const kindToActionSet: Record<string, MultiSelectMenuActionSet> = {
19     [COLLECTION]: msCollectionActionSet,
20     [PROCESS]: msProcessActionSet,
21     [PROJECT]: msProjectActionSet,
22     [WORKFLOW]: msWorkflowActionSet,
23 };