Skip to content

Commit

Permalink
Merge pull request #1699 from Sitecore/hotfix/21.0.0/jss-1401-fix-red…
Browse files Browse the repository at this point in the history
…irects-sxa

JSS 21.5.3 release fixes, adjust SXA fix for node 16
  • Loading branch information
art-alexeyenko authored Dec 20, 2023
2 parents bfa0eb6 + 25788dd commit acacbac
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,3 @@ ul li {
color:#fff;
max-width: 500px;
}

.editing-mode {
padding: 0 8px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* breakpoints */

$break-desktop: 1100px;
$break-desktop: 1024px;
$break-mobile: 380px;
$break-mobile-horizontal: 640px;
$break-mobile-large: 992px;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -18,5 +24,4 @@
.component-content {
@include clearfix();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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, '')
Expand Down

0 comments on commit acacbac

Please sign in to comment.