diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e048cb41..732d0e5182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ Our versioning strategy is as follows: - Minor: may include breaking changes in framework packages (e.g. framework upgrades, new features, improvements) - Major: may include breaking changes in core packages (e.g. major architectural changes, major features) +## Unreleased + +### 🐛 Bug Fixes + +* `[sitecore-jss-nextjs]` Fix loop error in redirect middleware when the pattern of redirect has default locale. ([#1696](https://github.com/Sitecore/jss/pull/1696)) +* `[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)) + ## 21.5.2 ### 🎉 New Features & Improvements diff --git a/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/_app.scss b/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/_app.scss index c86027153c..22ded5b85d 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/_app.scss +++ b/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/_app.scss @@ -100,7 +100,3 @@ ul li { color:#fff; max-width: 500px; } - -.editing-mode { - padding: 0 8px; -} diff --git a/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/abstracts/_mixins.scss b/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/abstracts/_mixins.scss index 46524483b9..83670c8a56 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/abstracts/_mixins.scss +++ b/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/abstracts/_mixins.scss @@ -2,7 +2,7 @@ /* breakpoints */ -$break-desktop: 1100px; +$break-desktop: 1024px; $break-mobile: 380px; $break-mobile-horizontal: 640px; $break-mobile-large: 992px; diff --git a/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/components/_component-container.scss b/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/components/_component-container.scss index 5b3b15ea40..d4b62d02b2 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/components/_component-container.scss +++ b/packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sass/components/_component-container.scss @@ -1,11 +1,17 @@ @import '@sass/abstracts/mixins'; +$size-padding: 8px; .container-wrapper { width: 100%; } .component { position: relative; + padding: 0 $size-padding; + + @include respond-to(all-mobile) { + padding: 0; + } } .container { @@ -18,5 +24,4 @@ .component-content { @include clearfix(); } - } diff --git a/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts b/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts index 4833e35ba3..7cb8445358 100644 --- a/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts +++ b/packages/sitecore-jss-nextjs/src/middleware/redirects-middleware.ts @@ -169,9 +169,12 @@ export class RedirectsMiddleware extends MiddlewareBase { const redirects = await this.redirectsService.fetchRedirects(siteName); const tragetURL = req.nextUrl.pathname; const targetQS = req.nextUrl.search || ''; + const language = this.getLanguage(req); + const modifyRedirects = JSON.parse(JSON.stringify(redirects)); - return redirects.length - ? redirects.find((redirect: RedirectInfo) => { + return modifyRedirects.length + ? modifyRedirects.find((redirect: RedirectInfo) => { + redirect.pattern = redirect.pattern.replace(RegExp(`^[^]?/${language}/`, 'gi'), ''); redirect.pattern = `/^\/${redirect.pattern .replace(/^\/|\/$/g, '') .replace(/^\^\/|\/\$$/g, '')