Replace go back item with browser back button support
[arvados-workbench2.git] / src / models / resource.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 export interface Resource {
6     name: string;
7     createdAt: string;
8     modifiedAt: string;
9     uuid: string;
10     ownerUuid: string;
11     href: string;
12     kind: ResourceKind;
13 }
14
15 export enum ResourceKind {
16     PROJECT = "project",
17     COLLECTION = "collection",
18     PIPELINE = "pipeline",
19     UNKNOWN = "unknown"
20 }
21
22 export function getResourceKind(itemKind: string) {
23     switch (itemKind) {
24         case "arvados#project":
25         case "arvados#group":
26             return ResourceKind.PROJECT;
27         case "arvados#collection":
28             return ResourceKind.COLLECTION;
29         case "arvados#pipeline":
30             return ResourceKind.PIPELINE;
31         default:
32             return ResourceKind.UNKNOWN;
33     }
34 }