Update models with groups, colelctions, workflows and processes
[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 { DataItem } from "../../components/data-table/data-table";
6 import { ResourceKind } from "../../models/kinds";
7 import { GroupContentsResource } from "../../services/groups-service/groups-service";
8
9 export interface ProjectPanelItem extends DataItem {
10     uuid: string;
11     name: string;
12     kind: string;
13     url: string;
14     owner: string;
15     lastModified: string;
16     fileSize?: number;
17     status?: string;
18 }
19
20
21 export function resourceToDataItem(r: GroupContentsResource): ProjectPanelItem {
22     return {
23         key: r.uuid,
24         uuid: r.uuid,
25         name: r.name,
26         kind: r.kind,
27         url: "",
28         owner: r.ownerUuid,
29         lastModified: r.modifiedAt,
30         status:  r.kind === ResourceKind.Process ? r.state : undefined
31     };
32 }
33