Skip to content

Commit

Permalink
Merge branch 'develop' into feature/GH-11637-plp
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyber authored Oct 17, 2024
2 parents 2d121d5 + 35a1751 commit d2f6870
Show file tree
Hide file tree
Showing 52 changed files with 2,097 additions and 819 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
node_modules
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 @@ -34,6 +34,7 @@
"coupon": "Have a coupon?",
"coupon_other": "Coupon codes",
"couponLabel": "Enter a promo code here",
"addCoupon": "Add a coupon",
"apply": "Apply",
"placeholder": "Promo code",
"applyVoucherSuccess": "{{voucherCode}} has been applied.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
*ngIf="hasStock"
[max]="maxQuantity"
[control]="addToCartForm.get('quantity')"
[ariaDescribedById]="'add-to-card-stock-info'"
></cx-item-counter>

<span class="info">
<span class="info" id="add-to-card-stock-info">
<span *ngIf="showInventory$ | async">{{ getInventory() }}</span>
{{
hasStock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<button
type="button"
class="close"
title="{{ 'common.close' | cxTranslate }}"
attr.aria-label="{{ 'addToCart.closeModal' | cxTranslate }}"
(click)="dismissModal('Cross click')"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</ng-container>

<form (ngSubmit)="applyVoucher()" [formGroup]="couponForm">
<label class="cx-cart-coupon-title">
{{ 'voucher.coupon' | cxTranslate }}
<label id="card-coupon-input-label" class="cx-cart-coupon-title">
{{ 'voucher.addCoupon' | cxTranslate }}
<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
<ng-container
*cxFeature="
Expand All @@ -37,7 +37,7 @@
"
>
<input
[attr.aria-label]="'voucher.couponLabel' | cxTranslate"
[attr.aria-labelledby]="'card-coupon-input-label'"
type="text"
class="form-control input-coupon-code"
formControlName="couponCode"
Expand All @@ -62,7 +62,7 @@
>
<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
<input
[attr.aria-label]="'voucher.couponLabel' | cxTranslate"
[attr.aria-labelledby]="'card-coupon-input-label'"
required="true"
type="text"
class="form-control input-coupon-code"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { Component } from '@angular/core';
import { Cart, OrderEntry } from '@spartacus/cart/base/root';
import { WishListFacade } from '@spartacus/cart/wish-list/root';
import { useFeatureStyles } from '@spartacus/core';
import { Observable } from 'rxjs';

@Component({
Expand All @@ -17,7 +18,9 @@ export class WishListComponent {
wishList$: Observable<Cart> = this.wishListFacade.getWishList();
loading$: Observable<boolean> = this.wishListFacade.getWishListLoading();

constructor(protected wishListFacade: WishListFacade) {}
constructor(protected wishListFacade: WishListFacade) {
useFeatureStyles('a11yVisibleFocusOverflows');
}

removeEntry(item: OrderEntry) {
this.wishListFacade.removeEntry(item);
Expand Down
6 changes: 6 additions & 0 deletions feature-libs/cart/wish-list/styles/_wish-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
}
}
}

@include forFeature('a11yVisibleFocusOverflows') {
.cx-remove-btn {
margin-top: 0.5rem;
}
}
}

.cx-empty-wish-list {
Expand Down
3 changes: 2 additions & 1 deletion feature-libs/order/assets/translations/en/order.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@
"AccountOrderHistoryComponent": "ALL ORDERS ({{param}})",
"OrderReturnRequestListComponent": "RETURNS ({{param}})"
},
"tabPanelContainerRegion": "Group with order history details"
"tabPanelContainerRegion": "Group with order history details",
"tabPanelContainerRegionGroup": "Group with order history details"
},
"returnRequestList": {
"returnRequestId": "Return #",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"findAStore": "Find a Store",
"findStores": "Find Stores",
"hideOutOfStockOptions": "Hide out of stock options",
"searchPlaceholder": "Enter Zip Code, Town or Address",
"searchPlaceholder": "Enter Zip Code or Town or Address",
"useMyLocation": "Use my location"
},
"addressBookPickupInStore": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Page,
PointOfService,
RoutingService,
useFeatureStyles,
} from '@spartacus/core';
import {
PickupLocationsSearchFacade,
Expand Down Expand Up @@ -66,6 +67,8 @@ export class MyPreferredStoreComponent implements OnInit {
this.pointOfService = store;
})
);

useFeatureStyles('a11yViewHoursButtonIconContrast');
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

import { Component, Input, OnDestroy, OnInit, Optional } from '@angular/core';
import { useFeatureStyles } from '@spartacus/core';

import {
PointOfServiceNames,
Expand All @@ -28,7 +29,9 @@ export class SetPreferredStoreComponent implements OnInit, OnDestroy {
constructor(
protected preferredStoreFacade: PreferredStoreFacade,
@Optional() protected outlet: OutletContextData<PointOfServiceNames>
) {}
) {
useFeatureStyles('a11yVisibleFocusOverflows');
}

ngOnInit() {
this.subscription.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<div>
<button
(click)="toggleOpenHours()"
[attr.aria-expanded]="openHoursOpen"
class="cx-store-opening-hours-toggle"
>
{{ 'store.viewHours' | cxTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { PointOfServiceStock } from '@spartacus/core';
import { PointOfServiceStock, useFeatureStyles } from '@spartacus/core';
import { storeHasStock } from '@spartacus/pickup-in-store/core';
import { ICON_TYPE } from '@spartacus/storefront';

Expand All @@ -29,6 +29,11 @@ export class StoreComponent implements OnInit {
openHoursOpen = false;
readonly ICON_TYPE = ICON_TYPE;

constructor() {
useFeatureStyles('a11yVisibleFocusOverflows');
useFeatureStyles('a11yViewHoursButtonIconContrast');
}

ngOnInit(): void {
this.isInStock = storeHasStock(this.storeDetails);
}
Expand Down
3 changes: 3 additions & 0 deletions feature-libs/pickup-in-store/styles/_my-preferred-store.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
.cx-store-opening-hours-icon {
color: var(--cx-color-secondary);
opacity: var(--cx-opacity, 0.5);
@include forFeature('a11yViewHoursButtonIconContrast') {
opacity: var(--cx-opacity, 1);
}
}
padding-inline-start: 0;
padding-top: 0.5rem;
Expand Down
5 changes: 5 additions & 0 deletions feature-libs/pickup-in-store/styles/_set-preferred-store.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
text-decoration: underline;
border: none;
background: none;

@include forFeature('a11yVisibleFocusOverflows') {
padding-inline-start: 0;
margin-inline-start: 0.5rem;
}
}
}
}
8 changes: 8 additions & 0 deletions feature-libs/pickup-in-store/styles/_store.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@
.cx-store-opening-hours-icon {
color: var(--cx-color-secondary);
opacity: var(--cx-opacity, 0.5);
@include forFeature('a11yViewHoursButtonIconContrast') {
opacity: var(--cx-opacity, 1);
}
}
padding-inline-start: 0;
padding-top: 0.5rem;
border: none;
background: none;

@include forFeature('a11yVisibleFocusOverflows') {
padding-top: 0;
margin-top: 0.5rem;
}
}

.cx-stock-level {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
createAttributeValueIdForConfigurator(attribute, value.valueCode) +
'-input'
}}"
aria-hidden="true"
class="form-check-label"
>
<img
Expand Down Expand Up @@ -116,7 +115,6 @@
value.valueCode
) + '-input'
}}"
aria-hidden="true"
class="form-check-label"
[style.cursor]="!isReadOnly(attribute) ? 'pointer' : 'default'"
title="{{ getLabel(expMode, value.valueDisplay, value.valueCode) }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,6 @@ describe('ConfiguratorAttributeMultiSelectionImageComponent', () => {
);
});

it("should contain label elements with class name 'form-check-label' and 'aria-hidden' attribute attribute that removes label from the accessibility tree", () => {
CommonConfiguratorTestUtilsService.expectElementContainsA11y(
expect,
htmlElem,
'label',
'form-check-label',
2,
'aria-hidden',
'true'
);
});

it("should contain button elements with 'aria-label' attribute that point out that there is a description for the current value", () => {
(config.features ?? {}).productConfiguratorAttributeTypesV2 = true;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,22 @@ export class ConfiguratorAttributeNumericInputFieldService {
if (valueName.includes('>')) {
minVal = valueName;
interval.minValueIncluded = false;
minVal = minVal.replace('>', '');
minVal = minVal.replace(/>/g, '');
}
if (valueName.includes('<')) {
maxVal = valueName;
interval.maxValueIncluded = false;
maxVal = maxVal.replace('<', '');
maxVal = maxVal.replace(/</g, '');
}
if (valueName.includes('≥')) {
minVal = valueName;
interval.minValueIncluded = true;
minVal = minVal.replace('≥', '');
minVal = minVal.replace(//g, '');
}
if (valueName.includes('≤')) {
maxVal = valueName;
interval.maxValueIncluded = true;
maxVal = maxVal.replace('≤', '');
maxVal = maxVal.replace(//g, '');
}
if (
!valueName.includes('>') &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
createAttributeValueIdForConfigurator(attribute, value.valueCode) +
'-input'
}}"
aria-hidden="true"
class="form-check-label form-radio-label"
>
<img
Expand Down Expand Up @@ -150,7 +149,6 @@
value.valueCode
) + '-input'
}}"
aria-hidden="true"
class="form-check-label form-radio-label"
[style.cursor]="!isReadOnly(attribute) ? 'pointer' : 'default'"
title="{{ getLabel(expMode, value.valueDisplay, value.valueCode) }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,6 @@ describe('ConfiguratorAttributeSingleSelectionImageComponent', () => {
);
});

it("should contain label element with class name 'form-check-label' and 'aria-hidden' attribute that removes an element from the accessibility tree", () => {
CommonConfiguratorTestUtilsService.expectElementContainsA11y(
expect,
htmlElem,
'label',
'form-check-label',
1,
'aria-hidden',
'true'
);
});

it("should contain button elements with 'aria-label' attribute that point out that there is a description for the current value", () => {
(config.features ?? {}).productConfiguratorAttributeTypesV2 = true;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"useMyLocation": "Use my location",
"viewAllStores": "View all stores",
"contactUs": "Contact us",
"searchBox": "Postal code, town or address",
"searchBox": "Postal code or town or address",
"backToList": "Back to list",
"noStoresMessage": "No stores found in database...",
"geolocationNotEnabled": "Cannot locate nearby stores. Geolocation consent has not been enabled",
Expand Down
Loading

0 comments on commit d2f6870

Please sign in to comment.