-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rework product-item-variations component (#1648)
BREAKING CHANGE: The `ish-product-item-variations` component has been refactored.
- Loading branch information
Showing
8 changed files
with
155 additions
and
114 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
33 changes: 13 additions & 20 deletions
33
.../shared/components/product/product-item-variations/product-item-variations.component.html
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,24 +1,17 @@ | ||
<ng-container *ngIf="variationCount$ | async as variationCount; else variationProduct"> | ||
<span class="product-variation read-only">{{ variationCount }} {{ 'product.variations.text' | translate }}</span> | ||
<ng-container *ngIf="isMasterProduct$ | async"> | ||
<span class="product-variation read-only"> | ||
{{ 'product.variations.text' | translate : { '0': variationCount$ | async } }} | ||
</span> | ||
</ng-container> | ||
<ng-template #variationProduct> | ||
<div *ngIf="visible$ | async" class="product-variation-container"> | ||
<ng-container | ||
*ngIf=" | ||
'preferences.ChannelPreferences.EnableAdvancedVariationHandling' | ishServerSetting; | ||
else normalVariationDisplay | ||
" | ||
> | ||
<ish-product-variation-display /> | ||
</ng-container> | ||
<ng-template #normalVariationDisplay> | ||
<ng-container *ngIf="isVariationProduct$ | async"> | ||
<ng-container *ngIf="visible$ | async"> | ||
<div class="product-variation-container"> | ||
<ng-container *ngIf="readOnly$ | async; else variationSelect"> | ||
<ish-product-variation-display /> | ||
</ng-container> | ||
</ng-template> | ||
</div> | ||
|
||
<ng-template #variationSelect> | ||
<ish-product-variation-select /> | ||
</ng-template> | ||
</ng-template> | ||
<ng-template #variationSelect> | ||
<ish-product-variation-select /> | ||
</ng-template> | ||
</div> | ||
</ng-container> | ||
</ng-container> |
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
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
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