From 38029def26486f1739c1f6d9f68f9e99f63e8d09 Mon Sep 17 00:00:00 2001 From: Ruslan Matkovskyi Date: Thu, 26 Oct 2023 14:51:53 +0200 Subject: [PATCH 1/4] #597453: [sitecore-jss-react] fixed rendering with two and more dynamic placeholders --- .../sitecore-jss-react/src/components/PlaceholderCommon.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx b/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx index a7f2bd0390..fbd7c831e5 100644 --- a/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx +++ b/packages/sitecore-jss-react/src/components/PlaceholderCommon.tsx @@ -136,7 +136,8 @@ export class PlaceholderCommon extends React.Compone Object.keys(rendering.placeholders).forEach((placeholder) => { if ( placeholder.indexOf('{*}') !== -1 && - !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) + !EXCLUDE_PLACEHOLDERS_RENDER.some((pattern) => name.search(pattern) !== -1) && + name.replace(/[^a-zA-Z]*/gi, '') === placeholder.replace(/[^a-zA-Z]*/gi, '') ) { rendering.placeholders[name] = rendering.placeholders[placeholder]; delete rendering.placeholders[placeholder]; From 3a694623adf3d714a9a942bb336a33925a9a88a8 Mon Sep 17 00:00:00 2001 From: Ruslan Matkovskyi Date: Thu, 26 Oct 2023 15:30:54 +0200 Subject: [PATCH 2/4] #597453: changed CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88f1a1ea3..482ff9f097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Our versioning strategy is as follows: * `[templates/nextjs]` Import SitecoreForm component into sample nextjs app ([#1628](https://github.com/Sitecore/jss/pull/1628)) * `[sitecore-jss-nextjs]` (Vercel/Sitecore) Deployment Protection Bypass support for editing integration. ([#1634](https://github.com/Sitecore/jss/pull/1634)) * `[templates/nextjs]` Fix custom headers. Now in cors-header plugin extends custom headers from next.config.js file. ([#1637](https://github.com/Sitecore/jss/pull/1637)) +* `[sitecore-jss-react]` Fix PlaceholderCommon with using two and more dynamic placeholders. ([#1641](https://github.com/Sitecore/jss/pull/1641)) ### 🐛 Bug Fixes From 77a74c7d107eb55d2ee887b081e2ac11721bc5df Mon Sep 17 00:00:00 2001 From: Ruslan Matkovskyi Date: Fri, 27 Oct 2023 00:20:30 +0200 Subject: [PATCH 3/4] #597453: fixed test --- packages/sitecore-jss-react/src/components/Placeholder.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sitecore-jss-react/src/components/Placeholder.test.tsx b/packages/sitecore-jss-react/src/components/Placeholder.test.tsx index 00351e7b36..b01e72ac64 100644 --- a/packages/sitecore-jss-react/src/components/Placeholder.test.tsx +++ b/packages/sitecore-jss-react/src/components/Placeholder.test.tsx @@ -314,7 +314,7 @@ describe('', () => { it('should render with container-{*} type dynamic placeholder', () => { const component = sxaRenderingCommonContainerName.sitecore.route as RouteData; - const phKey = 'richText'; + const phKey = 'container-1'; const renderedComponent = mount( From 29928abd7f5bd22b9a6e25bb79e444577bd945c0 Mon Sep 17 00:00:00 2001 From: Ruslan Matkovskyi Date: Fri, 27 Oct 2023 12:19:28 +0200 Subject: [PATCH 4/4] #597453: fixed CHANGELOG --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 482ff9f097..ee0cd8e6cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,14 +16,15 @@ Our versioning strategy is as follows: * `[templates/nextjs]` Enable client-only BYOC component imports. Client-only components can be imported through src/byoc/index.client.ts. Hybrid (server render with client hydration) components can be imported through src/byoc/index.hybrid.ts. BYOC scaffold logic is also moved from nextjs-sxa addon into base template ([#1628](https://github.com/Sitecore/jss/pull/1628)[#1636](https://github.com/Sitecore/jss/pull/1636)) * `[templates/nextjs]` Import SitecoreForm component into sample nextjs app ([#1628](https://github.com/Sitecore/jss/pull/1628)) * `[sitecore-jss-nextjs]` (Vercel/Sitecore) Deployment Protection Bypass support for editing integration. ([#1634](https://github.com/Sitecore/jss/pull/1634)) -* `[templates/nextjs]` Fix custom headers. Now in cors-header plugin extends custom headers from next.config.js file. ([#1637](https://github.com/Sitecore/jss/pull/1637)) -* `[sitecore-jss-react]` Fix PlaceholderCommon with using two and more dynamic placeholders. ([#1641](https://github.com/Sitecore/jss/pull/1641)) ### 🐛 Bug Fixes * `[sitecore-jss-proxy]` Setting "followRedirects" to "true" breaks HEAD requests ([#1630](https://github.com/Sitecore/jss/pull/1630)) * `[templates/nextjs-sxa]` Fix shown horizontal scrollbar in EE mode. ([#1625](https://github.com/Sitecore/jss/pull/1625)), ([#1626](https://github.com/Sitecore/jss/pull/1626)) * `[sitecore-jss-nextjs]` Fix issue when redirects works each every other times. ([#1629](https://github.com/Sitecore/jss/pull/1629)) +* `[templates/nextjs]` Fix custom headers. Now in cors-header plugin extends custom headers from next.config.js file. ([#1637](https://github.com/Sitecore/jss/pull/1637)) +* `[sitecore-jss-react]` Fix PlaceholderCommon with using two and more dynamic placeholders. ([#1641](https://github.com/Sitecore/jss/pull/1641)) + ## 21.5.0