Skip to content

Commit

Permalink
fix: rename component inputs named 'class' to 'cssClass' (#975)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The input parameter `class` was changed to `cssClass` for the following components: `ish-basket-create-order-template`,`ish-lazy-basket-create-order-template`, `ish-lazy-product-add-to-order-template`,`ish-lazy-product-add-to-quote`, `ish-lazy-product-add-to-wishlist`, `ish-product-add-to-basket`, `ish-product-add-to-compare`, `ish-product-add-to-order-template`, `ish-product-add-to-quote`, `ish-product-add-to-wishlist`. All uses of these components need to be adapted in custom code.
  • Loading branch information
suschneider authored Jan 10, 2022
1 parent 44111ab commit 892a1ef
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1>
</div>
<ish-product-add-to-basket
*ngIf="orderTemplate.itemsCount"
[class]="'btn btn-primary float-right'"
[cssClass]="'btn btn-primary float-right'"
></ish-product-add-to-basket>

<ng-template #noItems>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
ishProductContext
[parts]="getParts(orderTemplate)"
displayType="icon"
class="text-primary p-0"
cssClass="text-primary p-0"
></ish-product-add-to-basket>
</a>
<a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<button
type="submit"
name="addProduct"
[ngClass]="class"
[ngClass]="cssClass"
(click)="openModal(modal)"
data-testing-id="addBasketToOrderTemplateButton"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { OrderTemplatePreferencesDialogComponent } from '../order-template-prefe
@GenerateLazyComponent()
export class BasketCreateOrderTemplateComponent implements OnDestroy {
@Input() products: LineItemView[];
@Input() class?: string;
@Input() cssClass?: string;
private destroy$ = new Subject();

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ishProductContext
[parts]="getParts(orderTemplate)"
displayType="icon"
class="p-0 mb-0"
cssClass="p-0 mb-0"
></ish-product-add-to-basket>
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name="addProduct"
class="btn"
[disabled]="disabled$ | async"
[ngClass]="class"
[ngClass]="cssClass"
(click)="openModal(modal)"
data-testing-id="addToOrderTemplateButton"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { SelectOrderTemplateModalComponent } from '../select-order-template-moda
@GenerateLazyComponent()
export class ProductAddToOrderTemplateComponent implements OnDestroy, OnInit {
@Input() displayType?: 'icon' | 'link' | 'animated' = 'link';
@Input() class?: string;
@Input() cssClass?: string;

disabled$: Observable<boolean>;
visible$: Observable<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*ngIf="visible$ | async"
type="submit"
class="btn"
[ngClass]="class"
[ngClass]="cssClass"
[class.btn-secondary]="displayType !== 'icon'"
[disabled]="disabled$ | async"
[attr.title]="'quote.add_product_to_quote.button.add_to_quote.label' | translate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { GenerateLazyComponent } from 'ish-core/utils/module-loader/generate-laz
@GenerateLazyComponent()
export class ProductAddToQuoteComponent implements OnInit {
@Input() displayType?: 'icon' | 'link' = 'link';
@Input() class?: string;
@Input() cssClass?: string;

disabled$: Observable<boolean>;
visible$: Observable<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<ish-product-inventory></ish-product-inventory>
<div *ngIf="editable$ | async" class="d-flex align-items-center">
<ish-lazy-product-add-to-order-template
[class]="'btn btn-link btn-tool add-to-order-template'"
[cssClass]="'btn btn-link btn-tool add-to-order-template'"
displayType="icon"
></ish-lazy-product-add-to-order-template>
<ish-lazy-product-add-to-wishlist
[class]="'btn-link btn-tool ml-0'"
[cssClass]="'btn-link btn-tool ml-0'"
displayType="icon"
></ish-lazy-product-add-to-wishlist>
<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type="button"
name="addProduct"
class="btn add-to-wishlist"
[ngClass]="class"
[ngClass]="cssClass"
(click)="openModal(modal)"
data-testing-id="addToWishlistButton"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ import { SelectWishlistModalComponent } from '../select-wishlist-modal/select-wi
*
* @example
* <ish-product-add-to-wishlist
* [product]=product
* displayType="icon"
* ></ish-product-add-to-wishlist>
*/
@GenerateLazyComponent()
export class ProductAddToWishlistComponent implements OnDestroy, OnInit {
@Input() displayType?: 'icon' | 'link' | 'animated' = 'link';
@Input() class?: string;
@Input() cssClass?: string;

visible$: Observable<boolean>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1 class="d-flex flex-wrap align-items-baseline">
<ish-lazy-basket-add-to-quote></ish-lazy-basket-add-to-quote>
<ish-lazy-basket-create-order-template
*ngIf="basket"
[class]="'btn btn-secondary'"
[cssClass]="'btn btn-secondary'"
[products]="basket.lineItems"
></ish-lazy-basket-create-order-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ <h1>
</div>
</div>

<ish-product-add-to-basket [class]="'btn-lg btn-block'"></ish-product-add-to-basket>
<ish-product-add-to-basket [cssClass]="'btn-lg btn-block'"></ish-product-add-to-basket>

<ish-lazy-product-add-to-order-template
[class]="'btn btn-secondary btn-block'"
[cssClass]="'btn btn-secondary btn-block'"
></ish-lazy-product-add-to-order-template>

<ish-lazy-product-add-to-quote [class]="'btn-block'"></ish-lazy-product-add-to-quote>
<ish-lazy-product-add-to-quote [cssClass]="'btn-block'"></ish-lazy-product-add-to-quote>
</div>

<ish-product-detail-info-accordion></ish-product-detail-info-accordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
<div class="d-flex align-items-end">
<ish-lazy-product-add-to-order-template
*ngIf="editable"
[class]="'btn-link btn-tool pl-0 add-to-order-template'"
[cssClass]="'btn-link btn-tool pl-0 add-to-order-template'"
displayType="icon"
></ish-lazy-product-add-to-order-template>
<ish-lazy-product-add-to-wishlist
*ngIf="editable"
[class]="'btn-link btn-tool pl-0'"
[cssClass]="'btn-link btn-tool pl-0'"
displayType="icon"
></ish-lazy-product-add-to-wishlist>
<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type="submit"
name="addProduct"
class="btn"
[ngClass]="class"
[ngClass]="cssClass"
[class.btn-primary]="!displayIcon"
[disabled]="(hasQuantityError$ | async) || (displaySpinner$ | async)"
[attr.title]="translationKey$ | async | translate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { whenFalsy } from 'ish-core/utils/operators';
*
* @example
* <ish-product-add-to-basket
[class]="'btn-lg btn-block'"
[translationKey]="isRetailSet(product) ? 'product.add_to_cart.retailset.link' : 'product.add_to_cart.link'"
[cssClass]="'btn-lg btn-block'"
></ish-product-add-to-basket>
*/
@Component({
Expand All @@ -29,7 +28,7 @@ export class ProductAddToBasketComponent implements OnInit, OnDestroy {
/**
* additional css styling
*/
@Input() class?: string;
@Input() cssClass?: string;

basketLoading$: Observable<boolean>;
hasQuantityError$: Observable<boolean>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<button
*ngIf="(visible$ | async) && ('compare' | ishFeature)"
class="btn add-to-compare"
[ngClass]="class"
[ngClass]="cssClass"
[class.is-selected]="isInCompareList$ | async"
title="{{ 'product.compare.link' | translate }}"
(click)="toggleCompare()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ProductContextFacade } from 'ish-core/facades/product-context.facade';
* @example
* <ish-product-add-to-compare
* displayType="icon"
* class="btn-link"
* cssClass="btn-link"
* ></ish-product-add-to-compare>
*/
@Component({
Expand All @@ -19,7 +19,7 @@ import { ProductContextFacade } from 'ish-core/facades/product-context.facade';
})
export class ProductAddToCompareComponent implements OnInit {
@Input() displayType?: string;
@Input() class?: string;
@Input() cssClass?: string;

isInCompareList$: Observable<boolean>;
visible$: Observable<boolean>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<ish-product-promotion displayType="simpleWithDetail"></ish-product-promotion>

<div class="product-tile-actions btn-group">
<ish-lazy-product-add-to-quote displayType="icon" class="btn-link"></ish-lazy-product-add-to-quote>
<ish-product-add-to-compare displayType="icon" class="btn-link"></ish-product-add-to-compare>
<ish-lazy-product-add-to-wishlist displayType="icon" class="btn-link"></ish-lazy-product-add-to-wishlist>
<ish-lazy-product-add-to-quote displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-quote>
<ish-product-add-to-compare displayType="icon" cssClass="btn-link"></ish-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"
class="btn-link"
cssClass="btn-link"
></ish-lazy-product-add-to-order-template>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

<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" class="btn-link"></ish-lazy-product-add-to-quote>
<ish-product-add-to-compare displayType="icon" class="btn-link"></ish-product-add-to-compare>
<ish-lazy-product-add-to-quote displayType="icon" cssClass="btn-link"></ish-lazy-product-add-to-quote>
<ish-product-add-to-compare displayType="icon" cssClass="btn-link"></ish-product-add-to-compare>
<ish-lazy-product-add-to-order-template
[class]="'btn btn-link mr-0'"
[cssClass]="'btn btn-link mr-0'"
displayType="icon"
></ish-lazy-product-add-to-order-template>
<ish-lazy-product-add-to-wishlist class="btn-link" displayType="icon"></ish-lazy-product-add-to-wishlist>
<ish-product-add-to-basket displayType="icon" class="btn-link"></ish-product-add-to-basket>
<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>

0 comments on commit 892a1ef

Please sign in to comment.