Skip to content

Commit

Permalink
update using feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
petarmarkov9449 committed Oct 9, 2024
1 parent bf28b7c commit d6ac77d
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 6 deletions.
3 changes: 2 additions & 1 deletion feature-libs/cart/base/assets/translations/en/cart.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"description": "Description",
"item": "Item",
"itemPrice": "Item price",
"quantity": "Quantity",
"quantity": "Qty",
"quantityFull": "Quantity",
"quantityTitle": "The quantity represents the total number of this item in your cart.",
"total": "Total",
"actions": "Actions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
<!-- Item Quantity -->
<td role="cell" class="cx-quantity">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-mobile-header"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-mobile-header"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { Component, inject } from '@angular/core';
import { CartItemContext } from '@spartacus/cart/base/root';
import { useFeatureStyles } from '@spartacus/core';
import { CartItemComponent } from '../cart-item/cart-item.component';
import { CartItemContextSource } from '../cart-item/model/cart-item-context-source.model';
import { CartItemListComponentService } from './cart-item-list-row.component.service';
Expand All @@ -23,5 +24,6 @@ export class CartItemListRowComponent extends CartItemComponent {
isFlagQuote = this.componentService.showBasePriceWithDiscount();
constructor(cartItemContextSource: CartItemContextSource) {
super(cartItemContextSource);
useFeatureStyles('a11yQTY2Quantity');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@
[cxOutlet]="CartOutlets.CPQ_QUOTE_HEADING"
[cxOutletContext]="items"
></ng-template>
<th role="columnheader" class="cx-item-list-qty">
<th
*cxFeature="'a11yQTY2Quantity'"
role="columnheader"
class="cx-item-list-qty"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</th>
<th
*cxFeature="'!a11yQTY2Quantity'"
role="columnheader"
class="cx-item-list-qty"
>
{{ 'cartItems.quantity' | cxTranslate }}
</th>
<ng-container *ngIf="options.isSaveForLater; else totalHeader">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@
<!-- Item Quantity -->
<div class="cx-quantity" [ngClass]="compact ? '' : ' col-3'">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-label"
[ngClass]="compact ? '' : ' d-block d-md-none d-lg-none d-xl-none'"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</div>
<div
*cxFeature=""
class="cx-label"
[ngClass]="compact ? '' : ' d-block d-md-none d-lg-none d-xl-none'"
placement="left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
OrderEntry,
PromotionLocation,
} from '@spartacus/cart/base/root';
import { useFeatureStyles } from '@spartacus/core';
import { ICON_TYPE } from '@spartacus/storefront';
import { CartItemContextSource } from './model/cart-item-context-source.model';
import { useFeatureStyles } from '@spartacus/core';

@Component({
selector: 'cx-cart-item',
Expand Down Expand Up @@ -45,6 +45,7 @@ export class CartItemComponent implements OnChanges {

constructor(protected cartItemContextSource: CartItemContextSource) {
useFeatureStyles('a11yCartItemsLinksStyles');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnChanges(changes?: SimpleChanges) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@
<div class="cx-price-header col-md-2">
{{ 'cartItems.itemPrice' | cxTranslate }}
</div>
<div class="cx-quantity-header col-md-1">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-quantity-header col-md-1"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-quantity-header col-md-1"
>
{{ 'cartItems.quantity' | cxTranslate }}
</div>
<div class="cx-total-header col-md-2">
Expand Down Expand Up @@ -116,6 +125,16 @@
>
<div class="cx-value">
<span
*cxFeature="'a11yQTY2Quantity'"
class="cx-label"
[ngClass]="'d-md-none d-lg-none d-xl-none'"
placement="left"
title="{{ 'cartItems.quantityTitle' | cxTranslate }}"
>
{{ 'cartItems.quantityFull' | cxTranslate }}
</span>
<span
*cxFeature="'!a11yQTY2Quantity'"
class="cx-label"
[ngClass]="'d-md-none d-lg-none d-xl-none'"
placement="left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Input,
OnInit,
} from '@angular/core';
import { CmsPickupItemDetails } from '@spartacus/core';
import { CmsPickupItemDetails, useFeatureStyles } from '@spartacus/core';
import { DeliveryPointOfService } from '@spartacus/pickup-in-store/root';
import { CmsComponentData, ICON_TYPE } from '@spartacus/storefront';
import { Observable } from 'rxjs';
Expand All @@ -32,7 +32,9 @@ export class PickUpItemsDetailsComponent implements OnInit {
constructor(
protected component: CmsComponentData<CmsPickupItemDetails>,
protected deliveryPointsService: DeliveryPointsService
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}
ngOnInit() {
this.component.data$
.pipe(
Expand Down

0 comments on commit d6ac77d

Please sign in to comment.