Skip to content

Commit

Permalink
Merge branch 'develop' into test-failing-storefront-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
rmch91 authored Oct 17, 2024
2 parents 7c7cf97 + 0393225 commit d993d33
Show file tree
Hide file tree
Showing 30 changed files with 1,453 additions and 313 deletions.
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 @@ -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 @@ -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 @@ -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
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
<ng-container *ngIf="result$ | async as results">
<ng-container *ngIf="results?.length">
<div class="message">
{{ 'cdsRecentSearches.recentSearches' | cxTranslate }}
<div class="recent-searches">
<h3>
{{ 'cdsRecentSearches.recentSearches' | cxTranslate }}
</h3>
<ul
tabindex="0"
[ariaLabel]="'cdsRecentSearches.ariaRecentSearches' | cxTranslate"
role="listbox"
>
<li *ngFor="let recentSearch of results">
<a
role="option"
[innerHTML]="
recentSearch
| cxHighlight: (outletContext$ | async)?.search : false
"
[routerLink]="
{
cxRoute: 'search',
params: { query: recentSearch },
} | cxUrl
"
(mousedown)="$event.preventDefault()"
(keydown.arrowup)="shareEvent($any($event))"
(keydown.arrowdown)="shareEvent($any($event))"
(keydown.arrowleft)="shareEvent($any($event))"
(keydown.arrowright)="shareEvent($any($event))"
(keydown.enter)="shareEvent($any($event))"
(keydown.escape)="shareEvent($any($event))"
(blur)="shareEvent($any($event))"
(click)="updateChosenWord(recentSearch)"
>
</a>
</li>
</ul>
</div>
<ul
class="recent-searches"
[ariaLabel]="'cdsRecentSearches.ariaRecentSearches' | cxTranslate"
role="listbox"
>
<li *ngFor="let recentSearch of results">
<a
role="option"
[innerHTML]="
recentSearch | cxHighlight: (outletContext$ | async)?.search : false
"
[routerLink]="
{
cxRoute: 'search',
params: { query: recentSearch },
} | cxUrl
"
(mousedown)="$event.preventDefault()"
(keydown.arrowup)="shareEvent($any($event))"
(keydown.arrowdown)="shareEvent($any($event))"
(keydown.enter)="shareEvent($any($event))"
(keydown.escape)="shareEvent($any($event))"
(blur)="shareEvent($any($event))"
(click)="updateChosenWord(recentSearch)"
>
</a>
</li>
</ul>
</ng-container>
</ng-container>
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
<ng-container *ngIf="searchPhrases$ | async as searchPhrases">
<ng-container *ngIf="searchPhrases?.length">
<div class="message">
{{ 'cdsTrendingSearches.trendingSearches' | cxTranslate }}
<div class="trending-searches">
<h3>
{{ 'cdsTrendingSearches.trendingSearches' | cxTranslate }}
</h3>
<ul
tabindex="0"
[ariaLabel]="'cdsTrendingSearches.ariaTrendingSearches' | cxTranslate"
>
<li *ngFor="let phrase of searchPhrases">
<a
role="option"
[routerLink]="
{
cxRoute: 'search',
params: { query: phrase.searchPhrase },
} | cxUrl
"
(mousedown)="$event.preventDefault()"
(keydown.arrowup)="shareEvent($any($event))"
(keydown.arrowdown)="shareEvent($any($event))"
(keydown.arrowleft)="shareEvent($any($event))"
(keydown.arrowright)="shareEvent($any($event))"
(keydown.enter)="shareEvent($any($event))"
(keydown.escape)="shareEvent($any($event))"
>
{{ phrase.searchPhrase }}
</a>
</li>
</ul>
</div>

<ul
class="recent-searches"
[ariaLabel]="'cdsTrendingSearches.ariaTrendingSearches' | cxTranslate"
>
<li *ngFor="let phrase of searchPhrases">
<a
role="option"
[routerLink]="
{
cxRoute: 'search',
params: { query: phrase.searchPhrase },
} | cxUrl
"
>
{{ phrase.searchPhrase }}
</a>
</li>
</ul>
</ng-container>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,11 @@ export class TrendingSearchesComponent implements OnInit {
get contextObservable() {
return this.outletContext?.context$ ?? EMPTY;
}

shareEvent(event: KeyboardEvent) {
if (!event) {
throw new Error('Missing Event');
}
this.searchBoxComponentService.shareEvent(event);
}
}
3 changes: 2 additions & 1 deletion projects/assets/src/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"noMatch": "We could not find any results",
"exactMatch": "{{ term }}",
"empty": "Ask us anything"
}
},
"closeSearchPanel": "Close"
},
"sorting": {
"date": "Date",
Expand Down
Loading

0 comments on commit d993d33

Please sign in to comment.