Skip to content

Commit

Permalink
fix QTY in other files
Browse files Browse the repository at this point in the history
  • Loading branch information
petarmarkov9449 committed Oct 17, 2024
1 parent d6ac77d commit 86ce346
Show file tree
Hide file tree
Showing 22 changed files with 142 additions and 20 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
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 @@ -29,6 +29,7 @@ import {
FeatureConfigService,
Product,
isNotNullable,
useFeatureStyles,
} from '@spartacus/core';
import {
CmsComponentData,
Expand Down Expand Up @@ -107,7 +108,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 @@ -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,8 +66,10 @@
"id": "ID",
"price": "Price",
"quantity": "QTY",
"quantityFull": "Quantity",
"itemPrice": "Item price",
"qty": "Qty",
"qtyFull": "Quantity",
"actions": "Actions",
"inStock": "In Stock",
"lowStock": "Low Stock",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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 @@ -153,7 +163,15 @@
></cx-form-errors>

<cx-form-errors
*cxFeature="'formErrorsDescriptiveMessages'"
*cxFeature="'formErrorsDescriptiveMessages && a11yQTY2Quantity'"
[translationParams]="{
label: 'quickOrderCartForm.quantityFullLabel' | cxTranslate,
}"
[control]="quickOrderForm.get('quantity')"
></cx-form-errors>

<cx-form-errors
*cxFeature="'formErrorsDescriptiveMessages && !a11yQTY2Quantity'"
[translationParams]="{
label: 'quickOrderCartForm.quantityLabel' | cxTranslate,
}"
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.qtyFull' | 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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,20 @@ <h2>
<th role="columnheader" scope="col">
{{ 'savedCartList.dateSaved' | cxTranslate }}
</th>
<th role="columnheader" scope="col" class="cx-saved-cart-list-th-qty">
<th
*cxFeature="'a11yQTY2Quantity'"
role="columnheader"
scope="col"
class="cx-saved-cart-list-th-qty"
>
{{ 'savedCartList.quantityFull' | cxTranslate }}
</th>
<th
*cxFeature="'a11yQTY2Quantity'"
role="columnheader"
scope="col"
class="cx-saved-cart-list-th-qty"
>
{{ 'savedCartList.quantity' | cxTranslate }}
</th>
<th
Expand Down Expand Up @@ -92,7 +105,16 @@ <h2>
>
</td>
<td class="cx-saved-cart-list-quantity">
<div class="cx-table-label-mobile cx-saved-cart-list-label">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-table-label-mobile cx-saved-cart-list-label"
>
{{ 'savedCartList.quantityFull' | cxTranslate }}
</div>
<div
*cxFeature="'!a11yQTY2Quantity'"
class="cx-table-label-mobile cx-saved-cart-list-label"
>
{{ 'savedCartList.quantity' | cxTranslate }}
</div>
<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class SavedCartListComponent implements OnInit, OnDestroy {
protected launchDialogService: LaunchDialogService
) {
useFeatureStyles('a11ySavedCartsZoom');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@
</div>

<div class="cx-saved-cart-values-container">
<div class="cx-saved-cart-label">
<div *cxFeature="'a11yQTY2Quantity'" class="cx-saved-cart-label">
{{ 'savedCartDialog.quantityFull' | cxTranslate }}
</div>
<div *cxFeature="'!a11yQTY2Quantity'" class="cx-saved-cart-label">
{{ 'savedCartDialog.quantity' | cxTranslate }}
</div>
<div class="cx-saved-cart-value">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
ICON_TYPE,
LaunchDialogService,
} from '@spartacus/storefront';
import { combineLatest, merge, Observable, Subscription } from 'rxjs';
import { Observable, Subscription, combineLatest, merge } from 'rxjs';
import { map, take } from 'rxjs/operators';

export interface SavedCartFormDialogOptions {
Expand Down Expand Up @@ -100,6 +100,7 @@ export class SavedCartFormDialogComponent implements OnInit, OnDestroy {
protected globalMessageService: GlobalMessageService
) {
useFeatureStyles('a11yVisibleFocusOverflows');
useFeatureStyles('a11yQTY2Quantity');
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"estimatedDeliveryDate": {
"quantity": "Qty-",
"quantityFull": "Quantity-",
"ETA": "Estimated delivery date:",
"estimatedDeliveryDateEntryInfo": "{{ quantity }} quantity will be delivered by {{ date }}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,24 @@
{{ 'estimatedDeliveryDate.ETA' | cxTranslate }}
{{ arrivalSlot?.at | cxDate: 'M/d/yyyy' }}
</div>
<div class="cx-value" aria-hidden="true" *ngIf="arrivalSlot?.quantity">
{{ 'estimatedDeliveryDate.quantity' | cxTranslate }}
{{ arrivalSlot?.quantity }}
</div>
<ng-container *ngIf="arrivalSlot?.quantity">
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-value"
aria-hidden="true"
>
{{ 'estimatedDeliveryDate.quantity' | cxTranslate }}
{{ arrivalSlot?.quantity }}
</div>
<div
*cxFeature="'a11yQTY2Quantity'"
class="cx-value"
aria-hidden="true"
>
{{ 'estimatedDeliveryDate.quantityFull' | cxTranslate }}
{{ arrivalSlot?.quantity }}
</div>
</ng-container>
</div>
<div
class="cx-label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

import { Component, Optional, inject } from '@angular/core';
import { CartItemContext, OrderEntry } from '@spartacus/cart/base/root';
import { CxDatePipe, TranslationService } from '@spartacus/core';
import {
CxDatePipe,
TranslationService,
useFeatureStyles,
} from '@spartacus/core';
import {
ArrivalSlot,
ArrivalSlots,
Expand All @@ -26,6 +30,10 @@ export class EstimatedDeliveryDateComponent {
protected translationService = inject(TranslationService);
protected datePipe = inject(CxDatePipe);

constructor() {
useFeatureStyles('a11yQTY2Quantity');
}

readonly orderEntry$: Observable<OrderEntry> =
this.cartItemContext?.item$ ?? EMPTY;

Expand Down
2 changes: 2 additions & 0 deletions projects/assets/src/translations/en/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"productDetails": {
"id": "ID",
"quantity": "Qty",
"quantityFull": "Quantity",
"productDetails": "Product Details",
"specification": "Specs",
"reviews": "Reviews",
Expand Down Expand Up @@ -82,6 +83,7 @@
"viewCart": "view cart",
"proceedToCheckout": "proceed to checkout",
"quantity": "Qty",
"quantityFull": "Quantity",
"outOfStock": "Out of stock",
"inStock": "In stock",
"selectStyleAndSize": "Select style and size to check stock",
Expand Down

0 comments on commit 86ce346

Please sign in to comment.