diff --git a/docs/guides/migrations.md b/docs/guides/migrations.md index 4137765856..9a41800323 100644 --- a/docs/guides/migrations.md +++ b/docs/guides/migrations.md @@ -26,6 +26,13 @@ If in a project other header types are used these header types and the rendering With the introduction of the new [navigation CMS components](../concepts/cms-integration.md#navigation-cms-components) it became necessary to adapt the main navigation styling. The styling can no longer rely on child selectors (`>`) since the CMS manged components introduce a lot of additional HTML tags around the styling relevant `li` tags. +To improve the performance of the 'Static Content Page' component the triggered `/pagetree` REST calls default behavior regarding the used `depth` was changed. +In the past no given 'Navigation Depth' in the ICM backend configuration resulted in no limitation at all ("Define how many levels the navigation tree displays. +To show all levels, leave the field empty."). +With the content model adaptions of `icm-as-customization-headless:1.7.0` a depth default value of `5` was introduced and the description was changed accordingly. +In the PWA the rendering was adapted as well so that an empty `NavigationDepth` value of the 'Static Content Page' component now defaults to `0` instead of no depth limitation, that resulted in the whole content page tree being fetched and saved to the state. +To keep the current behavior in an existing project either adapt the `0` default in `pagelet.numberParam('NavigationDepth', 0)"` to a reasonable number or set the 'Navigation Depth' values for all 'Static Content Page' component instances in the ICM backend to reasonable depth values instead of leaving them empty. + ## From 4.2 to 5.0 Starting with the Intershop PWA 5.0 we develop and test against an Intershop Commerce Management 11 server. diff --git a/src/app/core/facades/cms.facade.ts b/src/app/core/facades/cms.facade.ts index 4a40816a74..33501dd05b 100644 --- a/src/app/core/facades/cms.facade.ts +++ b/src/app/core/facades/cms.facade.ts @@ -44,7 +44,8 @@ export class CMSFacade { } contentPageTree$(rootId: string, depth: number) { - this.store.dispatch(loadContentPageTree({ rootId, depth })); + // fetch only the depth that is actually needed, depth=0 returns already the next child level + this.store.dispatch(loadContentPageTree({ rootId, depth: depth > 0 ? depth - 1 : 0 })); return this.store.pipe(select(getContentPageTree(rootId))); } diff --git a/src/app/shared/cms/components/cms-static-page/cms-static-page.component.html b/src/app/shared/cms/components/cms-static-page/cms-static-page.component.html index 8664212483..3562597168 100644 --- a/src/app/shared/cms/components/cms-static-page/cms-static-page.component.html +++ b/src/app/shared/cms/components/cms-static-page/cms-static-page.component.html @@ -8,7 +8,7 @@ diff --git a/src/app/shared/cms/components/cms-static-page/cms-static-page.component.ts b/src/app/shared/cms/components/cms-static-page/cms-static-page.component.ts index 31b81c0c6e..4394eaca00 100644 --- a/src/app/shared/cms/components/cms-static-page/cms-static-page.component.ts +++ b/src/app/shared/cms/components/cms-static-page/cms-static-page.component.ts @@ -26,11 +26,13 @@ export class CMSStaticPageComponent implements CMSComponent, OnChanges { if (this.pagelet?.stringParam('NavigationRoot')) { this.contentPageTree$ = this.cmsFacade.contentPageTree$( this.pagelet.stringParam('NavigationRoot'), - this.pagelet.numberParam('NavigationDepth') + this.pagelet.numberParam('NavigationDepth', 0) ); } - // explicitly set breadcrumb data for content pages that use the Static Content Page Component + // explicitly set breadcrumb data for content pages that use the Static Content component + // to have the complete breadcrumb data it is necessary that the content page tree + // was fetched for the given 'NavigationRoot' even if the navigation is not shown in the side panel this.cmsFacade.setBreadcrumbForContentPage(this.pagelet?.stringParam('NavigationRoot')); } } diff --git a/src/app/shared/cms/components/content-navigation/content-navigation.component.html b/src/app/shared/cms/components/content-navigation/content-navigation.component.html index 2fff21dcb4..95c6e9b36a 100644 --- a/src/app/shared/cms/components/content-navigation/content-navigation.component.html +++ b/src/app/shared/cms/components/content-navigation/content-navigation.component.html @@ -2,7 +2,7 @@ @@ -13,10 +13,7 @@ [ngClass]="{ 'page-navigation-active': treeNode.contentPageId === currentContentPage.id }" > {{ treeNode.name }} -