1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ProjectResource } from "models/project";
6 import { getResource } from "store/resources/resources";
8 export const resourceIsFrozen = (resource: any, resources): boolean => {
9 let isFrozen: boolean = !!resource.frozenByUuid;
10 let ownerUuid: string | undefined = resource?.ownerUuid;
12 while(!isFrozen && !!ownerUuid && ownerUuid.indexOf('000000000000000') === -1) {
13 console.log(isFrozen, ownerUuid, resource.uuid, resource);
14 const parentResource: ProjectResource | undefined = getResource<ProjectResource>(ownerUuid)(resources);
15 isFrozen = !!parentResource?.frozenByUuid;
16 ownerUuid = parentResource?.ownerUuid;