Skip to content

Commit

Permalink
Merge branch 'develop' into feature/cxspa-8760
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhepS authored Oct 30, 2024
2 parents 1c6feea + 052291b commit 44cddaf
Show file tree
Hide file tree
Showing 55 changed files with 975 additions and 444 deletions.
1 change: 1 addition & 0 deletions feature-libs/asm/assets/translations/en/asm.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"row": {
"id": "ID",
"qty": "Qty",
"qtyFull": "Quantity",
"total": "Total"
},
"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ <h2 id="asm-save-cart-dialog-title" class="title modal-title">
</div>
<div class="cx-dialog-row row">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-dialog-item col-sm-6 col-md-6 text-right item-left-text"
>
{{ 'asm.saveCart.dialog.row.qtyFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-dialog-item col-sm-6 col-md-6 text-right item-left-text"
>
{{ 'asm.saveCart.dialog.row.qty' | cxTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { Component, OnInit } from '@angular/core';
import { Cart } from '@spartacus/cart/base/root';
import { SavedCartFacade } from '@spartacus/cart/saved-cart/root';
import { GlobalMessageType } from '@spartacus/core';
import { GlobalMessageType, useFeatureStyles } from '@spartacus/core';
import { FocusConfig, LaunchDialogService } from '@spartacus/storefront';
import { BehaviorSubject } from 'rxjs';
import { take } from 'rxjs/operators';
Expand Down Expand Up @@ -38,7 +38,9 @@ export class AsmSaveCartDialogComponent implements OnInit {
constructor(
protected launchDialogService: LaunchDialogService,
protected savedCartFacade: SavedCartFacade
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
this.launchDialogService.data$.pipe(take(1)).subscribe((data: Cart) => {
Expand Down
1 change: 1 addition & 0 deletions feature-libs/cart/base/assets/translations/en/cart.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"item": "Item",
"itemPrice": "Item price",
"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
@@ -1,6 +1,11 @@
<form *ngIf="productCode" [formGroup]="addToCartForm" (submit)="addToCart()">
<div class="quantity" *ngIf="showQuantity">
<label>{{ 'addToCart.quantity' | cxTranslate }}</label>
<label *cxFeature="'a11yQTY2Quantity'">{{
'addToCart.quantityFull' | cxTranslate
}}</label>
<label *cxFeature="'!a11yQTY2Quantity'">{{
'addToCart.quantity' | cxTranslate
}}</label>
<div class="cx-counter-stock">
<cx-item-counter
*ngIf="hasStock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
FeatureConfigService,
Product,
isNotNullable,
useFeatureStyles,
} from '@spartacus/core';
import {
CmsComponentData,
Expand Down Expand Up @@ -112,7 +113,9 @@ export class AddToCartComponent implements OnInit, OnDestroy {
protected component: CmsComponentData<CmsAddToCartComponent>,
protected eventService: EventService,
@Optional() protected productListItemContext?: ProductListItemContext
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit() {
if (this.product) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { CmsConfig, I18nModule, provideDefaultConfig } from '@spartacus/core';
import {
CmsConfig,
FeaturesConfigModule,
I18nModule,
provideDefaultConfig,
} from '@spartacus/core';
import {
IconModule,
ItemCounterModule,
Expand All @@ -23,6 +28,7 @@ import { AddToCartComponent } from './add-to-cart.component';
IconModule,
ItemCounterModule,
OutletModule,
FeaturesConfigModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
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 @@ -18,12 +18,12 @@ import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import {
ActiveCartFacade,
CartItemComponentOptions,
CartOutlets,
ConsignmentEntry,
MultiCartFacade,
OrderEntry,
PromotionLocation,
SelectiveCartFacade,
CartOutlets,
} from '@spartacus/cart/base/root';
import {
FeatureConfigService,
Expand Down Expand Up @@ -99,6 +99,7 @@ export class CartItemListComponent implements OnInit, OnDestroy {
@Optional() protected outlet?: OutletContextData<ItemListContext>
) {
useFeatureStyles('a11yPreventHorizontalScroll');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
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="'!a11yQTY2Quantity'"
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
3 changes: 3 additions & 0 deletions feature-libs/cart/base/styles/components/_cart-item-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

.cx-item-list-qty {
text-transform: uppercase;
@include forFeature('a11yQTY2Quantity') {
text-transform: none;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"product": "Product",
"products": "Products",
"productCodeLabel": "Product ID",
"quantityLabel": "Qty"
"quantityLabel": "Qty",
"quantityFullLabel": "Quantity"
},
"quickOrderForm": {
"placeholder": "Enter Product name or SKU",
Expand Down Expand Up @@ -65,6 +66,7 @@
"id": "ID",
"price": "Price",
"quantity": "QTY",
"quantityFull": "Quantity",
"itemPrice": "Item price",
"qty": "Qty",
"actions": "Actions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@
</span>

<span class="cx-cart-quick-order-form-qty">
<label class="cx-cart-quick-order-form-label">
<label
*cxFeature="'a11yQTY2Quantity'"
class="cx-cart-quick-order-form-label"
>
{{ 'quickOrderCartForm.quantityFullLabel' | cxTranslate }}
</label>

<label
*cxFeature="'!a11yQTY2Quantity'"
class="cx-cart-quick-order-form-label"
>
{{ 'quickOrderCartForm.quantityLabel' | cxTranslate }}
</label>

Expand Down Expand Up @@ -156,7 +166,7 @@
<cx-form-errors
*cxFeature="'formErrorsDescriptiveMessages'"
[translationParams]="{
label: 'quickOrderCartForm.quantityLabel' | cxTranslate,
label: 'quickOrderCartForm.quantityFullLabel' | cxTranslate,
}"
[control]="quickOrderForm.get('quantity')"
></cx-form-errors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
FeatureConfigService,
GlobalMessageService,
GlobalMessageType,
useFeatureStyles,
} from '@spartacus/core';
import { Observable, Subscription } from 'rxjs';
import { first, map } from 'rxjs/operators';
Expand Down Expand Up @@ -55,7 +56,9 @@ export class CartQuickOrderFormComponent implements OnInit, OnDestroy {
protected eventService: EventService,
protected formBuilder: UntypedFormBuilder,
protected globalMessageService: GlobalMessageService
) {}
) {
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
this.buildForm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
</td>

<td role="cell" class="cx-quantity">
<div class="cx-mobile-header">
<div *cxFeature="'a11yQTY2Quantity'" class="cx-mobile-header">
{{ 'quickOrderTable.quantityFull' | cxTranslate }}
</div>
<div *cxFeature="'!a11yQTY2Quantity'" class="cx-mobile-header">
{{ 'quickOrderTable.qty' | cxTranslate }}
</div>
<div class="cx-value">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class QuickOrderItemComponent implements OnInit, OnDestroy {
protected quickOrderService: QuickOrderFacade
) {
useFeatureStyles('a11yCartItemsLinksStyles');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@
<th role="columnheader" class="cx-item-list-price">
{{ 'quickOrderTable.price' | cxTranslate }}
</th>
<th role="columnheader" class="cx-item-list-qty">
<th
*cxFeature="'a11yQTY2Quantity'"
role="columnheader"
class="cx-item-list-qty"
>
{{ 'quickOrderTable.quantityFull' | cxTranslate }}
</th>
<th
*cxFeature="'!a11yQTY2Quantity'"
role="columnheader"
class="cx-item-list-qty"
>
{{ 'quickOrderTable.quantity' | cxTranslate }}
</th>
<th role="columnheader" class="cx-item-list-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { OrderEntry } from '@spartacus/cart/base/root';
import { useFeatureStyles } from '@spartacus/core';

@Component({
selector: 'cx-quick-order-table',
Expand All @@ -18,4 +19,8 @@ export class QuickOrderTableComponent {

@Input()
loading: boolean = false;

constructor() {
useFeatureStyles('a11yQTY2Quantity');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dateSaved": "Date Saved",
"cartDescription": "Description",
"quantity": "Qty",
"quantityFull": "Quantity",
"total": "Total",
"actions": "Actions",
"makeCartActive": "Make cart active",
Expand Down Expand Up @@ -53,6 +54,7 @@
"id": "ID",
"description": "Description",
"quantity": "QTY",
"quantityFull": "Quantity",
"total": "Total",
"keepCopySavedCart": "Keep a copy of this cart in the saved carts list",
"defaultCloneCartName": "Copy of {{name}}",
Expand Down
Loading

0 comments on commit 44cddaf

Please sign in to comment.