Merge branch 'master' into #15165-running-a-process-from-workflow-section-doesnt...
[arvados-workbench2.git] / src / models / resource.ts
index 31f3eb883f974b26c05b45cd28837fe4f493600c..239a67cc1251e88d6b6968c89a7d9b878ac9b214 100644 (file)
@@ -57,8 +57,9 @@ export enum ResourceObjectType {
     NODE = '7ekkf'
 }
 
-export const RESOURCE_UUID_PATTERN = '.{5}-.{5}-.{15}';
+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 isResourceUuid = (uuid: string) =>
     RESOURCE_UUID_REGEX.test(uuid);
@@ -102,6 +103,7 @@ export const extractUuidKind = (uuid: string = '') => {
         case ResourceObjectType.LINK:
             return ResourceKind.LINK;
         default:
-            return undefined;
+            const match = COLLECTION_PDH_REGEX.exec(uuid);
+            return match ? ResourceKind.COLLECTION : undefined;
     }
 };