refs #master Merge branch 'origin/master' into 13828-trash-view
[arvados.git] / src / views / trash-panel / trash-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 { TrashResource } from "~/models/resource";
7
8 export interface TrashPanelItem {
9     uuid: string;
10     name: string;
11     kind: string;
12     owner: string;
13     fileSize?: number;
14     trashAt?: string;
15     deleteAt?: string;
16     isTrashed?: boolean;
17 }
18
19 export function resourceToDataItem(r: GroupContentsResource): TrashPanelItem {
20     return {
21         uuid: r.uuid,
22         name: r.name,
23         kind: r.kind,
24         owner: r.ownerUuid,
25         trashAt: (r as TrashResource).trashAt,
26         deleteAt: (r as TrashResource).deleteAt,
27         isTrashed: (r as TrashResource).isTrashed
28     };
29 }