15768: process outputs no longer disappear on reload Arvados-DCO-1.1-Signed-off-by...
[arvados-workbench2.git] / 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 { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
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
11 export function findActionByName(name: string, actionSet: ContextMenuActionSet) {
12     return actionSet[0].find(action => action.name === name);
13 }
14
15 const { COLLECTION, PROJECT, PROCESS } = ResourceKind;
16
17 export const kindToActionSet: Record<string, ContextMenuActionSet> = {
18     [COLLECTION]: msCollectionActionSet,
19     [PROJECT]: msProjectActionSet,
20     [PROCESS]: msProcessActionSet,
21 };