From 960774b1a8330511a22eb21b8d8a93305e7cf270 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 31 Jul 2024 13:12:49 +0300 Subject: [PATCH 1/2] fix: providers/context --- .../domain/content/src/services/content.providers.ts | 6 ++++++ libs/domain/product/src/services/product-context.ts | 3 +-- package-lock.json | 12 ++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libs/domain/content/src/services/content.providers.ts b/libs/domain/content/src/services/content.providers.ts index bdd65b6e..abb28ba9 100644 --- a/libs/domain/content/src/services/content.providers.ts +++ b/libs/domain/content/src/services/content.providers.ts @@ -1,3 +1,4 @@ +import { provideEntity } from '@oryx-frontend/core'; import { Provider } from '@oryx-frontend/di'; import { ExperienceAdapter } from '@oryx-frontend/experience'; import { ContentExperienceAdapter } from './adapter'; @@ -6,6 +7,7 @@ import { storyblokProviders, strapiProviders, } from './cms'; +import { ContentContext } from './content-context'; import { ContentService } from './content.service'; import { DefaultContentService } from './default-content.service'; import { DefaultFontService, FontService } from './font'; @@ -26,4 +28,8 @@ export const contentProviders: Provider[] = [ ...contentfulProviders, ...storyblokProviders, ...strapiProviders, + provideEntity('content', { + service: ContentService, + context: ContentContext.Content, + }), ]; diff --git a/libs/domain/product/src/services/product-context.ts b/libs/domain/product/src/services/product-context.ts index 103a9168..ccf8e2eb 100644 --- a/libs/domain/product/src/services/product-context.ts +++ b/libs/domain/product/src/services/product-context.ts @@ -7,7 +7,7 @@ import { import { Provider, inject } from '@oryx-frontend/di'; import { RouteType, RouterService } from '@oryx-frontend/router'; import { featureVersion } from '@oryx-frontend/utilities'; -import { Observable, map, of, take } from 'rxjs'; +import { Observable, map, of } from 'rxjs'; import { PRODUCT } from '../entity'; import { ProductQualifier } from '../models'; @@ -36,7 +36,6 @@ export function productContextFallbackFactory( context = inject(ContextService) ): Observable { return router.current().pipe( - take(1), map((route) => route.type === RouteType.Product ? route.params : undefined ) diff --git a/package-lock.json b/package-lock.json index 37a7d340..c165e771 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44136,9 +44136,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -84184,9 +84184,9 @@ } }, "semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==" + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" }, "semver-compare": { "version": "1.0.0", From 29906a865324157e2e786589bf14abe96c8bcd86 Mon Sep 17 00:00:00 2001 From: Aleksey Belan Date: Wed, 31 Jul 2024 13:27:28 +0300 Subject: [PATCH 2/2] fix: format --- libs/domain/product/src/services/product-context.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/domain/product/src/services/product-context.ts b/libs/domain/product/src/services/product-context.ts index ccf8e2eb..7976dab3 100644 --- a/libs/domain/product/src/services/product-context.ts +++ b/libs/domain/product/src/services/product-context.ts @@ -35,11 +35,13 @@ export function productContextFallbackFactory( router = inject(RouterService), context = inject(ContextService) ): Observable { - return router.current().pipe( - map((route) => - route.type === RouteType.Product ? route.params : undefined - ) - ); + return router + .current() + .pipe( + map((route) => + route.type === RouteType.Product ? route.params : undefined + ) + ); } export const ProductContextSerializerToken = `${ContextSerializer}${