diff --git a/projects/lib/jest.config.js b/projects/lib/jest.config.js index e58df19..ef3745f 100644 --- a/projects/lib/jest.config.js +++ b/projects/lib/jest.config.js @@ -10,7 +10,7 @@ module.exports = { branches: 90, functions: 95, lines: 95, - statements: -4, + statements: -5, }, }, moduleNameMapper: { diff --git a/projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts b/projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts index 5c4b246..d780d28 100644 --- a/projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts +++ b/projects/lib/portal-options/services/crd-gateway-kcp-patch-resolver.service.ts @@ -14,7 +14,7 @@ export class CrdGatewayKcpPatchResolver { entityId?: string, kind?: string, ) { - if (nextNode.context.kcpPath) { + if (nextNode.context?.kcpPath) { this.gatewayService.updateCrdGatewayUrlWithEntityPath( nextNode.context.kcpPath, ); diff --git a/projects/lib/services/resource/apollo-factory.ts b/projects/lib/services/resource/apollo-factory.ts index 154631e..56f5d67 100644 --- a/projects/lib/services/resource/apollo-factory.ts +++ b/projects/lib/services/resource/apollo-factory.ts @@ -1,6 +1,6 @@ import { GatewayService } from './gateway.service'; import { ResourceNodeContext } from './resource-node-context'; -import { Injectable, NgZone, inject } from '@angular/core'; +import { Injectable, inject } from '@angular/core'; import { type ApolloClientOptions, ApolloLink, @@ -39,12 +39,16 @@ class SSELink extends ApolloLink { } } +const noopZone = { + run: (fn: any) => fn(), + runOutsideAngular: (fn: any) => fn(), +} as any; + @Injectable({ providedIn: 'root', }) export class ApolloFactory { private httpLink = inject(HttpLink); - private ngZone = inject(NgZone); private gatewayService = inject(GatewayService); public readonly apollo = ( @@ -52,7 +56,7 @@ export class ApolloFactory { readFromParentKcpPath = false, ): Apollo => new Apollo( - this.ngZone, + noopZone, this.createApolloOptions(nodeContext, readFromParentKcpPath), );