From: Lucas Di Pentima Date: Tue, 14 Dec 2021 21:27:49 +0000 (-0300) Subject: 18219: Extracts 'properties' into a separate interface for typing reasons. X-Git-Tag: 2.4.0~21^2~15 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/1be05c9f56147aa776819a4f66bf021cb4556874 18219: Extracts 'properties' into a separate interface for typing reasons. We'll be treating Collections, Projects, etc as "ResourcesWithProperties". Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/src/models/collection.ts b/src/models/collection.ts index baa25c7a..3effe672 100644 --- a/src/models/collection.ts +++ b/src/models/collection.ts @@ -2,13 +2,16 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ResourceKind, TrashableResource } from "./resource"; +import { + ResourceKind, + TrashableResource, + ResourceWithProperties +} from "./resource"; -export interface CollectionResource extends TrashableResource { +export interface CollectionResource extends TrashableResource, ResourceWithProperties { kind: ResourceKind.COLLECTION; name: string; description: string; - properties: any; portableDataHash: string; manifestText: string; replicationDesired: number; diff --git a/src/models/container-request.ts b/src/models/container-request.ts index 9a57a41d..99ec4cf0 100644 --- a/src/models/container-request.ts +++ b/src/models/container-request.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { Resource, ResourceKind } from "./resource"; +import { Resource, ResourceKind, ResourceWithProperties } from "./resource"; import { MountType } from "models/mount-types"; import { RuntimeConstraints } from './runtime-constraints'; import { SchedulingParameters } from './scheduling-parameters'; @@ -13,11 +13,10 @@ export enum ContainerRequestState { FINAL = "Final" } -export interface ContainerRequestResource extends Resource { +export interface ContainerRequestResource extends Resource, ResourceWithProperties { kind: ResourceKind.CONTAINER_REQUEST; name: string; description: string; - properties: any; state: ContainerRequestState; requestingContainerUuid: string | null; containerUuid: string | null; diff --git a/src/models/group.ts b/src/models/group.ts index a0c22212..3f3656cc 100644 --- a/src/models/group.ts +++ b/src/models/group.ts @@ -2,14 +2,19 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ResourceKind, TrashableResource, ResourceObjectType, RESOURCE_UUID_REGEX } from "./resource"; +import { + ResourceKind, + ResourceWithProperties, + RESOURCE_UUID_REGEX, + ResourceObjectType, + TrashableResource +} from "./resource"; -export interface GroupResource extends TrashableResource { +export interface GroupResource extends TrashableResource, ResourceWithProperties { kind: ResourceKind.GROUP; name: string; groupClass: GroupClass | null; description: string; - properties: any; writableBy: string[]; ensure_unique_name: boolean; } diff --git a/src/models/link.ts b/src/models/link.ts index 828dced2..f55c5ccf 100644 --- a/src/models/link.ts +++ b/src/models/link.ts @@ -2,16 +2,15 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { Resource, ResourceKind } from 'models/resource'; +import { Resource, ResourceKind, ResourceWithProperties } from 'models/resource'; -export interface LinkResource extends Resource { +export interface LinkResource extends Resource, ResourceWithProperties { headUuid: string; headKind: ResourceKind; tailUuid: string; tailKind: string; linkClass: string; name: string; - properties: any; kind: ResourceKind.LINK; } diff --git a/src/models/log.ts b/src/models/log.ts index 55967f88..3397993b 100644 --- a/src/models/log.ts +++ b/src/models/log.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { Resource } from "./resource"; +import { Resource, ResourceWithProperties } from "./resource"; import { ResourceKind } from 'models/resource'; export enum LogEventType { @@ -18,11 +18,10 @@ export enum LogEventType { STDERR = 'stderr', } -export interface LogResource extends Resource { +export interface LogResource extends Resource, ResourceWithProperties { kind: ResourceKind.LOG; objectUuid: string; eventAt: string; eventType: string; summary: string; - properties: any; } diff --git a/src/models/resource.ts b/src/models/resource.ts index c94c4b25..fd867277 100644 --- a/src/models/resource.ts +++ b/src/models/resource.ts @@ -14,6 +14,10 @@ export interface Resource { etag: string; } +export interface ResourceWithProperties extends Resource { + properties: any; +} + export interface EditableResource extends Resource { isEditable: boolean; } diff --git a/src/models/tag.ts b/src/models/tag.ts index f4e5854a..fa36486d 100644 --- a/src/models/tag.ts +++ b/src/models/tag.ts @@ -10,6 +10,7 @@ export interface TagResource extends LinkResource { } export interface TagProperty { + uuid: string; key: string; keyID?: string; value: string;