Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXSPA/9197: Remove unused method in major release #19833

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b1c24b5
Revert "fix: elevate scroll to top button when overlaps with banner (…
Zeyber Dec 9, 2024
d9b37c2
chore: release 2211.32.0 (#19751)
kpawelczak Dec 10, 2024
2273620
feat: Modify Product Carousel component behaviour to add all products…
kpawelczak Dec 10, 2024
b7274c6
revert: "fix: a11yPasswordVisibilityBtnValueOverflow typo (#19531)" (…
Zeyber Dec 10, 2024
f64c6a8
fix: allow for extending HttpErrorHandlerInterceptor (#19724)
Platonn Dec 12, 2024
26e410f
Defaulting feature toggle (#19778)
anjana-bl Dec 13, 2024
a985616
chore: Enable December 2024 A11Y Feature Toggles (#19780)
Zeyber Dec 13, 2024
ce643d2
chore: add additional test cases to reset password component service …
kpawelczak Dec 16, 2024
7556ff8
fix: (CXSPA-9080) - Hide 'Consent Management' button when cookies ban…
petarmarkov9449 Dec 16, 2024
66de032
fix: (CXSPA-9025) - Add style for active and focused states in Search…
petarmarkov9449 Dec 16, 2024
7bd2277
fix: Absence of an email address during payment via Google Pay in OPF…
rmch91 Dec 16, 2024
c23de1e
fix: (CXSPA-9034) UnitLevelOrderHistory Truncation on applying text s…
StanislavSukhanov Dec 16, 2024
7f2a9da
fix: (CXSPA-9021) Button Menu Focus not looped within the menu items.…
StanislavSukhanov Dec 16, 2024
7fc398b
fix: (CXSPA-9091) Fix invalid aria-label at span tag (#19722)
steinsebastian Dec 16, 2024
f6c67a5
fix: (CXSPA-9092) Read out group name when navigating with prev/next …
steinsebastian Dec 16, 2024
f9db132
fix: scroll to top visible if consents banner is displayed (#19755)
sdrozdsap Dec 16, 2024
09d7981
fix: disable tabbing for quick order search results list (#19742)
sdrozdsap Dec 16, 2024
81440ae
fix: move anonymous consent notification inside dialog (#19735)
sdrozdsap Dec 16, 2024
0412c6b
fix: (CXSPA-9079) - Cropped focus ring in product image zoom componen…
Pio-Bar Dec 17, 2024
6e409dc
fix: (CXSPA-8993) MiniCard component. Improve visible focus contrast …
StanislavSukhanov Dec 17, 2024
ce66b7d
chore: Update formErrorsDescriptiveMessages and shouldHideAddToCartFo…
rmch91 Dec 17, 2024
1ab5eb1
fix: failing anonymous-consents-flow e2e test (#19787)
Pio-Bar Dec 17, 2024
681b07b
fix: reset focus to the main after navigating (#19694)
sdrozdsap Dec 17, 2024
aeeb379
chore: Adjust js doc for useExtendedMediaComponentConfiguration (#19454)
rmch91 Dec 18, 2024
cbd8416
chore: Add version to desc of minor release workflow (#19321)
rmch91 Dec 18, 2024
01ae9bf
fix: (CXSPA-9043) account summaries inputs border visibility fix (#19…
uroslates Dec 19, 2024
702c585
fix: (CXSPA-9059) - Quick order searchbox refocus (#19695)
Pio-Bar Dec 19, 2024
88ec388
Revert "chore: Add version to desc of minor release workflow" (#19792)
rmch91 Dec 19, 2024
35e96bb
fix: Adjust border for multi-selection-images component (#19752)
Larisa-Staroverova Dec 20, 2024
e1719da
fix: use role button for carousel slide indicators (#19790)
sdrozdsap Dec 20, 2024
ec3654c
chore(deps): bump nanoid from 3.3.7 to 3.3.8 (#19774)
dependabot[bot] Dec 20, 2024
ae6f0f1
chore(deps): update dependency jasmine-core to ~5.5.0 (#19800)
renovate[bot] Dec 22, 2024
63d37c9
fix: (CXSPA-9098)-Coupon Codes is used in Coupon Campaign URL (#19739)
crisli001 Dec 24, 2024
c15a8fe
chore(deps): update actions/setup-node action to v4 (#19479)
renovate[bot] Dec 30, 2024
5c04740
chore(deps): update slackapi/slack-github-action action to v1.27.1 (#…
renovate[bot] Dec 30, 2024
1a5c4f9
chore: License header year update (#19812)
rmch91 Jan 2, 2025
075339d
fix: add browser info data for OPF payment init
Matejk00 Jan 3, 2025
f40f4d3
chore: code changes
anjana-bl Jan 7, 2025
0895fea
Update my-account-v2-order-history.service.spec.ts
anjana-bl Jan 7, 2025
cfb1ef1
chore: linting
anjana-bl Jan 7, 2025
a753385
fix: CXSPA-8566 pickup bug fix (#19779)
suprishi Jan 7, 2025
f021f65
fix: allow for resetting to undefined parts of the config of the NgRx…
Platonn Jan 7, 2025
54d3582
chore: Update open-sans, jsonc-parser, tslib deps (#19798)
rmch91 Jan 7, 2025
7935661
fix: (CXSPA-9049) multiple UI elements theme visibility issues fix (#…
uroslates Jan 7, 2025
e327ff9
fix: (CXSPA-9046) FacetList Checkbox CC issue for Selected state in H…
StanislavSukhanov Jan 8, 2025
75677b8
fix: (CXSPA-8991) set aria-label attribute for navigation component b…
uroslates Jan 8, 2025
2812bb2
fix: (CXSPA-9028) - Search dropdown first option visible focus (#19741)
Pio-Bar Jan 8, 2025
9813dc2
fix: (CXSPA-9031) - Refocus on card after selecting (#19754)
Pio-Bar Jan 8, 2025
b845a7e
chore(deps): update dependency webpack to ~5.97.0 (#19836)
renovate[bot] Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node_modules
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
- name: Notify the slack channel of when build conclusion failed
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v1.27.1
with:
channel-id: ${{ secrets.SLACK_NOTIFICATION_CHANNEL }}
payload: |
Expand Down
4 changes: 2 additions & 2 deletions core-libs/setup/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spartacus/setup",
"version": "2211.32.0-1",
"version": "2211.32.0",
"description": "Includes features that makes Spartacus and it's setup easier and streamlined.",
"keywords": [
"spartacus",
Expand All @@ -16,7 +16,7 @@
"test": "../../node_modules/.bin/jest --config ./jest.config.js"
},
"dependencies": {
"tslib": "^2.6.2"
"tslib": "^2.8.1"
},
"peerDependencies": {
"@angular/core": "^18.2.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CSAgentLoginFormComponent implements OnInit {
submitEvent = new EventEmitter<{ userId: string; password: string }>();

constructor(protected fb: UntypedFormBuilder) {
useFeatureStyles('a11yPasswordVisibilityBtnValueOverflow');
useFeatureStyles('a11yPasswordVisibliltyBtnValueOverflow');
useFeatureStyles('a11yTextSpacingAdjustments');
}

Expand Down
4 changes: 2 additions & 2 deletions feature-libs/asm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spartacus/asm",
"version": "2211.32.0-1",
"version": "2211.32.0",
"description": "ASM feature library for Spartacus",
"keywords": [
"spartacus",
Expand All @@ -22,7 +22,7 @@
"test:schematics": "npm --prefix ../../projects/schematics/ run clean && npm run clean:schematics && ../../node_modules/.bin/jest --config ./jest.schematics.config.js"
},
"dependencies": {
"tslib": "^2.6.2"
"tslib": "^2.8.1"
},
"peerDependencies": {
"@angular-devkit/schematics": "^18.2.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ICON_TYPE } from '@spartacus/storefront';
import { useFeatureStyles } from '@spartacus/core';
import { Observable } from 'rxjs';
import { MiniCartComponentService } from './mini-cart-component.service';

Expand All @@ -21,5 +22,7 @@ export class MiniCartComponent {

total$: Observable<string> = this.miniCartComponentService.getTotalPrice();

constructor(protected miniCartComponentService: MiniCartComponentService) {}
constructor(protected miniCartComponentService: MiniCartComponentService) {
useFeatureStyles('a11yMiniCartFocusOnMobile');
}
}
12 changes: 12 additions & 0 deletions feature-libs/cart/base/styles/components/_mini-cart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@
}
}

@include forFeature('a11yMiniCartFocusOnMobile') {
@include media-breakpoint-down(md) {
a {
&:focus {
outline-offset: -4px;
outline-color: var(--cx-color-inverse);
box-shadow: 0 0 0 2px var(--cx-color-visual-focus) inset;
}
}
}
}

@mixin native-high-contrast-fix {
@media (forced-colors: active) {
a {
Expand Down
4 changes: 2 additions & 2 deletions feature-libs/cart/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spartacus/cart",
"version": "2211.32.0-1",
"version": "2211.32.0",
"description": "",
"keywords": [
"spartacus",
Expand All @@ -26,7 +26,7 @@
"test:schematics": "npm --prefix ../../projects/schematics/ run clean && npm run clean:schematics && ../../node_modules/.bin/jest --config ./jest.schematics.config.js"
},
"dependencies": {
"tslib": "^2.6.2"
"tslib": "^2.8.1"
},
"peerDependencies": {
"@angular-devkit/schematics": "^18.2.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
class="quick-order-results-product-container"
>
<button
*cxFeature="'!a11yQuickOrderSearchListKeyboardNavigation'"
(blur)="onBlur($event)"
(mousedown)="add(product, $event)"
(keydown.arrowdown)="focusNextChild($event)"
Expand Down Expand Up @@ -103,6 +104,42 @@
</span>
<span class="price">{{ product.price?.formattedValue }}</span>
</button>
<button
*cxFeature="'a11yQuickOrderSearchListKeyboardNavigation'"
(blur)="onBlur($event)"
(mousedown)="add(product, $event)"
(keydown.arrowdown)="focusNextChild($event)"
(keydown.arrowup)="focusPreviousChild($event)"
(keydown.enter)="add(product, $event)"
(keydown.escape)="clear($event)"
(keydown.tab)="close()"
(keydown.shift.tab)="close()"
[class.has-media]="
config?.quickOrder?.searchForm?.displayProductImages
"
class="quick-order-results-product"
role="option"
>
<cx-media
*ngIf="config?.quickOrder?.searchForm?.displayProductImages"
[alt]="product.name"
[container]="product.images?.PRIMARY"
class="media"
format="thumbnail"
role="presentation"
></cx-media>
<div class="name" [innerHTML]="product.name"></div>
<span class="id">
{{
'quickOrderForm.id'
| cxTranslate
: {
id: product.code,
}
}}
</span>
<span class="price">{{ product.price?.formattedValue }}</span>
</button>
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
QuickOrderFacade,
} from '@spartacus/cart/quick-order/root';
import {
FeatureConfigService,
FeaturesConfig,
GlobalMessageService,
GlobalMessageType,
Expand Down Expand Up @@ -64,6 +65,12 @@ class MockGlobalMessageService implements Partial<GlobalMessageService> {
): void {}
}

class MockFeatureConfigService {
isEnabled() {
return true;
}
}

@Component({
selector: 'cx-icon',
template: '',
Expand Down Expand Up @@ -101,6 +108,7 @@ describe('QuickOrderFormComponent', () => {
features: { level: '5.1' },
},
},
{ provide: FeatureConfigService, useClass: MockFeatureConfigService },
],
}).compileComponents();

Expand Down Expand Up @@ -214,6 +222,20 @@ describe('QuickOrderFormComponent', () => {
component.clear(ev as Event);
expect(ev.preventDefault).toHaveBeenCalled();
});

it('sets focus back to the input if results box was open', (done) => {
const inputSearch: HTMLElement = fixture.debugElement.query(
By.css('input')
).nativeElement;

component.open();
expect(inputSearch).not.toBe(getFocusedElement());
component.clear();
requestAnimationFrame(() => {
expect(inputSearch).toBe(getFocusedElement());
done();
});
});
});

it('should not change focus on focusNextChild if results list is empty', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ import {
ChangeDetectorRef,
Component,
ElementRef,
inject,
Input,
OnDestroy,
OnInit,
ViewChild,
} from '@angular/core';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { QuickOrderFacade } from '@spartacus/cart/quick-order/root';
import { Config, Product, WindowRef, useFeatureStyles } from '@spartacus/core';
import {
Config,
FeatureConfigService,
Product,
useFeatureStyles,
WindowRef,
} from '@spartacus/core';
import { ICON_TYPE } from '@spartacus/storefront';
import { Observable, Subscription } from 'rxjs';
import {
Expand Down Expand Up @@ -45,6 +52,7 @@ export class QuickOrderFormComponent implements OnInit, OnDestroy {

@ViewChild('quickOrderInput') quickOrderInput: ElementRef;

private featureConfigService = inject(FeatureConfigService);
protected subscription = new Subscription();
protected searchSubscription = new Subscription();

Expand Down Expand Up @@ -78,6 +86,15 @@ export class QuickOrderFormComponent implements OnInit, OnDestroy {

if (this.isResultsBoxOpen()) {
this.toggleBodyClass(SEARCH_BOX_ACTIVE_CLASS, false);
if (
this.featureConfigService.isEnabled(
'a11yQuickOrderSearchBoxRefocusOnClose'
)
) {
requestAnimationFrame(() => {
this.quickOrderInput.nativeElement.focus();
});
}
}

const product = this.form.get('product')?.value;
Expand Down Expand Up @@ -140,6 +157,15 @@ export class QuickOrderFormComponent implements OnInit, OnDestroy {

// Focus on first index moving to last
if (results.length) {
if (
this.featureConfigService.isEnabled(
'a11ySearchableDropdownFirstElementFocus'
)
) {
this.winRef.document
.querySelector('main')
?.classList.remove('mouse-focus');
}
if (focusedIndex >= results.length - 1) {
results[0].focus();
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { ChangeDetectionStrategy, Component, Input, Type } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import {
ComponentFixture,
fakeAsync,
TestBed,
tick,
waitForAsync,
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
import { ActiveCartFacade } from '@spartacus/cart/base/root';
Expand Down Expand Up @@ -547,4 +553,25 @@ describe('CheckoutDeliveryAddressComponent', () => {
expect(getSpinner()).toBeFalsy();
});
});

describe('focusCardAfterSelecting', () => {
it('should refocus the selected card after updating', fakeAsync(() => {
const card = document.createElement('cx-card');
const selectButton = document.createElement('button');
card.appendChild(selectButton);
card.tabIndex = 0;
document.body.appendChild(card);
selectButton.focus();
component['isUpdating$'] = of(false);
spyOn(card, 'focus');
spyOn(component['focusService'], 'findFirstFocusable').and.returnValue(
card
);

component.focusCardAfterSelecting();
tick(16); // Wait for requestAnimationFrame

expect(card.focus).toHaveBeenCalled();
}));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ import {
GlobalMessageType,
TranslationService,
UserAddressService,
WindowRef,
getLastValueSync,
} from '@spartacus/core';
import { Card, getAddressNumbers } from '@spartacus/storefront';
import {
Card,
SelectFocusUtility,
getAddressNumbers,
} from '@spartacus/storefront';
import { BehaviorSubject, Observable, combineLatest } from 'rxjs';
import {
distinctUntilChanged,
filter,
map,
switchMap,
take,
tap,
} from 'rxjs/operators';
import { CheckoutConfigService } from '../services';
Expand Down Expand Up @@ -79,6 +85,9 @@ export class CheckoutDeliveryAddressComponent implements OnInit {
);
}

@Optional() protected focusService = inject(SelectFocusUtility);
@Optional() protected windowRef = inject(WindowRef);

constructor(
protected userAddressService: UserAddressService,
protected checkoutDeliveryAddressFacade: CheckoutDeliveryAddressFacade,
Expand Down Expand Up @@ -155,6 +164,38 @@ export class CheckoutDeliveryAddressComponent implements OnInit {
);

this.setAddress(address);
if (this.featureConfigService?.isEnabled('a11yFocusOnCardAfterSelecting')) {
this.focusCardAfterSelecting();
}
}

/**
* Restores the focus to the Card component after it has been selected and the checkout has finished updating.
* The focus is lost due to DOM changes making it otherwise impossible to target elements that have been removed.
*/
focusCardAfterSelecting(): void {
const cardNodes = Array.from(
this.windowRef?.document.querySelectorAll('cx-card')
);
const triggeredCard =
this.windowRef?.document.activeElement?.closest('cx-card');

if (triggeredCard) {
const selectedCardIndex = cardNodes.indexOf(triggeredCard);
this.isUpdating$
.pipe(
filter((isUpdating) => !isUpdating),
take(1)
)
.subscribe(() => {
requestAnimationFrame(() => {
const selectedCard = this.windowRef?.document.querySelectorAll(
'cx-card'
)[selectedCardIndex] as HTMLElement;
this.focusService.findFirstFocusable(selectedCard)?.focus();
});
});
}
}

addAddress(address: Address | undefined): void {
Expand Down
Loading
Loading