Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into release-2211.28.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
rmch91 committed Aug 28, 2024
2 parents 9c612b3 + 780d582 commit 464f006
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('ConfiguratorGroupTitleComponent', () => {
);
expect(
configuratorStorefrontUtilsService.focusFirstActiveElement
).toHaveBeenCalledWith('cx-hamburger-menu');
).toHaveBeenCalledWith('cx-configurator-group-menu');
});

it('should create component with hamburger menu icon', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
HostBinding,
OnDestroy,
OnInit,
AfterContentChecked,
} from '@angular/core';
import { ConfiguratorRouterExtractorService } from '@spartacus/product-configurator/common';
import {
Expand All @@ -31,11 +32,14 @@ import { ConfiguratorStorefrontUtilsService } from '../service/configurator-stor
templateUrl: './configurator-group-title.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ConfiguratorGroupTitleComponent implements OnInit, OnDestroy {
export class ConfiguratorGroupTitleComponent
implements OnInit, OnDestroy, AfterContentChecked
{
@HostBinding('class.ghost') ghostStyle = true;
protected subscription = new Subscription();
protected readonly PRE_HEADER = '.PreHeader';
protected readonly ADD_TO_CART_BUTTON = 'cx-configurator-add-to-cart-button';
protected focusFirstElementInMobileGroupList = false;

displayedGroup$: Observable<Configurator.Group> =
this.configRouterExtractorService.extractRouterData().pipe(
Expand Down Expand Up @@ -88,14 +92,21 @@ export class ConfiguratorGroupTitleComponent implements OnInit, OnDestroy {
'z-index',
'0'
);
this.configuratorStorefrontUtilsService.focusFirstActiveElement(
'cx-hamburger-menu'
);
this.focusFirstElementInMobileGroupList = true;
}
})
);
}

ngAfterContentChecked(): void {
if (this.focusFirstElementInMobileGroupList) {
this.configuratorStorefrontUtilsService.focusFirstActiveElement(
'cx-configurator-group-menu'
);
this.focusFirstElementInMobileGroupList = false;
}
}

ngOnDestroy(): void {
this.subscription.unsubscribe();
this.configuratorStorefrontUtilsService.removeStyling(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@

import { NgModule } from '@angular/core';
import { CxDatePipe } from '@spartacus/core';
import { CancelServiceOrderService } from './facade';
import { CancelServiceOrderFacade } from '@spartacus/s4-service/root';
import { CancelServiceOrderConnector } from './connector';
import { RescheduleServiceOrderService } from './facade';
import { RescheduleServiceOrderFacade } from '@spartacus/s4-service/root';
import { RescheduleServiceOrderConnector } from './connector';
import {
CancelServiceOrderFacade,
RescheduleServiceOrderFacade,
} from '@spartacus/s4-service/root';
import {
CancelServiceOrderConnector,
RescheduleServiceOrderConnector,
} from './connector';
import {
CancelServiceOrderService,
RescheduleServiceOrderService,
} from './facade';

@NgModule({
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@

import { NgModule } from '@angular/core';
import { provideDefaultConfig } from '@spartacus/core';
import {
CancelServiceOrderAdapter,
RescheduleServiceOrderAdapter,
} from '../core/connector';
import {
OccCancelServiceOrderAdapter,
OccRescheduleServiceOrderAdapter,
} from './adapters';
import { defaultOccServiceOrderConfig } from './config/default-occ-s4-service-config';
import { CancelServiceOrderAdapter } from '../core/connector';
import { OccCancelServiceOrderAdapter } from './adapters';
import { RescheduleServiceOrderAdapter } from '../core/connector';
import { OccRescheduleServiceOrderAdapter } from './adapters';

@NgModule({
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ describe('Added to cart modal - Anonymous user', () => {
});

it('should test item counter on PDP', () => {
interceptGet('getProductStock', '/products/*?fields=*stock*');
interceptGet(
'getProductStock',
'/products/*?fields=code,configurable,configuratorType,purchasable*stock*'
);
cy.wait('@getProductStock').then((xhr) => {
const stock = xhr.response.body.stock.stockLevel;

Expand Down

0 comments on commit 464f006

Please sign in to comment.