16583: Add "Intermediate" to collection type filters
[arvados-workbench2.git] / src / models / resource.ts
index 239a67cc1251e88d6b6968c89a7d9b878ac9b214..fd86727782c2960b15ee78d4237da4dcc53363b4 100644 (file)
@@ -14,6 +14,14 @@ export interface Resource {
     etag: string;
 }
 
+export interface ResourceWithProperties extends Resource {
+    properties: any;
+}
+
+export interface EditableResource extends Resource {
+    isEditable: boolean;
+}
+
 export interface TrashableResource extends Resource {
     trashAt: string;
     deleteAt: string;
@@ -28,7 +36,6 @@ export enum ResourceKind {
     GROUP = "arvados#group",
     LINK = "arvados#link",
     LOG = "arvados#log",
-    NODE = "arvados#node",
     PROCESS = "arvados#containerRequest",
     PROJECT = "arvados#group",
     REPOSITORY = "arvados#repository",
@@ -53,13 +60,13 @@ export enum ResourceObjectType {
     VIRTUAL_MACHINE = '2x53u',
     WORKFLOW = '7fd4e',
     SSH_KEY = 'fngyi',
-    KEEP_SERVICE = 'bi6l4',
-    NODE = '7ekkf'
+    KEEP_SERVICE = 'bi6l4'
 }
 
 export const RESOURCE_UUID_PATTERN = '[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}';
-export const RESOURCE_UUID_REGEX = new RegExp(RESOURCE_UUID_PATTERN);
-export const COLLECTION_PDH_REGEX = /[a-f0-9]{32}\+\d+/;
+export const PORTABLE_DATA_HASH_PATTERN = '[a-f0-9]{32}\\+\\d+';
+export const RESOURCE_UUID_REGEX = new RegExp("^" + RESOURCE_UUID_PATTERN + "$");
+export const COLLECTION_PDH_REGEX = new RegExp("^" + PORTABLE_DATA_HASH_PATTERN + "$");
 
 export const isResourceUuid = (uuid: string) =>
     RESOURCE_UUID_REGEX.test(uuid);
@@ -96,8 +103,6 @@ export const extractUuidKind = (uuid: string = '') => {
             return ResourceKind.SSH_KEY;
         case ResourceObjectType.KEEP_SERVICE:
             return ResourceKind.KEEP_SERVICE;
-        case ResourceObjectType.NODE:
-            return ResourceKind.NODE;
         case ResourceObjectType.API_CLIENT_AUTHORIZATION:
             return ResourceKind.API_CLIENT_AUTHORIZATION;
         case ResourceObjectType.LINK: