-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display of duplicated headers for special logins with activated …
…hydration (#1585) * when logging in with cobrowse or punchout two headers where rendered for a short time * (the simple header of the loading page and the standard header once the user was logged in) * the hydration introduced with Angular 16 introduced this issue * switching from the usage of ngSwitch to ngIf solved the rendering problem * fix: add headerType checks and with that fallback to the default header for unknown header types * fix: add migration note for changed header rendering and introduced header types BREAKING CHANGES: Changed header rendering and introduced header type (see [Migrations / From 5.0 to 5.1](https://github.com/intershop/intershop-pwa/blob/develop/docs/guides/migrations.md#from-50-to-51) for more details).
- Loading branch information
Showing
5 changed files
with
24 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export type ViewType<T extends string = ''> = T | ('grid' | 'list'); | ||
|
||
export type DeviceType<T extends string = ''> = T | ('mobile' | 'tablet' | 'desktop'); | ||
|
||
export const headerTypes = <const>['simple', 'error', 'checkout']; | ||
|
||
export type HeaderType = (typeof headerTypes)[number]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<ng-container [ngSwitch]="headerType$ | async"> | ||
<ish-header-error *ngSwitchCase="'error'" /> | ||
<ish-header-simple *ngSwitchCase="'simple'" /> | ||
<ish-header-checkout *ngSwitchCase="'checkout'" /> | ||
|
||
<ng-container *ngSwitchDefault> | ||
<ish-header-default [isSticky]="isSticky$ | async" [deviceType]="deviceType$ | async" [reset]="reset$ | async" /> | ||
</ng-container> | ||
<!-- using ngIf instead of ngSwitch to resolve an issue with hydration and duplicate headers for special logins --> | ||
<ng-container *ngIf="headerType$ | async as headerType; else defaultHeader"> | ||
<ish-header-simple *ngIf="headerType === 'simple'" /> | ||
<ish-header-error *ngIf="headerType === 'error'" /> | ||
<ish-header-checkout *ngIf="headerType === 'checkout'" /> | ||
</ng-container> | ||
|
||
<ng-template #defaultHeader> | ||
<ish-header-default [isSticky]="isSticky$ | async" [deviceType]="deviceType$ | async" [reset]="reset$ | async" /> | ||
</ng-template> | ||
|
||
<ish-back-to-top /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters