Merge branch 'main' into 21357-favorites-names
[arvados.git] / services / workbench2 / src / common / labels.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
7 export const resourceLabel = (type: string, subtype = '') => {
8     switch (type) {
9         case ResourceKind.COLLECTION:
10             return "Data collection";
11         case ResourceKind.PROJECT:
12             if (subtype === "filter") {
13                 return "Filter group";
14             } else if (subtype === "role") {
15                 return "Group";
16             }
17             return "Project";
18         case ResourceKind.PROCESS:
19             return "Process";
20         case ResourceKind.USER:
21             return "User";
22         case ResourceKind.GROUP:
23             return "Group";
24         case ResourceKind.VIRTUAL_MACHINE:
25             return "Virtual Machine";
26         case ResourceKind.WORKFLOW:
27             return "Workflow";
28         default:
29             return "Unknown";
30     }
31 };