Add typescript paths to top level folders
[arvados-workbench2.git] / src / views / project-panel / project-panel-item.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { GroupContentsResource } from "~/services/groups-service/groups-service";
6 import { ResourceKind } from "~/models/resource";
7
8 export interface ProjectPanelItem {
9     uuid: string;
10     name: string;
11     description?: string;
12     kind: string;
13     url: string;
14     owner: string;
15     lastModified: string;
16     fileSize?: number;
17     status?: string;
18 }
19
20 export function resourceToDataItem(r: GroupContentsResource): ProjectPanelItem {
21     return {
22         uuid: r.uuid,
23         name: r.name,
24         description: r.description,
25         kind: r.kind,
26         url: "",
27         owner: r.ownerUuid,
28         lastModified: r.modifiedAt,
29         status:  r.kind === ResourceKind.PROCESS ? r.state : undefined
30     };
31 }