-
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: adapt Products List component to not display failed products (#1408
) * if a product REST call returns with an error (e.g. if the product is set to offline in ICM or if it does not exist at all) the product is marked as failed in the PWA state management * such failed products are now filtered and no longer rendered by the generic Products List component * the Product Tile and the Product Row component no longer render failed products as well * Products List component now maps the ProductContextDisplayProperties configuration as listItemConfiguration
- Loading branch information
1 parent
f952dc9
commit ff4f2e7
Showing
8 changed files
with
163 additions
and
106 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
1 change: 0 additions & 1 deletion
1
src/app/shared/components/product/product-item/product-item.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
104 changes: 53 additions & 51 deletions
104
src/app/shared/components/product/product-row/product-row.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,70 +1,72 @@ | ||
<div *ngIf="product$ | async as product" class="product-tile-list row" [attr.data-testing-sku]="product.sku"> | ||
<div class="col-3 col-md-2"> | ||
<div class="product-image-container"> | ||
<ish-product-image imageType="S" [link]="true"></ish-product-image> | ||
<ish-product-label></ish-product-label> | ||
<ng-container *ngIf="product$ | async as product"> | ||
<div *ngIf="!product.failed" class="product-tile-list row" [attr.data-testing-sku]="product.sku"> | ||
<div class="col-3 col-md-2"> | ||
<div class="product-image-container"> | ||
<ish-product-image imageType="S" [link]="true"></ish-product-image> | ||
<ish-product-label></ish-product-label> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="col-9 col-md-10"> | ||
<div class="row"> | ||
<div class="col-md-7"> | ||
<ish-product-name></ish-product-name> | ||
<div class="col-9 col-md-10"> | ||
<div class="row"> | ||
<div class="col-md-7"> | ||
<ish-product-name></ish-product-name> | ||
|
||
<ish-lazy-product-rating [hideNumberOfReviews]="true"></ish-lazy-product-rating> | ||
<ish-lazy-product-rating [hideNumberOfReviews]="true"></ish-lazy-product-rating> | ||
|
||
<ish-product-id></ish-product-id> | ||
<ish-product-id></ish-product-id> | ||
|
||
<div | ||
*ngIf="configuration$('description') | async" | ||
class="product-description" | ||
[ishServerHtml]="product.shortDescription" | ||
></div> | ||
<div | ||
*ngIf="configuration$('description') | async" | ||
class="product-description" | ||
[ishServerHtml]="product.shortDescription" | ||
></div> | ||
|
||
<ish-product-promotion displayType="simpleWithDetail"></ish-product-promotion> | ||
<ish-product-promotion displayType="simpleWithDetail"></ish-product-promotion> | ||
|
||
<div class="product-tile-actions btn-group"> | ||
<ish-lazy-product-add-to-quote displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-quote> | ||
<ish-lazy-product-add-to-compare displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-compare> | ||
<ish-lazy-product-add-to-wishlist displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-wishlist> | ||
<ish-lazy-product-add-to-order-template | ||
displayType="icon" | ||
cssClass="btn-link" | ||
></ish-lazy-product-add-to-order-template> | ||
<div class="product-tile-actions btn-group"> | ||
<ish-lazy-product-add-to-quote displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-quote> | ||
<ish-lazy-product-add-to-compare displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-compare> | ||
<ish-lazy-product-add-to-wishlist displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-wishlist> | ||
<ish-lazy-product-add-to-order-template | ||
displayType="icon" | ||
cssClass="btn-link" | ||
></ish-lazy-product-add-to-order-template> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="col-12 col-md-5 text-md-right"> | ||
<ish-product-price [showInformationalPrice]="true"></ish-product-price> | ||
<ish-product-inventory></ish-product-inventory> | ||
<ish-product-shipment></ish-product-shipment> | ||
<div class="col-12 col-md-5 text-md-right"> | ||
<ish-product-price [showInformationalPrice]="true"></ish-product-price> | ||
<ish-product-inventory></ish-product-inventory> | ||
<ish-product-shipment></ish-product-shipment> | ||
|
||
<ish-product-item-variations></ish-product-item-variations> | ||
<ish-product-item-variations></ish-product-item-variations> | ||
|
||
<div class="product-list-actions-container"> | ||
<ish-lazy-tacton-configure-product displayType="list-button"></ish-lazy-tacton-configure-product> | ||
<div class="product-list-actions-container"> | ||
<ish-lazy-tacton-configure-product displayType="list-button"></ish-lazy-tacton-configure-product> | ||
|
||
<div class="product-form form-horizontal row"> | ||
<ng-container *ngIf="configuration$('readOnly') | async; else quantityInput"> | ||
<div class="action-container col-12 col-xl-7"> | ||
<span *ngIf="configuration$('quantity') | async" | ||
>{{ 'product.quantity.label' | translate }}: {{ quantity$ | async }}</span | ||
> | ||
</div> | ||
</ng-container> | ||
<ng-template #quantityInput> | ||
<div class="action-container col-6 offset-md-6 col-lg-5 offset-lg-0"> | ||
<ish-product-quantity></ish-product-quantity> | ||
</div> | ||
</ng-template> | ||
<div class="product-form form-horizontal row"> | ||
<ng-container *ngIf="configuration$('readOnly') | async; else quantityInput"> | ||
<div class="action-container col-12 col-xl-7"> | ||
<span *ngIf="configuration$('quantity') | async" | ||
>{{ 'product.quantity.label' | translate }}: {{ quantity$ | async }}</span | ||
> | ||
</div> | ||
</ng-container> | ||
<ng-template #quantityInput> | ||
<div class="action-container col-6 offset-md-6 col-lg-5 offset-lg-0"> | ||
<ish-product-quantity></ish-product-quantity> | ||
</div> | ||
</ng-template> | ||
|
||
<div class="action-container addtocart-container col-12 col-lg-7"> | ||
<ish-product-add-to-basket></ish-product-add-to-basket> | ||
<ish-product-choose-variation></ish-product-choose-variation> | ||
<div class="action-container addtocart-container col-12 col-lg-7"> | ||
<ish-product-add-to-basket></ish-product-add-to-basket> | ||
<ish-product-choose-variation></ish-product-choose-variation> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-container> |
48 changes: 25 additions & 23 deletions
48
src/app/shared/components/product/product-tile/product-tile.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,30 +1,32 @@ | ||
<div *ngIf="product$ | async as product" class="product-tile" [attr.data-testing-sku]="product.sku"> | ||
<div class="product-image-container"> | ||
<ish-product-image imageType="M" [link]="true"></ish-product-image> | ||
<ish-product-label></ish-product-label> | ||
</div> | ||
<ng-container *ngIf="product$ | async as product"> | ||
<div *ngIf="!product.failed" class="product-tile" [attr.data-testing-sku]="product.sku"> | ||
<div class="product-image-container"> | ||
<ish-product-image imageType="M" [link]="true"></ish-product-image> | ||
<ish-product-label></ish-product-label> | ||
</div> | ||
|
||
<ish-product-name></ish-product-name> | ||
<ish-product-name></ish-product-name> | ||
|
||
<ish-lazy-product-rating [hideNumberOfReviews]="true"></ish-lazy-product-rating> | ||
<ish-lazy-product-rating [hideNumberOfReviews]="true"></ish-lazy-product-rating> | ||
|
||
<ish-product-promotion displayType="simple"></ish-product-promotion> | ||
<ish-product-promotion displayType="simple"></ish-product-promotion> | ||
|
||
<div *ngIf="configuration$('price') | async" class="price-container"> | ||
<ish-product-price [showInformationalPrice]="true"></ish-product-price> | ||
</div> | ||
<div *ngIf="configuration$('price') | async" class="price-container"> | ||
<ish-product-price [showInformationalPrice]="true"></ish-product-price> | ||
</div> | ||
|
||
<ish-product-item-variations></ish-product-item-variations> | ||
<ish-product-item-variations></ish-product-item-variations> | ||
|
||
<div class="product-tile-actions btn-group"> | ||
<ish-lazy-tacton-configure-product displayType="icon"></ish-lazy-tacton-configure-product> | ||
<ish-lazy-product-add-to-quote displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-quote> | ||
<ish-lazy-product-add-to-compare displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-compare> | ||
<ish-lazy-product-add-to-order-template | ||
[cssClass]="'btn btn-link mr-0'" | ||
displayType="icon" | ||
></ish-lazy-product-add-to-order-template> | ||
<ish-lazy-product-add-to-wishlist cssClass="btn-link" displayType="icon"></ish-lazy-product-add-to-wishlist> | ||
<ish-product-add-to-basket displayType="icon" cssClass="btn-link"></ish-product-add-to-basket> | ||
<div class="product-tile-actions btn-group"> | ||
<ish-lazy-tacton-configure-product displayType="icon"></ish-lazy-tacton-configure-product> | ||
<ish-lazy-product-add-to-quote displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-quote> | ||
<ish-lazy-product-add-to-compare displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-compare> | ||
<ish-lazy-product-add-to-order-template | ||
[cssClass]="'btn btn-link mr-0'" | ||
displayType="icon" | ||
></ish-lazy-product-add-to-order-template> | ||
<ish-lazy-product-add-to-wishlist cssClass="btn-link" displayType="icon"></ish-lazy-product-add-to-wishlist> | ||
<ish-product-add-to-basket displayType="icon" cssClass="btn-link"></ish-product-add-to-basket> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-container> |
48 changes: 31 additions & 17 deletions
48
src/app/shared/components/product/products-list/products-list.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,19 +1,33 @@ | ||
<ng-container *ngIf="listStyle === 'carousel'; else plainList"> | ||
<div class="product-list"> | ||
<swiper [config]="swiperConfig"> | ||
<ng-template *ngFor="let sku of productSKUs" swiperSlide> | ||
<div [ngClass]="listItemCSSClass"> | ||
<ish-product-item ishProductContext [sku]="sku" [displayType]="listItemStyle"></ish-product-item> | ||
<ng-container *ngIf="productSKUs$ | async as products"> | ||
<ng-container *ngIf="products.length"> | ||
<ng-container *ngIf="listStyle === 'carousel'; else plainList"> | ||
<div class="product-list"> | ||
<swiper [config]="swiperConfig"> | ||
<ng-template *ngFor="let sku of products" swiperSlide> | ||
<div [ngClass]="listItemCSSClass"> | ||
<ish-product-item | ||
ishProductContext | ||
[sku]="sku" | ||
[configuration]="listItemConfiguration" | ||
[displayType]="listItemStyle" | ||
></ish-product-item> | ||
</div> | ||
</ng-template> | ||
</swiper> | ||
</div> | ||
</ng-container> | ||
|
||
<ng-template #plainList> | ||
<div class="product-list row"> | ||
<div *ngFor="let sku of products" class="product-list-item" [ngClass]="listItemCSSClass"> | ||
<ish-product-item | ||
ishProductContext | ||
[sku]="sku" | ||
[configuration]="listItemConfiguration" | ||
[displayType]="listItemStyle" | ||
></ish-product-item> | ||
</div> | ||
</ng-template> | ||
</swiper> | ||
</div> | ||
</div> | ||
</ng-template> | ||
</ng-container> | ||
</ng-container> | ||
|
||
<ng-template #plainList> | ||
<div class="product-list row"> | ||
<div *ngFor="let sku of productSKUs" class="product-list-item" [ngClass]="listItemCSSClass"> | ||
<ish-product-item ishProductContext [sku]="sku" [displayType]="listItemStyle"></ish-product-item> | ||
</div> | ||
</div> | ||
</ng-template> |
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
Oops, something went wrong.