From 079bade139bdc03477f2d7fd3ee90c199919417c Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Wed, 24 Jan 2024 09:31:33 +0200 Subject: [PATCH] refactor(kube/app): use structuredClone to copy object [EE-6581] (#11004) --- .../applications/CreateView/application-services/utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/react/kubernetes/applications/CreateView/application-services/utils.ts b/app/react/kubernetes/applications/CreateView/application-services/utils.ts index 645e9bb77..160b972c6 100644 --- a/app/react/kubernetes/applications/CreateView/application-services/utils.ts +++ b/app/react/kubernetes/applications/CreateView/application-services/utils.ts @@ -1,7 +1,6 @@ import { compare } from 'fast-json-patch'; import { Service, ServiceSpec } from 'kubernetes-types/core/v1'; import { ObjectMeta } from 'kubernetes-types/meta/v1'; -import angular from 'angular'; import { Ingress as IngressFormValues } from '@/react/kubernetes/ingresses/types'; @@ -88,7 +87,7 @@ export function generateNewIngressesFromFormPaths( } // remove the old paths from the newIngresses copy - const newIngresses: IngressFormValues[] = angular.copy(oldIngresses) ?? []; // the current jest version doesn't support structured cloning, so we need to use angular.copy + const newIngresses = structuredClone(oldIngresses) ?? []; oldIngressPaths?.forEach((oldIngressPath) => { if (!oldIngressPath?.Path) return; const newMatchingIng = newIngresses?.find(