Skip to content

Commit

Permalink
Merge branch 'develop' into feature/GH-12358
Browse files Browse the repository at this point in the history
  • Loading branch information
Changsuwan authored Jun 4, 2021
2 parents a52040b + 41e174b commit 513f8be
Show file tree
Hide file tree
Showing 207 changed files with 2,303 additions and 7,619 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Do the following steps to keep track of spartacussampledata releases:
- [ ] `npm run release:core:with-changelog`
- [ ] `npm run release:storefront:with-changelog`
- [ ] `npm run release:user:with-changelog` (needed since `3.2.0-rc.0`)
- [ ] `npm run release:tracking:with-changelog` (needed since `3.2.0-next.0`)
- [ ] `npm run release:cds:with-changelog`
- [ ] `npm run release:assets:with-changelog`
- [ ] `npm run release:styles:with-changelog`
Expand All @@ -84,7 +85,6 @@ Do the following steps to keep track of spartacussampledata releases:
- [ ] `npm run release:setup:with-changelog` (needed since `3.0.0-next.1`)
- [ ] `npm run release:organization:with-changelog` (needed since `3.0.0-next.1`)
- [ ] `npm run release:storefinder:with-changelog` (needed since `3.0.0-rc.0`)
- [ ] `npm run release:tracking:with-changelog` (needed since `3.2.0-next.0`)
- [ ] `npm run release:product:with-changelog` (needed since `3.2.0-next.1`)
- [ ] `npm run release:smartedit:with-changelog` (needed since `3.2.0-next.0`)
- [ ] `npm run release:qualtrics:with-changelog` (needed since `3.1.0-next.0`)
Expand Down
110 changes: 110 additions & 0 deletions docs/migration/4_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,102 @@

## Breaking Changes Introduced in 4.0

### ASM changes

- `AsmModule` was removed from storefrontlib, and renamed AsmComponentsModule. Use @spartacus/asm/components instead.
- `AsmModule` was removed from core, and renamed AsmCoreModule. Use @spartacus/asm/core. instead.
- `AsmConfig` was removed from core. Use @spartacus/asm/core.
- `AsmAdapter` was removed. Use @spartacus/asm/core instead.
- `AsmConnector` was removed. Use @spartacus/asm/core instead.
- `CUSTOMER_SEARCH_PAGE_NORMALIZER` was removed. Use @spartacus/asm/core instead.
- `AsmService` was removed. Use @spartacus/asm/core instead.
- `CsAgentAuthService` was removed. Use @spartacus/asm/root instead.
- `CustomerSearchPage` was removed. Use @spartacus/asm/core instead.
- `CustomerSearchOptions` was removed. Use @spartacus/asm/core instead.
- `AsmUi` was removed. Use @spartacus/asm/core instead.
- `AsmAuthHttpHeaderService` was removed. Use @spartacus/asm/root instead.
- `TOKEN_TARGET` was removed. Use @spartacus/asm/root instead.
- `AsmAuthService` was removed. Use @spartacus/asm/root instead.
- `AsmAuthStorageService` was removed. Use @spartacus/asm/root instead.
- `SYNCED_ASM_STATE` was removed. Use @spartacus/asm/core instead.
- `AsmStatePersistenceService` was removed. Use @spartacus/asm/core instead.
- `ASM_UI_UPDATE` was removed. Use @spartacus/asm/core instead.
- `AsmUiUpdate` was removed. Use @spartacus/asm/core instead.
- `AsmUiAction` was removed. Use @spartacus/asm/core instead.
- `CUSTOMER_SEARCH` was removed. Use @spartacus/asm/core instead.
- `CUSTOMER_SEARCH_FAIL` was removed. Use @spartacus/asm/core instead.
- `CUSTOMER_SEARCH_SUCCESS` was removed. Use @spartacus/asm/core instead.
- `CUSTOMER_SEARCH_RESET` was removed. Use @spartacus/asm/core instead.
- `CustomerSearch` was removed. Use @spartacus/asm/core instead.
- `CustomerSearchFail` was removed. Use @spartacus/asm/core instead.
- `CustomerSearchSuccess` was removed. Use @spartacus/asm/core instead.
- `CustomerSearchReset` was removed. Use @spartacus/asm/core instead.
- `CustomerAction` was removed. Use @spartacus/asm/core instead.
- `LOGOUT_CUSTOMER_SUPPORT_AGENT` was removed. Use @spartacus/asm/core instead.
- `LogoutCustomerSupportAgent` was removed. Use @spartacus/asm/core instead.
- `ASM_FEATURE` was removed. Use @spartacus/asm/core instead.
- `CUSTOMER_SEARCH_DATA` was removed. Use @spartacus/asm/core instead.
- `StateWithAsm` was removed. Use @spartacus/asm/core instead.
- `AsmState` was removed. Use @spartacus/asm/core instead.
- `getAsmUi` was removed. Use @spartacus/asm/core instead.
- `getCustomerSearchResultsLoaderState` was removed. Use @spartacus/asm/core instead.
- `getCustomerSearchResults` was removed. Use @spartacus/asm/core instead.
- `getCustomerSearchResultsLoading` was removed. Use @spartacus/asm/core instead.
- `getAsmState` was removed. Use @spartacus/asm/core instead.

### LaunchDialogService

#### SavedCartFormLaunchDialogService
- Service has been removed. `openDialog` method is part of LaunchDialogService now.

#### AddToSavedCartComponent
- Removed `SavedCartFormLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

#### SavedCartDetailsActionComponent
- Removed `SavedCartFormLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

#### SavedCartDetailsOverviewComponent
- Removed `SavedCartFormLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

#### AnonymousConsentLaunchDialogService
- Service has been removed. `openDialog` method is part of LaunchDialogService now.

#### AnonymousConsentManagementBannerComponent
- Removed `AnonymousConsentLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

#### AnonymousConsentOpenDialogComponent
- Removed `AnonymousConsentLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

#### ReplenishmentOrderCancellationLaunchDialogService
- Service has been removed. `openDialog` method is part of LaunchDialogService now.

#### ReplenishmentOrderCancellationComponent
- Removed `ReplenishmentOrderCancellationLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

#### ReplenishmentOrderHistoryComponent
- Removed `ReplenishmentOrderCancellationLaunchDialogService` from constructor.
- Added `LaunchDialogService` to constructor.

### Personalization

- `PersonalizationModule` was removed. Use `@spartacus/tracking/personalization` instead.
- `PersonalizationConfig` was moved to `@spartacus/tracking/personalization/root`.
- `PersonalizationContextService` was moved to `@spartacus/tracking/personalization/core`.
- `PersonalizationAction` was moved to `@spartacus/tracking/personalization/core`.
- `PersonalizationContext` was moved to `@spartacus/tracking/personalization/core`.

### WindowRef

- `platformId` is now required constructor dependency.

### Product configurator

`ConfiguratorCartEntryInfoComponent` now also requires `CommonConfiguratorUtilsService`.
`ConfiguratorAttributeCheckboxListComponent` now also requires `ConfiguratorAttributeQuantityService`.
`ConfiguratorAttributeDropDownComponent` now also requires `ConfiguratorAttributeQuantityService`.
Expand Down Expand Up @@ -81,3 +177,17 @@ What was removed:
- core of the mechanism (reducer)
- configuration (`storageSync` from `StateConfig`)
- default config and default keys (`defaultStateConfig`, `DEFAULT_LOCAL_STORAGE_KEY` and `DEFAULT_SESSION_STORAGE_KEY`)

### LanguageService

- `LanguageService` no longer uses `WindowRef`. The language initialization from the state was moved to `LanguageInitializer`.
- `LanguageService` now validate the value passed to the method `setActive()` against the iso codes listed in the Spartacus `context` config, before setting the actual value in the ngrx store.
- The initialization of the site context is scheduled a bit earlier than in before (now it's run in an observable stream instead of a Promise's callback). It's a very slight change, but might have side-effects in some custom implementations.
- The active language is now persisted in the Local Storage instead of the Session Storage

### CurrencyService

- `CurrencyService` no longer uses `WindowRef`. The currency initialization from the state was moved to `CurrencyInitializer`.
- `CurrencyService` now validate the value passed to the method `setActive()` against the iso codes listed in the Spartacus `context` config, before setting the actual value in the ngrx store.
- The initialization of the site context is scheduled a bit earlier than in before (now it's run in an observable stream instead of a Promise's callback). It's a very slight change, but might have side-effects in some custom implementations.
- The active currency is now persisted in the LocalStorage instead of the Session Storage.
1 change: 1 addition & 0 deletions feature-libs/asm/occ/model/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './occ-asm-endpoints.model';
12 changes: 12 additions & 0 deletions feature-libs/asm/occ/model/occ-asm-endpoints.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { OccEndpoint } from '@spartacus/core';

declare module '@spartacus/core' {
interface OccEndpoints {
/**
* Endpoint for asm customer search
*
* @member {string}
*/
asmCustomerSearch?: string | OccEndpoint;
}
}
1 change: 1 addition & 0 deletions feature-libs/asm/occ/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './adapters/index';
export * from './asm-occ.module';
export * from './model/index';
1 change: 0 additions & 1 deletion feature-libs/asm/schematics/add-asm/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ describe('Spartacus Asm schematics: ng-add', () => {

const spartacusDefaultOptions: SpartacusOptions = {
project: 'schematics-test',
configuration: 'b2c',
lazy: true,
features: [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront';
import { UrlTestingModule } from 'projects/core/src/routing/configurable-routes/url-translation/testing/url-testing.module';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { SavedCartFormLaunchDialogService } from '../saved-cart-form-dialog/saved-cart-form-launch-dialog.service';
import { AddToSavedCartComponent } from './add-to-saved-cart.component';

const mockCart: Cart = {
Expand Down Expand Up @@ -39,10 +38,6 @@ class MockRoutingService implements Partial<RoutingService> {
go(): void {}
}

class MockSavedCartFormLaunchDialogService {
openDialog(_openElement?: ElementRef, _vcr?: ViewContainerRef, _data?: any) {}
}

class MockLaunchDialogService implements Partial<LaunchDialogService> {
openDialog(
_caller: LAUNCH_CALLER,
Expand All @@ -67,11 +62,6 @@ describe('AddToSavedCartComponent', () => {
{ provide: ActiveCartService, useClass: MockActiveCartService },
{ provide: AuthService, useClass: MockAuthService },
{ provide: RoutingService, useClass: MockRoutingService },
// TODO(#12167): remove unused class and provider
{
provide: SavedCartFormLaunchDialogService,
useClass: MockSavedCartFormLaunchDialogService,
},
{ provide: LaunchDialogService, useClass: MockLaunchDialogService },
],
}).compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront';
import { combineLatest, Observable, Subscription } from 'rxjs';
import { map, take, tap } from 'rxjs/operators';
import { SavedCartFormLaunchDialogService } from '../saved-cart-form-dialog/saved-cart-form-launch-dialog.service';

@Component({
selector: 'cx-add-to-saved-cart',
Expand All @@ -31,43 +30,12 @@ export class AddToSavedCartComponent implements OnInit, OnDestroy {

cart$: Observable<Cart>;

// TODO(#12167): make launchDialogService a required dependency instead of savedCartFormLaunchDialogService and remove deprecated constructors
/**
* Default constructor will be:
*
* @param {ActiveCartService} activeCartService
* @param {AuthService} authService
* @param {RoutingService} routingService
* @param {ViewContainerRef} vcr
* @param {LaunchDialogService} launchDialogService
*/
constructor(
activeCartService: ActiveCartService,
authService: AuthService,
routingService: RoutingService,
savedCartFormLaunchDialogService: SavedCartFormLaunchDialogService,
vcr: ViewContainerRef,
// eslint-disable-next-line @typescript-eslint/unified-signatures
launchDialogService: LaunchDialogService
);

/**
* @deprecated since 3.3
*/
constructor(
activeCartService: ActiveCartService,
authService: AuthService,
routingService: RoutingService,
savedCartFormLaunchDialogService: SavedCartFormLaunchDialogService,
vcr: ViewContainerRef
);
constructor(
protected activeCartService: ActiveCartService,
protected authService: AuthService,
protected routingService: RoutingService,
protected savedCartFormLaunchDialogService: SavedCartFormLaunchDialogService,
protected vcr: ViewContainerRef,
protected launchDialogService?: LaunchDialogService
protected launchDialogService: LaunchDialogService
) {}

ngOnInit(): void {
Expand All @@ -89,28 +57,15 @@ export class AddToSavedCartComponent implements OnInit, OnDestroy {
}

openDialog(cart: Cart) {
// TODO(#12167): use launchDialogService only
if (this.launchDialogService) {
const dialog = this.launchDialogService.openDialog(
LAUNCH_CALLER.SAVED_CART,
this.element,
this.vcr,
{ cart, layoutOption: 'save' }
);

if (dialog) {
this.subscription.add(dialog.pipe(take(1)).subscribe());
}
} else {
const dialog = this.savedCartFormLaunchDialogService.openDialog(
this.element,
this.vcr,
{ cart, layoutOption: 'save' }
);
const dialog = this.launchDialogService.openDialog(
LAUNCH_CALLER.SAVED_CART,
this.element,
this.vcr,
{ cart, layoutOption: 'save' }
);

if (dialog) {
this.subscription.add(dialog.pipe(take(1)).subscribe());
}
if (dialog) {
this.subscription.add(dialog.pipe(take(1)).subscribe());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from '@spartacus/core';
import { LaunchDialogService, LAUNCH_CALLER } from '@spartacus/storefront';
import { Observable, of } from 'rxjs';
import { SavedCartFormLaunchDialogService } from '../../saved-cart-form-dialog/saved-cart-form-launch-dialog.service';
import { SavedCartDetailsService } from '../saved-cart-details.service';
import { SavedCartDetailsActionComponent } from './saved-cart-details-action.component';

Expand Down Expand Up @@ -50,17 +49,6 @@ class MockGlobalMessageService implements Partial<GlobalMessageService> {
): void {}
}

class MockSavedCartFormLaunchDialogService
implements Partial<SavedCartFormLaunchDialogService> {
openDialog(
_openElement?: ElementRef,
_vcr?: ViewContainerRef,
_data?: any
): Observable<any> {
return of();
}
}

class MockClearCheckoutService implements Partial<ClearCheckoutService> {
resetCheckoutProcesses(): void {}
}
Expand Down Expand Up @@ -103,11 +91,6 @@ describe('SavedCartDetailsActionComponent', () => {
provide: GlobalMessageService,
useClass: MockGlobalMessageService,
},
// TODO(#12167): remove unused class and provider
{
provide: SavedCartFormLaunchDialogService,
useClass: MockSavedCartFormLaunchDialogService,
},
{
provide: ClearCheckoutService,
useClass: MockClearCheckoutService,
Expand Down
Loading

0 comments on commit 513f8be

Please sign in to comment.