From b0d832403f49936a884ace09bb991a9e4578c1a5 Mon Sep 17 00:00:00 2001 From: Christoph Hinssen Date: Wed, 9 Sep 2020 16:10:45 +0200 Subject: [PATCH 1/5] GH-8835 Move OCC, connectors and model --- ...rator-add-to-cart-button.component.spec.ts | 2 +- ...nfigurator-add-to-cart-button.component.ts | 2 +- ...gurator-attribute-footer.component.spec.ts | 7 +- ...configurator-attribute-footer.component.ts | 3 +- ...gurator-attribute-header.component.spec.ts | 7 +- ...configurator-attribute-header.component.ts | 3 +- ...-attribute-checkbox-list.component.spec.ts | 2 +- ...rator-attribute-checkbox-list.component.ts | 2 +- ...rator-attribute-checkbox.component.spec.ts | 2 +- ...nfigurator-attribute-checkbox.component.ts | 3 +- ...ator-attribute-drop-down.component.spec.ts | 2 +- ...figurator-attribute-drop-down.component.ts | 2 +- ...or-attribute-input-field.component.spec.ts | 3 +- ...gurator-attribute-input-field.component.ts | 3 +- ...te-multi-selection-image.component.spec.ts | 2 +- ...tribute-multi-selection-image.component.ts | 2 +- ...bute-numeric-input-field.component.spec.ts | 3 +- ...attribute-numeric-input-field.component.ts | 2 +- ...r-attribute-radio-button.component.spec.ts | 2 +- ...urator-attribute-radio-button.component.ts | 2 +- ...ator-attribute-read-only.component.spec.ts | 2 +- ...figurator-attribute-read-only.component.ts | 2 +- ...e-single-selection-image.component.spec.ts | 2 +- ...ribute-single-selection-image.component.ts | 2 +- ...tor-conflict-description.component.spec.ts | 2 +- ...igurator-conflict-description.component.ts | 2 +- ...ator-conflict-suggestion.component.spec.ts | 2 +- ...figurator-conflict-suggestion.component.ts | 2 +- .../form/configurator-form.component.spec.ts | 2 +- .../form/configurator-form.component.ts | 7 +- .../form/configurator-form.event.ts | 2 +- .../configurator-group-menu.component.spec.ts | 2 +- .../configurator-group-menu.component.ts | 2 +- ...configurator-group-title.component.spec.ts | 2 +- .../configurator-group-title.component.ts | 2 +- ...nfigurator-overview-attribute.component.ts | 2 +- ...nfigurator-overview-form.component.spec.ts | 2 +- .../configurator-overview-form.component.ts | 2 +- ...view-notification-banner.component.spec.ts | 3 +- ...-overview-notification-banner.component.ts | 3 +- ...or-previous-next-buttons.component.spec.ts | 2 +- ...gurator-previous-next-buttons.component.ts | 3 +- ...nfigurator-price-summary.component.spec.ts | 2 +- .../configurator-price-summary.component.ts | 2 +- ...nfigurator-product-title.component.spec.ts | 2 +- ...figurator-storefront-utils.service.spec.ts | 3 +- .../configurator-storefront-utils.service.ts | 3 +- .../configurator-ui-key-generator.spec.ts | 2 +- .../service/configurator-ui-key-generator.ts | 2 +- .../configurator-commons.adapter.ts | 5 +- .../configurator-commons.connector.spec.ts | 10 +-- .../configurator-commons.connector.ts | 10 +-- .../connectors/configurator-converters.ts | 4 +- .../common/src/core}/connectors/index.ts | 2 +- .../facade/configurator-cart.service.spec.ts | 2 +- .../core/facade/configurator-cart.service.ts | 2 +- .../configurator-commons.service.spec.ts | 2 +- .../facade/configurator-commons.service.ts | 2 +- .../configurator-group-status.service.ts | 3 +- .../facade/configurator-groups.service.ts | 3 +- .../utils/configurator-utils.service.spec.ts | 3 +- .../utils/configurator-utils.service.ts | 2 +- .../configurators/common/src/core/index.ts | 2 + .../src/core}/model/configurator.model.ts | 2 +- .../actions/configurator-cart.action.spec.ts | 2 +- .../state/actions/configurator-cart.action.ts | 2 +- .../state/actions/configurator.action.spec.ts | 2 +- .../core/state/actions/configurator.action.ts | 3 +- .../src/core/state/configurator-state.ts | 3 +- .../effects/configurator-basic.effect.spec.ts | 9 +-- .../effects/configurator-basic.effect.ts | 4 +- .../effects/configurator-cart.effect.spec.ts | 4 +- .../state/effects/configurator-cart.effect.ts | 4 +- .../reducers/configurator.reducer.spec.ts | 3 +- .../state/reducers/configurator.reducer.ts | 3 +- .../common/src/core/state/reducers/index.ts | 3 +- .../selectors/configurator.selector.spec.ts | 2 +- .../state/selectors/configurator.selector.ts | 3 +- .../product/configurators/common/src/index.ts | 1 + ...nfigurator-component-test-utils.service.ts | 4 +- .../shared/testing/configurator-test-data.ts | 3 +- .../common/src/shared/testing/index.ts | 1 + .../configurators/variant/src/core/index.ts | 1 + .../occ}/configurator-variant-occ.module.ts | 6 +- .../variant/src/core/occ/converters/index.ts | 6 ++ ...tor-variant-add-to-cart-serializer.spec.ts | 2 +- ...igurator-variant-add-to-cart-serializer.ts | 4 +- ...cc-configurator-variant-normalizer.spec.ts | 11 +-- .../occ-configurator-variant-normalizer.ts | 6 +- ...urator-variant-overview-normalizer.spec.ts | 69 +++++++++++-------- ...onfigurator-variant-overview-normalizer.ts | 12 ++-- ...r-variant-price-summary-normalizer.spec.ts | 2 +- ...urator-variant-price-summary-normalizer.ts | 4 +- ...cc-configurator-variant-serializer.spec.ts | 2 +- .../occ-configurator-variant-serializer.ts | 4 +- ...riant-update-cart-entry-serializer.spec.ts | 2 +- ...or-variant-update-cart-entry-serializer.ts | 4 +- ...default-occ-configurator-variant-config.ts | 2 +- .../variant/src/core/occ/index.ts | 4 ++ .../occ-configurator-variant.adapter.spec.ts | 20 +++--- .../occ}/occ-configurator-variant.adapter.ts | 22 +++--- .../src/core/occ}/occ-configurator.models.ts | 6 +- .../core/variant-configurator-core.module.ts | 3 +- projects/core/public_api.ts | 9 ++- .../core/src/configurator/commons/index.ts | 1 - projects/core/src/model/index.ts | 1 - .../configurator/variant/converters/index.ts | 2 - .../adapters/configurator/variant/index.ts | 3 - projects/core/src/occ/adapters/index.ts | 1 - projects/core/src/occ/occ.module.ts | 2 - 110 files changed, 241 insertions(+), 204 deletions(-) rename {projects/core/src/configurator/commons => feature-libs/product/configurators/common/src/core}/connectors/configurator-commons.adapter.ts (93%) rename {projects/core/src/configurator/commons => feature-libs/product/configurators/common/src/core}/connectors/configurator-commons.connector.spec.ts (95%) rename {projects/core/src/configurator/commons => feature-libs/product/configurators/common/src/core}/connectors/configurator-commons.connector.ts (88%) rename projects/core/src/configurator/commons/connectors/converters.ts => feature-libs/product/configurators/common/src/core/connectors/configurator-converters.ts (88%) rename {projects/core/src/configurator/commons => feature-libs/product/configurators/common/src/core}/connectors/index.ts (69%) rename {projects/core/src => feature-libs/product/configurators/common/src/core}/model/configurator.model.ts (98%) create mode 100644 feature-libs/product/configurators/common/src/shared/testing/index.ts rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/configurator-variant-occ.module.ts (90%) create mode 100644 feature-libs/product/configurators/variant/src/core/occ/converters/index.ts rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts (96%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-add-to-cart-serializer.ts (84%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-normalizer.spec.ts (98%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-normalizer.ts (97%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-overview-normalizer.spec.ts (79%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-overview-normalizer.ts (87%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-price-summary-normalizer.spec.ts (95%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-price-summary-normalizer.ts (80%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-serializer.spec.ts (99%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-serializer.ts (97%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts (96%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/converters/occ-configurator-variant-update-cart-entry-serializer.ts (87%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/default-occ-configurator-variant-config.ts (95%) create mode 100644 feature-libs/product/configurators/variant/src/core/occ/index.ts rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/occ-configurator-variant.adapter.spec.ts (95%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/occ-configurator-variant.adapter.ts (91%) rename {projects/core/src/occ/adapters/configurator/variant => feature-libs/product/configurators/variant/src/core/occ}/occ-configurator.models.ts (97%) delete mode 100644 projects/core/src/configurator/commons/index.ts delete mode 100644 projects/core/src/occ/adapters/configurator/variant/converters/index.ts delete mode 100644 projects/core/src/occ/adapters/configurator/variant/index.ts diff --git a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts index ce155ad780b..ae72581a8bf 100644 --- a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts @@ -1,7 +1,6 @@ import { ChangeDetectionStrategy, Type } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { - Configurator, GenericConfigurator, GlobalMessageService, I18nTestingModule, @@ -14,6 +13,7 @@ import { ConfiguratorCartService } from '../../core/facade/configurator-cart.ser import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import * as ConfigurationTestData from '../../shared/testing/configurator-test-data'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorAddToCartButtonComponent } from './configurator-add-to-cart-button.component'; const CART_ENTRY_KEY = '1'; diff --git a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts index b29c52e4086..4f6153f8c7a 100644 --- a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts +++ b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts @@ -1,6 +1,5 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { - Configurator, GenericConfigurator, GlobalMessageService, GlobalMessageType, @@ -15,6 +14,7 @@ import { filter, map, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCartService } from '../../core/facade/configurator-cart.service'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-add-to-cart-button', diff --git a/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.spec.ts index cc9d021901f..216cd0f547a 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.spec.ts @@ -1,10 +1,6 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { - Configurator, - GenericConfigurator, - I18nTestingModule, -} from '@spartacus/core'; +import { GenericConfigurator, I18nTestingModule } from '@spartacus/core'; import { IconLoaderService, IconModule, @@ -13,6 +9,7 @@ import { import { Observable, of } from 'rxjs'; import { ConfiguratorComponentTestUtilsService } from '../../../shared/testing/configurator-component-test-utils.service'; import { ConfiguratorStorefrontUtilsService } from '../../service/configurator-storefront-utils.service'; +import { Configurator } from './../../../core/model/configurator.model'; import { ConfiguratorAttributeFooterComponent } from './configurator-attribute-footer.component'; export class MockIconFontLoaderService { diff --git a/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.ts b/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.ts index be6fdf9a17b..5d344fc1d38 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/footer/configurator-attribute-footer.component.ts @@ -4,11 +4,12 @@ import { Input, OnInit, } from '@angular/core'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ICON_TYPE } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ConfiguratorStorefrontUtilsService } from '../../service/configurator-storefront-utils.service'; +import { Configurator } from './../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-footer', diff --git a/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.spec.ts index 56c8dd39d4e..5b1aa6f5861 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.spec.ts @@ -1,10 +1,6 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { - Configurator, - GenericConfigurator, - I18nTestingModule, -} from '@spartacus/core'; +import { GenericConfigurator, I18nTestingModule } from '@spartacus/core'; import { IconLoaderService, IconModule, @@ -13,6 +9,7 @@ import { import { Observable, of } from 'rxjs'; import { ConfiguratorComponentTestUtilsService } from '../../../shared/testing/configurator-component-test-utils.service'; import { ConfiguratorStorefrontUtilsService } from '../../service/configurator-storefront-utils.service'; +import { Configurator } from './../../../core/model/configurator.model'; import { ConfiguratorAttributeHeaderComponent } from './configurator-attribute-header.component'; export class MockIconFontLoaderService { diff --git a/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.ts b/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.ts index 9baf8007e99..3aff070393b 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/header/configurator-attribute-header.component.ts @@ -4,12 +4,13 @@ import { Input, OnInit, } from '@angular/core'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ICON_TYPE } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { ConfiguratorStorefrontUtilsService } from '../../service/configurator-storefront-utils.service'; import { ConfiguratorUIKeyGenerator } from '../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-header', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.spec.ts index 541c07b56a2..4bbe331e081 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.spec.ts @@ -3,10 +3,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NgSelectModule } from '@ng-select/ng-select'; -import { Configurator } from 'projects/core/src/model/configurator.model'; import { ConfiguratorGroupsService } from '../../../../core/facade/configurator-groups.service'; import { ConfiguratorStorefrontUtilsService } from '../../../service/configurator-storefront-utils.service'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeCheckBoxListComponent } from './configurator-attribute-checkbox-list.component'; class MockGroupService {} diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.ts index 9a1359e7486..76d3ba2852e 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox-list/configurator-attribute-checkbox-list.component.ts @@ -7,10 +7,10 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorStorefrontUtilsService } from '../../../service/configurator-storefront-utils.service'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-checkbox-list', templateUrl: './configurator-attribute-checkbox-list.component.html', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.spec.ts index 4ceeaa1d92c..6f021dd5eea 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.spec.ts @@ -3,8 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NgSelectModule } from '@ng-select/ng-select'; -import { Configurator } from 'projects/core/src/model/configurator.model'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeCheckBoxComponent } from './configurator-attribute-checkbox.component'; describe('ConfigAttributeCheckBoxComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.ts index 0dde2bd1813..4d403930dc8 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/checkbox/configurator-attribute-checkbox.component.ts @@ -7,9 +7,10 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; + @Component({ selector: 'cx-config-attribute-checkbox', templateUrl: './configurator-attribute-checkbox.component.html', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.spec.ts index e51d36a759a..e89c86cdab6 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.spec.ts @@ -2,8 +2,8 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { NgSelectModule } from '@ng-select/ng-select'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeDropDownComponent } from './configurator-attribute-drop-down.component'; describe('ConfigAttributeDropDownComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.ts index 5f8193863b2..3c20281e69f 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/drop-down/configurator-attribute-drop-down.component.ts @@ -7,9 +7,9 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-drop-down', templateUrl: './configurator-attribute-drop-down.component.html', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.spec.ts index a3e3a123bef..246e8104fd0 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.spec.ts @@ -2,8 +2,9 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeInputFieldComponent } from './configurator-attribute-input-field.component'; describe('ConfigAttributeInputFieldComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.ts index 519408bd23c..16fe41a7dd1 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/input-field/configurator-attribute-input-field.component.ts @@ -7,9 +7,10 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-input-field', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.spec.ts index 777d4abe9a6..05dc5dcc1b4 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.spec.ts @@ -3,10 +3,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NgSelectModule } from '@ng-select/ng-select'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorGroupsService } from '../../../../core/facade/configurator-groups.service'; import { ConfiguratorStorefrontUtilsService } from '../../../service/configurator-storefront-utils.service'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeMultiSelectionImageComponent } from './configurator-attribute-multi-selection-image.component'; class MockGroupService {} diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.ts index 218083e13ac..5767686d9b8 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/multi-selection-image/configurator-attribute-multi-selection-image.component.ts @@ -7,10 +7,10 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorStorefrontUtilsService } from '../../../service/configurator-storefront-utils.service'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-multi-selection-image', templateUrl: './configurator-attribute-multi-selection-image.component.html', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.spec.ts index dea007a3a4d..e4f1bbe67ea 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.spec.ts @@ -1,9 +1,10 @@ import { ChangeDetectionStrategy, Pipe, PipeTransform } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { Configurator, LanguageService } from '@spartacus/core'; +import { LanguageService } from '@spartacus/core'; import { of } from 'rxjs'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeNumericInputFieldComponent } from './configurator-attribute-numeric-input-field.component'; @Pipe({ diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.ts index e8418271f19..82646296244 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/numeric-input-field/configurator-attribute-numeric-input-field.component.ts @@ -9,9 +9,9 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeNumericInputFieldService } from './configurator-attribute-numeric-input-field.component.service'; @Component({ diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.spec.ts index b2522afc573..d1ee0a1fd83 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.spec.ts @@ -1,8 +1,8 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeRadioButtonComponent } from './configurator-attribute-radio-button.component'; describe('ConfigAttributeRadioButtonComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.ts index a89b248a401..e51839a49cb 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/radio-button/configurator-attribute-radio-button.component.ts @@ -7,9 +7,9 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-radio-button', templateUrl: './configurator-attribute-radio-button.component.html', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.spec.ts index 2bffeef978e..41d2c6b61e2 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.spec.ts @@ -1,9 +1,9 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorComponentTestUtilsService } from '../../../../shared/testing/configurator-component-test-utils.service'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeReadOnlyComponent } from './configurator-attribute-read-only.component'; describe('ConfigAttributeReadOnlyComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.ts index 7fd1341f3ee..361e65cc8b5 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/read-only/configurator-attribute-read-only.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-read-only', templateUrl: './configurator-attribute-read-only.component.html', diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.spec.ts b/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.spec.ts index 40d510ceda5..27b0e82d149 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.spec.ts @@ -3,8 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NgSelectModule } from '@ng-select/ng-select'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; import { ConfiguratorAttributeSingleSelectionImageComponent } from './configurator-attribute-single-selection-image.component'; describe('ConfigAttributeSingleSelectionImageComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.ts b/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.ts index b327bb1772f..ebec3a60a6e 100644 --- a/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.ts +++ b/feature-libs/product/configurators/common/src/components/attribute/types/single-selection-image/configurator-attribute-single-selection-image.component.ts @@ -7,9 +7,9 @@ import { Output, } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator } from '@spartacus/core'; import { ConfigFormUpdateEvent } from '../../../form/configurator-form.event'; import { ConfiguratorUIKeyGenerator } from '../../../service/configurator-ui-key-generator'; +import { Configurator } from './../../../../core/model/configurator.model'; @Component({ selector: 'cx-config-attribute-single-selection-image', diff --git a/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.spec.ts b/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.spec.ts index c01ddbbd843..2c1a351f0bb 100644 --- a/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.spec.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { Configurator } from '@spartacus/core'; import { ICON_TYPE } from '@spartacus/storefront'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorConflictDescriptionComponent } from './configurator-conflict-description.component'; @Component({ diff --git a/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.ts b/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.ts index 307b666fa19..9fa17b25c3f 100644 --- a/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.ts +++ b/feature-libs/product/configurators/common/src/components/conflict-description/configurator-conflict-description.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { Configurator } from '@spartacus/core'; import { ICON_TYPE } from '@spartacus/storefront'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-conflict-description', diff --git a/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.spec.ts b/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.spec.ts index 84d2416b67d..98f45dce76a 100644 --- a/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.spec.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorConflictSuggestionComponent } from './configurator-conflict-suggestion.component'; describe('ConfigurationConflictSuggestionComponent', () => { diff --git a/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.ts b/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.ts index 6f9eb9935ae..d72372bac28 100644 --- a/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.ts +++ b/feature-libs/product/configurators/common/src/components/conflict-suggestion/configurator-conflict-suggestion.component.ts @@ -1,5 +1,5 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-conflict-suggestion', diff --git a/feature-libs/product/configurators/common/src/components/form/configurator-form.component.spec.ts b/feature-libs/product/configurators/common/src/components/form/configurator-form.component.spec.ts index c4c849ea1a0..2a6d4c703e5 100644 --- a/feature-libs/product/configurators/common/src/components/form/configurator-form.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/form/configurator-form.component.spec.ts @@ -4,7 +4,6 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterState } from '@angular/router'; import { NgSelectModule } from '@ng-select/ng-select'; import { - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, I18nTestingModule, @@ -27,6 +26,7 @@ import { ConfiguratorAttributeMultiSelectionImageComponent } from '../attribute/ import { ConfiguratorAttributeRadioButtonComponent } from '../attribute/types/radio-button/configurator-attribute-radio-button.component'; import { ConfiguratorAttributeReadOnlyComponent } from '../attribute/types/read-only/configurator-attribute-read-only.component'; import { ConfiguratorAttributeSingleSelectionImageComponent } from '../attribute/types/single-selection-image/configurator-attribute-single-selection-image.component'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorFormComponent } from './configurator-form.component'; const PRODUCT_CODE = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts b/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts index 4260e42f15a..c907d568c09 100644 --- a/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts +++ b/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts @@ -1,9 +1,5 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; -import { - Configurator, - GenericConfigurator, - LanguageService, -} from '@spartacus/core'; +import { GenericConfigurator, LanguageService } from '@spartacus/core'; import { ConfigurationRouter, ConfiguratorRouterExtractorService, @@ -12,6 +8,7 @@ import { Observable } from 'rxjs'; import { distinctUntilChanged, filter, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfigFormUpdateEvent } from './configurator-form.event'; @Component({ diff --git a/feature-libs/product/configurators/common/src/components/form/configurator-form.event.ts b/feature-libs/product/configurators/common/src/components/form/configurator-form.event.ts index f70f28a4c63..3312f931f4d 100644 --- a/feature-libs/product/configurators/common/src/components/form/configurator-form.event.ts +++ b/feature-libs/product/configurators/common/src/components/form/configurator-form.event.ts @@ -1,4 +1,4 @@ -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; export class ConfigFormUpdateEvent { productCode: string; changedAttribute: Configurator.Attribute; diff --git a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts index 3cb33ff6645..bd300142ab0 100644 --- a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts @@ -4,7 +4,6 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router, RouterState } from '@angular/router'; import { NgSelectModule } from '@ng-select/ng-select'; import { - Configurator, GenericConfiguratorUtilsService, I18nTestingModule, RoutingService, @@ -20,6 +19,7 @@ import { productConfiguration, PRODUCT_CODE, } from '../../shared/testing/configurator-test-data'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorGroupMenuComponent } from './configurator-group-menu.component'; let mockGroupVisited = false; diff --git a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts index 6620b61dbe6..3b7492f36b8 100644 --- a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts +++ b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts @@ -1,5 +1,4 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { Configurator } from '@spartacus/core'; import { ConfigurationRouter, ConfiguratorRouterExtractorService, @@ -11,6 +10,7 @@ import { filter, map, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { ConfiguratorStorefrontUtilsService } from '../service/configurator-storefront-utils.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-group-menu', diff --git a/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.spec.ts b/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.spec.ts index 1b8b7b1298d..ab3d597f8f7 100644 --- a/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.spec.ts @@ -4,7 +4,6 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router, RouterState } from '@angular/router'; import { NgSelectModule } from '@ng-select/ng-select'; import { - Configurator, GenericConfiguratorUtilsService, I18nTestingModule, RoutingService, @@ -14,6 +13,7 @@ import { Observable, of } from 'rxjs'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import * as ConfigurationTestData from '../../shared/testing/configurator-test-data'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorGroupTitleComponent } from './configurator-group-title.component'; const config: Configurator.Configuration = diff --git a/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts b/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts index 578d97e4bfb..5a50533f7a2 100644 --- a/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts +++ b/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorRouterExtractorService, ICON_TYPE, @@ -8,6 +7,7 @@ import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-group-title', diff --git a/feature-libs/product/configurators/common/src/components/overview-attribute/configurator-overview-attribute.component.ts b/feature-libs/product/configurators/common/src/components/overview-attribute/configurator-overview-attribute.component.ts index 41cde164888..52e4ea2e07c 100644 --- a/feature-libs/product/configurators/common/src/components/overview-attribute/configurator-overview-attribute.component.ts +++ b/feature-libs/product/configurators/common/src/components/overview-attribute/configurator-overview-attribute.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-overview-attribute', diff --git a/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.spec.ts b/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.spec.ts index 81b736c3899..c7383a4f3e8 100644 --- a/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.spec.ts @@ -3,7 +3,6 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterState } from '@angular/router'; import { NgSelectModule } from '@ng-select/ng-select'; import { - Configurator, GenericConfigurator, I18nTestingModule, RoutingService, @@ -13,6 +12,7 @@ import { Observable, of } from 'rxjs'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import * as ConfigurationTestData from '../../shared/testing/configurator-test-data'; import { ConfiguratorOverviewAttributeComponent } from '../overview-attribute/configurator-overview-attribute.component'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorOverviewFormComponent } from './configurator-overview-form.component'; const owner: GenericConfigurator.Owner = diff --git a/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts b/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts index c693f3b4811..3e057f7ae28 100644 --- a/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts +++ b/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts @@ -1,5 +1,4 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { @@ -9,6 +8,7 @@ import { take, } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-overview-form', diff --git a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts index 1b71112761d..a410124d020 100644 --- a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ConfigurationRouter, ConfiguratorRouterExtractorService, @@ -12,6 +12,7 @@ import { productConfigurationWithConflicts, productConfigurationWithoutIssues, } from '../../shared/testing/configurator-test-data'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorOverviewNotificationBannerComponent } from './configurator-overview-notification-banner.component'; @Pipe({ diff --git a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts index 2341df1575d..1433ef29026 100644 --- a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts +++ b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { Configurator, GenericConfiguratorUtilsService } from '@spartacus/core'; +import { GenericConfiguratorUtilsService } from '@spartacus/core'; import { ConfigurationRouter, ConfiguratorRouterExtractorService, @@ -8,6 +8,7 @@ import { import { Observable } from 'rxjs'; import { distinctUntilKeyChanged, map, switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-overview-notification-banner', diff --git a/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.spec.ts b/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.spec.ts index d406de2e726..493b18c7b88 100644 --- a/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.spec.ts @@ -2,7 +2,6 @@ import { ChangeDetectionStrategy, Type } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { - Configurator, GenericConfiguratorUtilsService, I18nTestingModule, RouterState, @@ -16,6 +15,7 @@ import { ConfiguratorCommonsService } from '../../core/facade/configurator-commo import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import * as ConfigurationTestData from '../../shared/testing/configurator-test-data'; import { ConfiguratorStorefrontUtilsService } from '../service/configurator-storefront-utils.service'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorPreviousNextButtonsComponent } from './configurator-previous-next-buttons.component'; let routerStateObservable = null; diff --git a/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts b/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts index 0ca8a7fb7f0..5d25c37dbfb 100644 --- a/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts +++ b/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts @@ -1,11 +1,12 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { map, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { ConfiguratorStorefrontUtilsService } from '../service/configurator-storefront-utils.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-previous-next-buttons', diff --git a/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.spec.ts b/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.spec.ts index 1c569c433fc..b768dec7e68 100644 --- a/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.spec.ts @@ -1,7 +1,6 @@ import { ChangeDetectionStrategy } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { - Configurator, GenericConfigurator, I18nTestingModule, RouterState, @@ -9,6 +8,7 @@ import { } from '@spartacus/core'; import { Observable, of } from 'rxjs'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorPriceSummaryComponent } from './configurator-price-summary.component'; const PRODUCT_CODE = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts b/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts index e4a87608e3e..3eb388a9661 100644 --- a/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts +++ b/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts @@ -1,9 +1,9 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { Configurator } from '@spartacus/core'; import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; +import { Configurator } from './../../core/model/configurator.model'; @Component({ selector: 'cx-config-price-summary', diff --git a/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.spec.ts b/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.spec.ts index 6dd6b6e12b0..7ea072edab9 100644 --- a/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.spec.ts @@ -4,7 +4,6 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router, RouterState } from '@angular/router'; import { NgSelectModule } from '@ng-select/ng-select'; import { - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, I18nTestingModule, @@ -16,6 +15,7 @@ import { IconLoaderService } from '@spartacus/storefront'; import { Observable, of } from 'rxjs'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorComponentTestUtilsService } from '../../shared/testing/configurator-component-test-utils.service'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorProductTitleComponent } from './configurator-product-title.component'; const PRODUCT_CODE = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.spec.ts b/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.spec.ts index bebd9a78fbc..3f60c1948e5 100644 --- a/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.spec.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.spec.ts @@ -1,8 +1,9 @@ import { TestBed } from '@angular/core/testing'; import { FormControl } from '@angular/forms'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { Observable, of } from 'rxjs'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorStorefrontUtilsService } from './configurator-storefront-utils.service'; let isGroupVisited: Observable = of(false); diff --git a/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts b/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts index 792d5a69a6c..4be612c51d0 100644 --- a/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts @@ -1,10 +1,11 @@ import { isPlatformBrowser } from '@angular/common'; import { Inject, Injectable, PLATFORM_ID } from '@angular/core'; import { FormControl } from '@angular/forms'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; +import { Configurator } from './../../core/model/configurator.model'; @Injectable({ providedIn: 'root', diff --git a/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.spec.ts b/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.spec.ts index 2ea9ce6cd45..55c3e5449a0 100644 --- a/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.spec.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.spec.ts @@ -1,4 +1,4 @@ -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorUIKeyGenerator } from './configurator-ui-key-generator'; describe('ConfigUIKeyGeneratorService', () => { diff --git a/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.ts b/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.ts index 5b17c996b65..9091c8ebd5b 100644 --- a/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-ui-key-generator.ts @@ -1,4 +1,4 @@ -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; /** * Service to provide unique keys for elements on the UI and for sending to configurator diff --git a/projects/core/src/configurator/commons/connectors/configurator-commons.adapter.ts b/feature-libs/product/configurators/common/src/core/connectors/configurator-commons.adapter.ts similarity index 93% rename from projects/core/src/configurator/commons/connectors/configurator-commons.adapter.ts rename to feature-libs/product/configurators/common/src/core/connectors/configurator-commons.adapter.ts index 4f3eaf043aa..399652c813c 100644 --- a/projects/core/src/configurator/commons/connectors/configurator-commons.adapter.ts +++ b/feature-libs/product/configurators/common/src/core/connectors/configurator-commons.adapter.ts @@ -1,7 +1,6 @@ +import { CartModification, GenericConfigurator } from '@spartacus/core'; import { Observable } from 'rxjs'; -import { CartModification } from '../../../model/cart.model'; -import { Configurator } from '../../../model/configurator.model'; -import { GenericConfigurator } from '../../../model/generic-configurator.model'; +import { Configurator } from './../model/configurator.model'; export abstract class ConfiguratorCommonsAdapter { /** diff --git a/projects/core/src/configurator/commons/connectors/configurator-commons.connector.spec.ts b/feature-libs/product/configurators/common/src/core/connectors/configurator-commons.connector.spec.ts similarity index 95% rename from projects/core/src/configurator/commons/connectors/configurator-commons.connector.spec.ts rename to feature-libs/product/configurators/common/src/core/connectors/configurator-commons.connector.spec.ts index 7dbc8b570b1..7698221ac8f 100644 --- a/projects/core/src/configurator/commons/connectors/configurator-commons.connector.spec.ts +++ b/feature-libs/product/configurators/common/src/core/connectors/configurator-commons.connector.spec.ts @@ -1,10 +1,12 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; +import { + CartModification, + GenericConfigurator, + GenericConfiguratorUtilsService, +} from '@spartacus/core'; import { of } from 'rxjs'; -import { CartModification } from '../../../model/cart.model'; -import { Configurator } from '../../../model/configurator.model'; -import { GenericConfigurator } from '../../../model/generic-configurator.model'; -import { GenericConfiguratorUtilsService } from '../../generic/utils/generic-configurator-utils.service'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorCommonsAdapter } from './configurator-commons.adapter'; import { ConfiguratorCommonsConnector } from './configurator-commons.connector'; import createSpy = jasmine.createSpy; diff --git a/projects/core/src/configurator/commons/connectors/configurator-commons.connector.ts b/feature-libs/product/configurators/common/src/core/connectors/configurator-commons.connector.ts similarity index 88% rename from projects/core/src/configurator/commons/connectors/configurator-commons.connector.ts rename to feature-libs/product/configurators/common/src/core/connectors/configurator-commons.connector.ts index e4d1316718e..9ceb3ea7623 100644 --- a/projects/core/src/configurator/commons/connectors/configurator-commons.connector.ts +++ b/feature-libs/product/configurators/common/src/core/connectors/configurator-commons.connector.ts @@ -1,9 +1,11 @@ import { Injectable } from '@angular/core'; +import { + CartModification, + GenericConfigurator, + GenericConfiguratorUtilsService, +} from '@spartacus/core'; import { Observable } from 'rxjs'; -import { CartModification } from '../../../model/cart.model'; -import { Configurator } from '../../../model/configurator.model'; -import { GenericConfigurator } from '../../../model/generic-configurator.model'; -import { GenericConfiguratorUtilsService } from '../../generic/utils/generic-configurator-utils.service'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorCommonsAdapter } from './configurator-commons.adapter'; @Injectable({ diff --git a/projects/core/src/configurator/commons/connectors/converters.ts b/feature-libs/product/configurators/common/src/core/connectors/configurator-converters.ts similarity index 88% rename from projects/core/src/configurator/commons/connectors/converters.ts rename to feature-libs/product/configurators/common/src/core/connectors/configurator-converters.ts index 64601518caf..965e1fa30b8 100644 --- a/projects/core/src/configurator/commons/connectors/converters.ts +++ b/feature-libs/product/configurators/common/src/core/connectors/configurator-converters.ts @@ -1,6 +1,6 @@ import { InjectionToken } from '@angular/core'; -import { Configurator } from '../../../model/configurator.model'; -import { Converter } from '../../../util/converter.service'; +import { Converter } from '@spartacus/core'; +import { Configurator } from './../model/configurator.model'; export const CONFIGURATION_NORMALIZER = new InjectionToken< Converter diff --git a/projects/core/src/configurator/commons/connectors/index.ts b/feature-libs/product/configurators/common/src/core/connectors/index.ts similarity index 69% rename from projects/core/src/configurator/commons/connectors/index.ts rename to feature-libs/product/configurators/common/src/core/connectors/index.ts index c5e2361bca9..221db54f7c1 100644 --- a/projects/core/src/configurator/commons/connectors/index.ts +++ b/feature-libs/product/configurators/common/src/core/connectors/index.ts @@ -1,3 +1,3 @@ export * from './configurator-commons.adapter'; export * from './configurator-commons.connector'; -export * from './converters'; +export * from './configurator-converters'; diff --git a/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.spec.ts b/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.spec.ts index 1c820880bbc..f989feb2cf8 100644 --- a/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.spec.ts +++ b/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.spec.ts @@ -5,7 +5,6 @@ import { Store, StoreModule } from '@ngrx/store'; import { ActiveCartService, Cart, - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, OCC_USER_ID_ANONYMOUS, @@ -19,6 +18,7 @@ import { CONFIGURATOR_FEATURE, StateWithConfigurator, } from '../state/configurator-state'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorActions } from './../state/actions/index'; import { getConfiguratorReducers } from './../state/reducers/index'; import { ConfiguratorCartService } from './configurator-cart.service'; diff --git a/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.ts b/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.ts index 310dd6a8b01..2a47ac67853 100644 --- a/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.ts +++ b/feature-libs/product/configurators/common/src/core/facade/configurator-cart.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { ActiveCartService, - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, OCC_USER_ID_CURRENT, @@ -12,6 +11,7 @@ import { import { Observable } from 'rxjs'; import { delayWhen, filter, map, take, tap } from 'rxjs/operators'; import { StateWithConfigurator } from '../state/configurator-state'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorActions } from './../state/actions/index'; import { ConfiguratorSelectors } from './../state/selectors/index'; diff --git a/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.spec.ts b/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.spec.ts index 11f675fd591..e464f3b58be 100644 --- a/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.spec.ts +++ b/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.spec.ts @@ -5,7 +5,6 @@ import { Store, StoreModule } from '@ngrx/store'; import { ActiveCartService, Cart, - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, StateUtils, @@ -18,6 +17,7 @@ import { CONFIGURATOR_FEATURE, StateWithConfigurator, } from '../state/configurator-state'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorActions } from './../state/actions/index'; import { getConfiguratorReducers } from './../state/reducers/index'; import { ConfiguratorCartService } from './configurator-cart.service'; diff --git a/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.ts b/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.ts index 89037fd4db8..9b320fc3d3b 100644 --- a/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.ts +++ b/feature-libs/product/configurators/common/src/core/facade/configurator-commons.service.ts @@ -2,13 +2,13 @@ import { Injectable, isDevMode } from '@angular/core'; import { select, Store } from '@ngrx/store'; import { ActiveCartService, - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, } from '@spartacus/core'; import { Observable } from 'rxjs'; import { filter, map, switchMap, switchMapTo, take, tap } from 'rxjs/operators'; import { StateWithConfigurator } from '../state/configurator-state'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorActions } from './../state/actions/index'; import { ConfiguratorSelectors } from './../state/selectors/index'; import { ConfiguratorCartService } from './configurator-cart.service'; diff --git a/feature-libs/product/configurators/common/src/core/facade/configurator-group-status.service.ts b/feature-libs/product/configurators/common/src/core/facade/configurator-group-status.service.ts index a146dd9090a..ca77fa42ccb 100644 --- a/feature-libs/product/configurators/common/src/core/facade/configurator-group-status.service.ts +++ b/feature-libs/product/configurators/common/src/core/facade/configurator-group-status.service.ts @@ -1,9 +1,10 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; import { StateWithConfigurator } from '../state/configurator-state'; +import { Configurator } from './../model/configurator.model'; import { ConfiguratorActions } from './../state/actions/index'; import { ConfiguratorSelectors } from './../state/selectors/index'; import { ConfiguratorUtilsService } from './utils/configurator-utils.service'; diff --git a/feature-libs/product/configurators/common/src/core/facade/configurator-groups.service.ts b/feature-libs/product/configurators/common/src/core/facade/configurator-groups.service.ts index 5ba6c906f84..d13cf05e116 100644 --- a/feature-libs/product/configurators/common/src/core/facade/configurator-groups.service.ts +++ b/feature-libs/product/configurators/common/src/core/facade/configurator-groups.service.ts @@ -1,9 +1,10 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { Observable, of } from 'rxjs'; import { map, switchMap, take } from 'rxjs/operators'; import { StateWithConfigurator } from '../state/configurator-state'; +import { Configurator } from './../../core/model/configurator.model'; import { ConfiguratorActions } from './../state/actions/index'; import { ConfiguratorCommonsService } from './configurator-commons.service'; import { ConfiguratorGroupStatusService } from './configurator-group-status.service'; diff --git a/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.spec.ts b/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.spec.ts index 2f44b77bd5a..74ec649845f 100644 --- a/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.spec.ts +++ b/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.spec.ts @@ -1,12 +1,13 @@ import { Type } from '@angular/core'; import { async, TestBed } from '@angular/core/testing'; -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ATTRIBUTE_1_CHECKBOX, GROUP_ID_1, GROUP_ID_2, productConfiguration, } from '../../../shared/testing/configurator-test-data'; +import { Configurator } from './../../model/configurator.model'; import { ConfiguratorUtilsService } from './configurator-utils.service'; const CONFIG_ID = '1234-56-7890'; diff --git a/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.ts b/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.ts index 48826ed732b..a0b05868504 100644 --- a/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.ts +++ b/feature-libs/product/configurators/common/src/core/facade/utils/configurator-utils.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../model/configurator.model'; /** * Utility service for the facade layer. Supposed to be accessed by facade services diff --git a/feature-libs/product/configurators/common/src/core/index.ts b/feature-libs/product/configurators/common/src/core/index.ts index 08bbf5ec995..f7ce6726f20 100644 --- a/feature-libs/product/configurators/common/src/core/index.ts +++ b/feature-libs/product/configurators/common/src/core/index.ts @@ -1,3 +1,5 @@ export * from './common-configurator-core.module'; +export * from './connectors/index'; export * from './facade/index'; +export * from './model/configurator.model'; export * from './state/index'; diff --git a/projects/core/src/model/configurator.model.ts b/feature-libs/product/configurators/common/src/core/model/configurator.model.ts similarity index 98% rename from projects/core/src/model/configurator.model.ts rename to feature-libs/product/configurators/common/src/core/model/configurator.model.ts index 99a3bd9d076..e83758bcb66 100644 --- a/projects/core/src/model/configurator.model.ts +++ b/feature-libs/product/configurators/common/src/core/model/configurator.model.ts @@ -1,4 +1,4 @@ -import { GenericConfigurator } from './generic-configurator.model'; +import { GenericConfigurator } from '@spartacus/core'; export namespace Configurator { export interface Attribute { diff --git a/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.spec.ts b/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.spec.ts index 652a0c58543..c7ed02547d6 100644 --- a/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.spec.ts @@ -1,13 +1,13 @@ import { Type } from '@angular/core'; import { async, TestBed } from '@angular/core/testing'; import { - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, MULTI_CART_DATA, StateUtils, } from '@spartacus/core'; import { CONFIGURATOR_DATA } from '../configurator-state'; +import { Configurator } from './../../model/configurator.model'; import * as ConfiguratorActions from './configurator-cart.action'; const PRODUCT_CODE = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.ts b/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.ts index 71504d977bf..0d4e78dcb07 100644 --- a/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.ts +++ b/feature-libs/product/configurators/common/src/core/state/actions/configurator-cart.action.ts @@ -1,11 +1,11 @@ import { Action } from '@ngrx/store'; import { - Configurator, GenericConfigurator, MULTI_CART_DATA, StateUtils, } from '@spartacus/core'; import { CONFIGURATOR_DATA } from '../configurator-state'; +import { Configurator } from './../../model/configurator.model'; export const READ_CART_ENTRY_CONFIGURATION = '[Configurator] Read Cart Entry Configuration'; diff --git a/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.spec.ts b/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.spec.ts index 7d3a0022b07..fa01a3b165b 100644 --- a/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.spec.ts @@ -1,12 +1,12 @@ import { Type } from '@angular/core'; import { async, TestBed } from '@angular/core/testing'; import { - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, StateUtils, } from '@spartacus/core'; import { CONFIGURATOR_DATA } from '../configurator-state'; +import { Configurator } from './../../model/configurator.model'; import * as ConfiguratorActions from './configurator.action'; const PRODUCT_CODE = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.ts b/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.ts index 8c3622d85d4..5e230c1cb14 100644 --- a/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.ts +++ b/feature-libs/product/configurators/common/src/core/state/actions/configurator.action.ts @@ -1,5 +1,6 @@ -import { Configurator, GenericConfigurator, StateUtils } from '@spartacus/core'; +import { GenericConfigurator, StateUtils } from '@spartacus/core'; import { CONFIGURATOR_DATA } from '../configurator-state'; +import { Configurator } from './../../model/configurator.model'; export const CREATE_CONFIGURATION = '[Configurator] Create Configuration'; export const CREATE_CONFIGURATION_FAIL = diff --git a/feature-libs/product/configurators/common/src/core/state/configurator-state.ts b/feature-libs/product/configurators/common/src/core/state/configurator-state.ts index 992e3196486..0ecfbea1450 100644 --- a/feature-libs/product/configurators/common/src/core/state/configurator-state.ts +++ b/feature-libs/product/configurators/common/src/core/state/configurator-state.ts @@ -1,4 +1,5 @@ -import { Configurator, StateUtils } from '@spartacus/core'; +import { StateUtils } from '@spartacus/core'; +import { Configurator } from './../model/configurator.model'; export const CONFIGURATOR_FEATURE = 'productConfigurator'; export const CONFIGURATOR_DATA = '[Configurator] Configuration Data'; diff --git a/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts b/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts index dfc841dd3e5..66e7c8ab94e 100644 --- a/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts @@ -4,12 +4,7 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { provideMockActions } from '@ngrx/effects/testing'; import { Store, StoreModule } from '@ngrx/store'; -import { - Configurator, - ConfiguratorCommonsConnector, - GenericConfigurator, - normalizeHttpError, -} from '@spartacus/core'; +import { GenericConfigurator, normalizeHttpError } from '@spartacus/core'; import { cold, hot } from 'jasmine-marbles'; import { Observable, of, throwError } from 'rxjs'; import { ConfiguratorComponentTestUtilsService } from '../../../shared/testing/configurator-component-test-utils.service'; @@ -20,6 +15,8 @@ import { StateWithConfigurator, } from '../configurator-state'; import * as fromConfigurationReducers from '../reducers/index'; +import { ConfiguratorCommonsConnector } from './../../connectors/configurator-commons.connector'; +import { Configurator } from './../../model/configurator.model'; import * as fromEffects from './configurator-basic.effect'; const productCode = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.ts b/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.ts index 3fd7548b35a..4fad13870de 100644 --- a/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.ts +++ b/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.ts @@ -2,8 +2,6 @@ import { Injectable } from '@angular/core'; import { Actions, Effect, ofType } from '@ngrx/effects'; import { select, Store } from '@ngrx/store'; import { - Configurator, - ConfiguratorCommonsConnector, GenericConfiguratorUtilsService, normalizeHttpError, } from '@spartacus/core'; @@ -21,6 +19,8 @@ import { ConfiguratorUtilsService } from '../../facade/utils/configurator-utils. import { ConfiguratorActions } from '../actions/index'; import { StateWithConfigurator } from '../configurator-state'; import { ConfiguratorSelectors } from '../selectors/index'; +import { ConfiguratorCommonsConnector } from './../../connectors/configurator-commons.connector'; +import { Configurator } from './../../model/configurator.model'; @Injectable() /** diff --git a/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.spec.ts b/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.spec.ts index f15e271075c..188595523db 100644 --- a/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.spec.ts @@ -8,8 +8,6 @@ import { StoreModule } from '@ngrx/store'; import { CartActions, CartModification, - Configurator, - ConfiguratorCommonsConnector, GenericConfigurator, GenericConfiguratorUtilsService, normalizeHttpError, @@ -20,7 +18,9 @@ import { ConfiguratorComponentTestUtilsService } from '../../../shared/testing/c import { ConfiguratorActions } from '../actions/index'; import { CONFIGURATOR_FEATURE } from '../configurator-state'; import * as fromConfigurationReducers from '../reducers/index'; +import { ConfiguratorCommonsConnector } from './../../connectors/configurator-commons.connector'; import { ConfiguratorUtilsService } from './../../facade/utils/configurator-utils.service'; +import { Configurator } from './../../model/configurator.model'; import * as fromEffects from './configurator-cart.effect'; const productCode = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.ts b/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.ts index 412f34ef0fc..7b1258ee0c4 100644 --- a/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.ts +++ b/feature-libs/product/configurators/common/src/core/state/effects/configurator-cart.effect.ts @@ -4,8 +4,6 @@ import { select, Store } from '@ngrx/store'; import { CartActions, CartModification, - Configurator, - ConfiguratorCommonsConnector, GenericConfigurator, GenericConfiguratorUtilsService, normalizeHttpError, @@ -16,6 +14,8 @@ import { ConfiguratorUtilsService } from '../../facade/utils/configurator-utils. import { ConfiguratorActions } from '../actions/index'; import { StateWithConfigurator } from '../configurator-state'; import { ConfiguratorSelectors } from '../selectors/index'; +import { ConfiguratorCommonsConnector } from './../../connectors/configurator-commons.connector'; +import { Configurator } from './../../model/configurator.model'; @Injectable() /** diff --git a/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.spec.ts b/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.spec.ts index c1af11221ef..7a0afc86aa9 100644 --- a/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.spec.ts @@ -1,5 +1,6 @@ -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ConfiguratorActions } from '../actions/index'; +import { Configurator } from './../../model/configurator.model'; import * as StateReduce from './configurator.reducer'; const productCode = 'CONF_LAPTOP'; diff --git a/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.ts b/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.ts index b2916032689..f5e4d762066 100644 --- a/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.ts +++ b/feature-libs/product/configurators/common/src/core/state/reducers/configurator.reducer.ts @@ -1,5 +1,6 @@ -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; import { ConfiguratorActions } from '../actions/index'; +import { Configurator } from './../../model/configurator.model'; export const initialState: Configurator.Configuration = { configId: '', diff --git a/feature-libs/product/configurators/common/src/core/state/reducers/index.ts b/feature-libs/product/configurators/common/src/core/state/reducers/index.ts index 78310daac03..8a0349d3d20 100644 --- a/feature-libs/product/configurators/common/src/core/state/reducers/index.ts +++ b/feature-libs/product/configurators/common/src/core/state/reducers/index.ts @@ -1,7 +1,8 @@ import { InjectionToken, Provider } from '@angular/core'; import { ActionReducerMap } from '@ngrx/store'; -import { Configurator, StateUtils } from '@spartacus/core'; +import { StateUtils } from '@spartacus/core'; import { ConfiguratorState, CONFIGURATOR_DATA } from '../configurator-state'; +import { Configurator } from './../../model/configurator.model'; import { configuratorReducer } from './configurator.reducer'; export function getConfiguratorReducers(): ActionReducerMap { diff --git a/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.spec.ts b/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.spec.ts index db7857ee80c..d8f69f7491d 100644 --- a/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.spec.ts @@ -2,7 +2,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { select, Store, StoreModule } from '@ngrx/store'; import { - Configurator, GenericConfigurator, GenericConfiguratorUtilsService, } from '@spartacus/core'; @@ -12,6 +11,7 @@ import { StateWithConfigurator, } from '../configurator-state'; import * as fromReducers from '../reducers/index'; +import { Configurator } from './../../model/configurator.model'; import { ConfiguratorSelectors } from './index'; describe('Configurator selectors', () => { diff --git a/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.ts b/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.ts index 9f307bd23fa..616c2f06e9c 100644 --- a/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.ts +++ b/feature-libs/product/configurators/common/src/core/state/selectors/configurator.selector.ts @@ -3,12 +3,13 @@ import { createSelector, MemoizedSelector, } from '@ngrx/store'; -import { Configurator, StateUtils } from '@spartacus/core'; +import { StateUtils } from '@spartacus/core'; import { ConfiguratorState, CONFIGURATOR_FEATURE, StateWithConfigurator, } from '../configurator-state'; +import { Configurator } from './../../model/configurator.model'; export const getConfigurationsState: MemoizedSelector< StateWithConfigurator, diff --git a/feature-libs/product/configurators/common/src/index.ts b/feature-libs/product/configurators/common/src/index.ts index 3410b53707d..d5d9303d5d9 100644 --- a/feature-libs/product/configurators/common/src/index.ts +++ b/feature-libs/product/configurators/common/src/index.ts @@ -1,3 +1,4 @@ export * from './common-configurator.module'; export * from './components/index'; export * from './core/index'; +export * from './shared/testing/index'; diff --git a/feature-libs/product/configurators/common/src/shared/testing/configurator-component-test-utils.service.ts b/feature-libs/product/configurators/common/src/shared/testing/configurator-component-test-utils.service.ts index 1c38c182e31..30b9433eb14 100644 --- a/feature-libs/product/configurators/common/src/shared/testing/configurator-component-test-utils.service.ts +++ b/feature-libs/product/configurators/common/src/shared/testing/configurator-component-test-utils.service.ts @@ -2,7 +2,7 @@ * Configurator component test utils service provides helper functions for the component tests. */ -import { Configurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; export class ConfiguratorComponentTestUtilsService { /** @@ -103,7 +103,7 @@ export class ConfiguratorComponentTestUtilsService { value.images?.forEach((image) => Object.freeze(image)); } - protected static freezeOverview(overview: Configurator.Overview) { + static freezeOverview(overview: Configurator.Overview) { if (overview) { Object.freeze(overview); this.freezePriceSummary(overview.priceSummary); diff --git a/feature-libs/product/configurators/common/src/shared/testing/configurator-test-data.ts b/feature-libs/product/configurators/common/src/shared/testing/configurator-test-data.ts index 8c9690b674b..745ef13285f 100644 --- a/feature-libs/product/configurators/common/src/shared/testing/configurator-test-data.ts +++ b/feature-libs/product/configurators/common/src/shared/testing/configurator-test-data.ts @@ -1,4 +1,5 @@ -import { Configurator, GenericConfigurator } from '@spartacus/core'; +import { GenericConfigurator } from '@spartacus/core'; +import { Configurator } from './../../core/model/configurator.model'; export const PRODUCT_CODE = 'CONF_LAPTOP'; export const CONFIG_ID = '1234-56-7890'; diff --git a/feature-libs/product/configurators/common/src/shared/testing/index.ts b/feature-libs/product/configurators/common/src/shared/testing/index.ts new file mode 100644 index 00000000000..264b59af831 --- /dev/null +++ b/feature-libs/product/configurators/common/src/shared/testing/index.ts @@ -0,0 +1 @@ +export * from './configurator-component-test-utils.service'; diff --git a/feature-libs/product/configurators/variant/src/core/index.ts b/feature-libs/product/configurators/variant/src/core/index.ts index bdcd7de1152..b416c18b97f 100644 --- a/feature-libs/product/configurators/variant/src/core/index.ts +++ b/feature-libs/product/configurators/variant/src/core/index.ts @@ -1 +1,2 @@ +export * from './occ/index'; export * from './variant-configurator-core.module'; diff --git a/projects/core/src/occ/adapters/configurator/variant/configurator-variant-occ.module.ts b/feature-libs/product/configurators/variant/src/core/occ/configurator-variant-occ.module.ts similarity index 90% rename from projects/core/src/occ/adapters/configurator/variant/configurator-variant-occ.module.ts rename to feature-libs/product/configurators/variant/src/core/occ/configurator-variant-occ.module.ts index ee6ff475211..fab832e7d0b 100644 --- a/projects/core/src/occ/adapters/configurator/variant/configurator-variant-occ.module.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/configurator-variant-occ.module.ts @@ -1,8 +1,7 @@ import { CommonModule } from '@angular/common'; import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; -import { ConfigModule } from '../../../../config/config.module'; -import { ConfiguratorCommonsAdapter } from '../../../../configurator/commons/connectors/configurator-commons.adapter'; +import { ConfigModule } from '@spartacus/core'; import { CONFIGURATION_ADD_TO_CART_SERIALIZER, CONFIGURATION_NORMALIZER, @@ -10,7 +9,8 @@ import { CONFIGURATION_PRICE_SUMMARY_NORMALIZER, CONFIGURATION_SERIALIZER, CONFIGURATION_UPDATE_CART_ENTRY_SERIALIZER, -} from '../../../../configurator/commons/connectors/converters'; + ConfiguratorCommonsAdapter, +} from '@spartacus/product/configurators/common'; import { OccConfiguratorVariantAddToCartSerializer } from './converters/occ-configurator-variant-add-to-cart-serializer'; import { OccConfiguratorVariantNormalizer } from './converters/occ-configurator-variant-normalizer'; import { OccConfiguratorVariantOverviewNormalizer } from './converters/occ-configurator-variant-overview-normalizer'; diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/index.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/index.ts new file mode 100644 index 00000000000..58171fce5d3 --- /dev/null +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/index.ts @@ -0,0 +1,6 @@ +export * from './occ-configurator-variant-add-to-cart-serializer'; +export * from './occ-configurator-variant-normalizer'; +export * from './occ-configurator-variant-overview-normalizer'; +export * from './occ-configurator-variant-price-summary-normalizer'; +export * from './occ-configurator-variant-serializer'; +export * from './occ-configurator-variant-update-cart-entry-serializer'; diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts similarity index 96% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts index b54b3f62c2d..4aef525d84b 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts @@ -1,6 +1,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { Configurator } from '../../../../../model/configurator.model'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; import { OccConfiguratorVariantAddToCartSerializer } from './occ-configurator-variant-add-to-cart-serializer'; diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-add-to-cart-serializer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts similarity index 84% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-add-to-cart-serializer.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts index dc4d3c5e42e..06de02d6bff 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-add-to-cart-serializer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Configurator } from '../../../../../model/configurator.model'; -import { Converter } from '../../../../../util/converter.service'; +import { Converter } from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-normalizer.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.spec.ts similarity index 98% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-normalizer.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.spec.ts index cc96e6e9a38..0622764245c 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-normalizer.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.spec.ts @@ -1,10 +1,12 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; +import { + ConverterService, + OccConfig, + TranslationService, +} from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { Observable, of } from 'rxjs'; -import { TranslationService } from '../../../../../i18n/translation.service'; -import { Configurator } from '../../../../../model/configurator.model'; -import { ConverterService } from '../../../../../util/converter.service'; -import { OccConfig } from '../../../../config/occ-config'; import { OccConfigurator } from '../occ-configurator.models'; import { OccConfiguratorVariantNormalizer } from './occ-configurator-variant-normalizer'; @@ -548,6 +550,7 @@ describe('OccConfiguratorVariantNormalizer', () => { it('should convert image with media URL configured', () => { const images = []; + occConfig.backend.media.baseUrl = 'https://mediaBackendBaseUrl/'; occConfiguratorVariantNormalizer.convertImage(occImage, images); diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-normalizer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.ts similarity index 97% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-normalizer.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.ts index c5cb6eefac7..116fae522e5 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-normalizer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.ts @@ -1,9 +1,7 @@ import { Injectable } from '@angular/core'; +import { Converter, OccConfig, TranslationService } from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { take } from 'rxjs/operators'; -import { TranslationService } from '../../../../../i18n/translation.service'; -import { Configurator } from '../../../../../model/configurator.model'; -import { Converter } from '../../../../../util/converter.service'; -import { OccConfig } from '../../../../config/occ-config'; import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-overview-normalizer.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts similarity index 79% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-overview-normalizer.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts index 5bb1e637294..d5d4abd34de 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-overview-normalizer.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts @@ -1,9 +1,8 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; +import { ConverterService, TranslationService } from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { Observable, of } from 'rxjs'; -import { TranslationService } from '../../../../../i18n/translation.service'; -import { Configurator } from '../../../../../model/configurator.model'; -import { ConverterService } from '../../../../../util/converter.service'; import { OccConfigurator } from '../occ-configurator.models'; import { OccConfiguratorVariantOverviewNormalizer } from './occ-configurator-variant-overview-normalizer'; @@ -29,6 +28,7 @@ const convertedOverview: Configurator.Overview = { { id: '1', groupDescription: groupDescription, + attributes: [ { attribute: 'C1', @@ -36,6 +36,11 @@ const convertedOverview: Configurator.Overview = { }, ], }, + { + id: '11', + groupDescription: undefined, + attributes: [], + }, { id: '2', groupDescription: 'Group 2', @@ -53,24 +58,26 @@ const convertedOverview: Configurator.Overview = { ], }; -const subGroups: OccConfigurator.GroupOverview[] = [ - { - id: '3', - groupDescription: 'SubGroup', - characteristicValues: [{ characteristic: 'C3', value: 'V3' }], - subGroups: [ - { - id: '4', - groupDescription: 'SubGroupLevel2', - characteristicValues: null, - }, - ], - }, -]; +const group3: OccConfigurator.GroupOverview = { + id: '3', + groupDescription: 'SubGroup', + characteristicValues: [{ characteristic: 'C3', value: 'V3' }], + subGroups: [ + { + id: '4', + groupDescription: 'SubGroupLevel2', + characteristicValues: null, + }, + ], +}; +Object.freeze(group3); +const subGroups: OccConfigurator.GroupOverview[] = [group3]; +Object.freeze(subGroups); const group1: OccConfigurator.GroupOverview = { id: '1', groupDescription: groupDescription, + subGroups: [{ id: '11' }], characteristicValues: [ { characteristic: 'C1', @@ -78,6 +85,7 @@ const group1: OccConfigurator.GroupOverview = { }, ], }; +Object.freeze(group1); const generalGroup: OccConfigurator.GroupOverview = { id: generalGroupName, @@ -89,6 +97,7 @@ const generalGroup: OccConfigurator.GroupOverview = { }, ], }; +Object.freeze(generalGroup); const overview: OccConfigurator.Overview = { id: configId, @@ -113,6 +122,7 @@ const overview: OccConfigurator.Overview = { }, ], }; +Object.freeze(overview); class MockConverterService { convert(source: OccConfigurator.Prices) { @@ -149,28 +159,31 @@ describe('OccConfiguratorVariantNormalizer', () => { }); it('should cover sub groups', () => { - overview.groups[0].subGroups = subGroups; const result = occConfiguratorVariantOverviewNormalizer.convert(overview); - expect(result.groups.length).toBe(4); + expect(result.groups.length).toBe(3); }); it('should be able to handle groups without attributes', () => { - group1.subGroups = null; - group1.characteristicValues = null; - const result = occConfiguratorVariantOverviewNormalizer.convertGroup( - group1 - ); + const group: OccConfigurator.GroupOverview = { + subGroups: null, + characteristicValues: null, + id: group1.id, + }; + + const result = occConfiguratorVariantOverviewNormalizer.convertGroup(group); expect(result.length).toBe(1); - expect(result[0].id).toBe(group1.id); + expect(result[0].id).toBe(group.id); }); it('should be able to handle groups with subgroups', () => { - group1.subGroups = subGroups; + const groupWithSubgroups: OccConfigurator.GroupOverview = { + subGroups: [group1, group3], + }; const result = occConfiguratorVariantOverviewNormalizer.convertGroup( - group1 + groupWithSubgroups ); - expect(result.length).toBe(3); + expect(result.length).toBe(5); }); it('should set description for a general group', () => { const generalTargetGroup: Configurator.GroupOverview = { diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-overview-normalizer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.ts similarity index 87% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-overview-normalizer.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.ts index 028e914c065..5751390f7ab 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-overview-normalizer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.ts @@ -1,12 +1,14 @@ import { Injectable } from '@angular/core'; -import { take } from 'rxjs/operators'; -import { CONFIGURATION_PRICE_SUMMARY_NORMALIZER } from '../../../../../configurator/commons/connectors/converters'; -import { TranslationService } from '../../../../../i18n/translation.service'; -import { Configurator } from '../../../../../model/configurator.model'; import { Converter, ConverterService, -} from '../../../../../util/converter.service'; + TranslationService, +} from '@spartacus/core'; +import { + CONFIGURATION_PRICE_SUMMARY_NORMALIZER, + Configurator, +} from '@spartacus/product/configurators/common'; +import { take } from 'rxjs/operators'; import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-price-summary-normalizer.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts similarity index 95% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-price-summary-normalizer.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts index ed905469360..6bf2fd27ed3 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-price-summary-normalizer.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts @@ -1,6 +1,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { ConverterService } from '../../../../../util/converter.service'; +import { ConverterService } from '@spartacus/core'; import { OccConfigurator } from '../occ-configurator.models'; import { OccConfiguratorVariantPriceSummaryNormalizer } from './occ-configurator-variant-price-summary-normalizer'; diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-price-summary-normalizer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts similarity index 80% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-price-summary-normalizer.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts index b30cc86a1d8..9dcdff2f495 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-price-summary-normalizer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Configurator } from '../../../../../model/configurator.model'; -import { Converter } from '../../../../../util/converter.service'; +import { Converter } from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-serializer.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.spec.ts similarity index 99% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-serializer.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.spec.ts index e10328d3fb3..d815e58372f 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-serializer.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.spec.ts @@ -1,6 +1,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { Configurator } from '../../../../../model/configurator.model'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; import { OccConfiguratorVariantSerializer } from './occ-configurator-variant-serializer'; diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-serializer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts similarity index 97% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-serializer.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts index 50000037092..1ec851aef33 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-serializer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Configurator } from '../../../../../model/configurator.model'; -import { Converter } from '../../../../../util/converter.service'; +import { Converter } from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts similarity index 96% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts index 69ff7a8bf88..84d4eb70648 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts @@ -1,6 +1,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { Configurator } from '../../../../../model/configurator.model'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; import { OccConfiguratorVariantUpdateCartEntrySerializer } from './occ-configurator-variant-update-cart-entry-serializer'; diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-update-cart-entry-serializer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts similarity index 87% rename from projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-update-cart-entry-serializer.ts rename to feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts index 06940bd1de5..47648047a6e 100644 --- a/projects/core/src/occ/adapters/configurator/variant/converters/occ-configurator-variant-update-cart-entry-serializer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Configurator } from '../../../../../model/configurator.model'; -import { Converter } from '../../../../../util/converter.service'; +import { Converter } from '@spartacus/core'; +import { Configurator } from '@spartacus/product/configurators/common'; import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) diff --git a/projects/core/src/occ/adapters/configurator/variant/default-occ-configurator-variant-config.ts b/feature-libs/product/configurators/variant/src/core/occ/default-occ-configurator-variant-config.ts similarity index 95% rename from projects/core/src/occ/adapters/configurator/variant/default-occ-configurator-variant-config.ts rename to feature-libs/product/configurators/variant/src/core/occ/default-occ-configurator-variant-config.ts index 31ed9ffdeb0..0313cfbd571 100644 --- a/projects/core/src/occ/adapters/configurator/variant/default-occ-configurator-variant-config.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/default-occ-configurator-variant-config.ts @@ -1,4 +1,4 @@ -import { OccConfig } from '../../../config/occ-config'; +import { OccConfig } from '@spartacus/core'; export function defaultOccVariantConfiguratorConfigFactory(): OccConfig { return { diff --git a/feature-libs/product/configurators/variant/src/core/occ/index.ts b/feature-libs/product/configurators/variant/src/core/occ/index.ts new file mode 100644 index 00000000000..615047bd517 --- /dev/null +++ b/feature-libs/product/configurators/variant/src/core/occ/index.ts @@ -0,0 +1,4 @@ +export * from './configurator-variant-occ.module'; +export * from './converters/index'; +export { defaultOccVariantConfiguratorConfigFactory as ɵdefaultOccVariantConfiguratorConfigFactory } from './default-occ-configurator-variant-config'; +export * from './occ-configurator-variant.adapter'; diff --git a/projects/core/src/occ/adapters/configurator/variant/occ-configurator-variant.adapter.spec.ts b/feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.spec.ts similarity index 95% rename from projects/core/src/occ/adapters/configurator/variant/occ-configurator-variant.adapter.spec.ts rename to feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.spec.ts index 3c5bc154b0d..503bb5d01bf 100644 --- a/projects/core/src/occ/adapters/configurator/variant/occ-configurator-variant.adapter.spec.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.spec.ts @@ -4,20 +4,22 @@ import { } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { CART_MODIFICATION_NORMALIZER } from 'projects/core/src/cart'; -import { of } from 'rxjs'; -import { OccConfiguratorVariantAdapter } from '.'; +import { + ConverterService, + GenericConfigurator, + GenericConfiguratorUtilsService, + OccEndpointsService, +} from '@spartacus/core'; import { CONFIGURATION_NORMALIZER, CONFIGURATION_OVERVIEW_NORMALIZER, CONFIGURATION_PRICE_SUMMARY_NORMALIZER, CONFIGURATION_SERIALIZER, -} from '../../../../configurator/commons/connectors/converters'; -import { GenericConfiguratorUtilsService } from '../../../../configurator/generic/utils/generic-configurator-utils.service'; -import { Configurator } from '../../../../model/configurator.model'; -import { GenericConfigurator } from '../../../../model/generic-configurator.model'; -import { ConverterService } from '../../../../util/converter.service'; -import { OccEndpointsService } from '../../../services/occ-endpoints.service'; + Configurator, +} from '@spartacus/product/configurators/common'; +import { CART_MODIFICATION_NORMALIZER } from 'projects/core/src/cart'; +import { of } from 'rxjs'; +import { OccConfiguratorVariantAdapter } from '.'; import { OccConfigurator } from './occ-configurator.models'; class MockOccEndpointsService { diff --git a/projects/core/src/occ/adapters/configurator/variant/occ-configurator-variant.adapter.ts b/feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.ts similarity index 91% rename from projects/core/src/occ/adapters/configurator/variant/occ-configurator-variant.adapter.ts rename to feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.ts index aab7c7adf37..04a43400512 100644 --- a/projects/core/src/occ/adapters/configurator/variant/occ-configurator-variant.adapter.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.ts @@ -1,9 +1,12 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { CART_MODIFICATION_NORMALIZER } from '../../../../cart/connectors/entry/converters'; -import { ConfiguratorCommonsAdapter } from '../../../../configurator/commons/connectors/configurator-commons.adapter'; +import { + CartModification, + CART_MODIFICATION_NORMALIZER, + ConverterService, + GenericConfigurator, + OccEndpointsService, +} from '@spartacus/core'; import { CONFIGURATION_ADD_TO_CART_SERIALIZER, CONFIGURATION_NORMALIZER, @@ -11,12 +14,11 @@ import { CONFIGURATION_PRICE_SUMMARY_NORMALIZER, CONFIGURATION_SERIALIZER, CONFIGURATION_UPDATE_CART_ENTRY_SERIALIZER, -} from '../../../../configurator/commons/connectors/converters'; -import { CartModification } from '../../../../model/cart.model'; -import { GenericConfigurator } from '../../../../model/generic-configurator.model'; -import { ConverterService } from '../../../../util/converter.service'; -import { OccEndpointsService } from '../../../services/occ-endpoints.service'; -import { Configurator } from './../../../../model/configurator.model'; + Configurator, + ConfiguratorCommonsAdapter, +} from '@spartacus/product/configurators/common'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; import { OccConfigurator } from './occ-configurator.models'; @Injectable() diff --git a/projects/core/src/occ/adapters/configurator/variant/occ-configurator.models.ts b/feature-libs/product/configurators/variant/src/core/occ/occ-configurator.models.ts similarity index 97% rename from projects/core/src/occ/adapters/configurator/variant/occ-configurator.models.ts rename to feature-libs/product/configurators/variant/src/core/occ/occ-configurator.models.ts index 0abb44fa5c7..e48a3623126 100644 --- a/projects/core/src/occ/adapters/configurator/variant/occ-configurator.models.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/occ-configurator.models.ts @@ -114,9 +114,9 @@ export namespace OccConfigurator { } export interface GroupOverview { - id: string; - groupDescription: string; - characteristicValues: CharacteristicOverview[]; + id?: string; + groupDescription?: string; + characteristicValues?: CharacteristicOverview[]; subGroups?: GroupOverview[]; } diff --git a/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts b/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts index 96339f65e0e..f74981d7318 100644 --- a/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts +++ b/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts @@ -1,6 +1,7 @@ import { NgModule } from '@angular/core'; +import { ConfiguratorVariantOccModule } from './occ/configurator-variant-occ.module'; /** * Exposes the variant configurator core entities */ -@NgModule({}) +@NgModule({ imports: [ConfiguratorVariantOccModule] }) export class VariantConfiguratorCoreModule {} diff --git a/projects/core/public_api.ts b/projects/core/public_api.ts index 4bab06e3d29..6e5047060f6 100644 --- a/projects/core/public_api.ts +++ b/projects/core/public_api.ts @@ -8,14 +8,17 @@ export * from './src/cart/index'; export * from './src/checkout/index'; export * from './src/cms/index'; export * from './src/config/index'; -export * from './src/configurator/commons/index'; export * from './src/configurator/generic/index'; export * from './src/event/index'; export * from './src/features-config/index'; export * from './src/global-message/index'; export * from './src/i18n/index'; export * from './src/kyma/index'; +export { Cart } from './src/model/cart.model'; export * from './src/model/index'; +export { Facet, ProductSearchPage } from './src/model/product-search.model'; +/** AUGMENTABLE_TYPES_START */ +export { Product } from './src/model/product.model'; export * from './src/occ/index'; export * from './src/personalization/index'; export * from './src/process/index'; @@ -30,8 +33,4 @@ export * from './src/user/index'; export * from './src/util/index'; export * from './src/window/index'; -/** AUGMENTABLE_TYPES_START */ -export { Product } from './src/model/product.model'; -export { ProductSearchPage, Facet } from './src/model/product-search.model'; -export { Cart } from './src/model/cart.model'; /** AUGMENTABLE_TYPES_END */ diff --git a/projects/core/src/configurator/commons/index.ts b/projects/core/src/configurator/commons/index.ts deleted file mode 100644 index ac529b85abe..00000000000 --- a/projects/core/src/configurator/commons/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './connectors/index'; diff --git a/projects/core/src/model/index.ts b/projects/core/src/model/index.ts index 93b00e899bc..244c65f4303 100644 --- a/projects/core/src/model/index.ts +++ b/projects/core/src/model/index.ts @@ -1,7 +1,6 @@ export * from './address.model'; export * from './cart.model'; export * from './cms.model'; -export * from './configurator.model'; export * from './consent.model'; export * from './consignment-tracking.model'; export * from './customer-coupon.model'; diff --git a/projects/core/src/occ/adapters/configurator/variant/converters/index.ts b/projects/core/src/occ/adapters/configurator/variant/converters/index.ts deleted file mode 100644 index 3ec33b1f18c..00000000000 --- a/projects/core/src/occ/adapters/configurator/variant/converters/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './occ-configurator-variant-normalizer'; -export * from './occ-configurator-variant-serializer'; diff --git a/projects/core/src/occ/adapters/configurator/variant/index.ts b/projects/core/src/occ/adapters/configurator/variant/index.ts deleted file mode 100644 index abe7649e885..00000000000 --- a/projects/core/src/occ/adapters/configurator/variant/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './configurator-variant-occ.module'; -export * from './converters/index'; -export * from './occ-configurator-variant.adapter'; diff --git a/projects/core/src/occ/adapters/index.ts b/projects/core/src/occ/adapters/index.ts index cb4024e14f7..38435c05fd9 100644 --- a/projects/core/src/occ/adapters/index.ts +++ b/projects/core/src/occ/adapters/index.ts @@ -2,7 +2,6 @@ export * from './asm/index'; export * from './cart/index'; export * from './checkout/index'; export * from './cms/index'; -export * from './configurator/variant/index'; export * from './product/index'; export * from './site-context/index'; export * from './store-finder/index'; diff --git a/projects/core/src/occ/occ.module.ts b/projects/core/src/occ/occ.module.ts index 5d34820303d..99cbfdcb679 100644 --- a/projects/core/src/occ/occ.module.ts +++ b/projects/core/src/occ/occ.module.ts @@ -6,7 +6,6 @@ import { AsmOccModule } from './adapters/asm/asm-occ.module'; import { CartOccModule } from './adapters/cart/cart-occ.module'; import { CheckoutOccModule } from './adapters/checkout/checkout-occ.module'; import { CmsOccModule } from './adapters/cms/cms-occ.module'; -import { ConfiguratorVariantOccModule } from './adapters/configurator/variant/configurator-variant-occ.module'; import { ProductOccModule } from './adapters/product/product-occ.module'; import { SiteContextOccModule } from './adapters/site-context/site-context-occ.module'; import { StoreFinderOccModule } from './adapters/store-finder/store-finder-occ.module'; @@ -26,7 +25,6 @@ import { WithCredentialsInterceptor } from './interceptors/with-credentials.inte SiteContextOccModule, StoreFinderOccModule, UserOccModule, - ConfiguratorVariantOccModule, OccConfigLoaderModule.forRoot(), ], }) From 542bcae8401fac1bf4e3cfdb54e7b9e0353f7c0c Mon Sep 17 00:00:00 2001 From: Christoph Hinssen Date: Thu, 10 Sep 2020 07:28:30 +0200 Subject: [PATCH 2/5] GH-8835 Move router extractor service and rename router data --- ...rator-add-to-cart-button.component.spec.ts | 20 +-- ...nfigurator-add-to-cart-button.component.ts | 18 +- .../form/configurator-form.component.ts | 8 +- .../configurator-group-menu.component.ts | 11 +- .../configurator-group-title.component.ts | 6 +- .../message/configurator-message.component.ts | 2 +- .../configurator-overview-form.component.ts | 2 +- ...view-notification-banner.component.spec.ts | 10 +- ...-overview-notification-banner.component.ts | 10 +- ...gurator-previous-next-buttons.component.ts | 2 +- .../configurator-price-summary.component.ts | 2 +- .../configurator-product-title.component.ts | 6 +- .../service/configurator-router-data.ts | 2 +- ...figurator-router-extractor.service.spec.ts | 14 +- .../configurator-router-extractor.service.ts | 10 +- .../common/src/components/service/index.ts | 2 + .../tab-bar/configurator-tab-bar.component.ts | 11 +- .../configurator-textfield-form.component.ts | 2 +- .../src/variant-configurator.module.ts | 2 + .../commons/configuration-test-data.ts | 166 ------------------ .../src/cms-components/configurator/index.ts | 2 - 21 files changed, 64 insertions(+), 244 deletions(-) rename {projects/storefrontlib/src/cms-components/configurator/generic => feature-libs/product/configurators/common/src/components}/service/configurator-router-data.ts (90%) rename {projects/storefrontlib/src/cms-components/configurator/generic => feature-libs/product/configurators/common/src/components}/service/configurator-router-extractor.service.spec.ts (94%) rename {projects/storefrontlib/src/cms-components/configurator/generic => feature-libs/product/configurators/common/src/components}/service/configurator-router-extractor.service.ts (91%) delete mode 100644 projects/storefrontlib/src/cms-components/configurator/commons/configuration-test-data.ts diff --git a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts index ae72581a8bf..2c2cf7626f8 100644 --- a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.spec.ts @@ -7,13 +7,13 @@ import { RouterState, RoutingService, } from '@spartacus/core'; -import { ConfigurationRouter } from '@spartacus/storefront'; import { Observable, of } from 'rxjs'; import { ConfiguratorCartService } from '../../core/facade/configurator-cart.service'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import * as ConfigurationTestData from '../../shared/testing/configurator-test-data'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; import { ConfiguratorAddToCartButtonComponent } from './configurator-add-to-cart-button.component'; const CART_ENTRY_KEY = '1'; @@ -30,9 +30,9 @@ const navParamsOverview: any = { const attributes = {}; -const mockRouterData: ConfigurationRouter.Data = { +const mockRouterData: ConfiguratorRouter.Data = { configuratorType: configuratorType, - pageType: ConfigurationRouter.PageType.CONFIGURATION, + pageType: ConfiguratorRouter.PageType.CONFIGURATION, isOwnerCartEntry: false, owner: mockProductConfiguration.owner, }; @@ -86,7 +86,7 @@ function setRouterTestDataCartBoundAndConfigPage() { mockRouterData.isOwnerCartEntry = true; mockRouterData.owner.type = GenericConfigurator.OwnerType.CART_ENTRY; mockRouterData.owner.id = CART_ENTRY_KEY; - mockRouterData.pageType = ConfigurationRouter.PageType.CONFIGURATION; + mockRouterData.pageType = ConfiguratorRouter.PageType.CONFIGURATION; } function setRouterTestDataProductBoundAndConfigPage() { @@ -98,13 +98,13 @@ function setRouterTestDataProductBoundAndConfigPage() { mockRouterData.isOwnerCartEntry = false; mockRouterData.owner.type = GenericConfigurator.OwnerType.PRODUCT; mockRouterData.owner.id = ConfigurationTestData.PRODUCT_CODE; - mockRouterData.pageType = ConfigurationRouter.PageType.CONFIGURATION; + mockRouterData.pageType = ConfiguratorRouter.PageType.CONFIGURATION; } function performAddToCartOnOverview() { setRouterTestDataProductBoundAndConfigPage(); mockRouterState.state.semanticRoute = ROUTE_OVERVIEW; - mockRouterData.pageType = ConfigurationRouter.PageType.OVERVIEW; + mockRouterData.pageType = ConfiguratorRouter.PageType.OVERVIEW; initialize(); component.onAddToCart(mockProductConfiguration, mockRouterData); } @@ -123,7 +123,7 @@ function ensureCartBound() { function ensureCartBoundAndOnOverview() { setRouterTestDataCartBoundAndConfigPage(); mockRouterState.state.semanticRoute = ROUTE_OVERVIEW; - mockRouterData.pageType = ConfigurationRouter.PageType.OVERVIEW; + mockRouterData.pageType = ConfiguratorRouter.PageType.OVERVIEW; initialize(); } @@ -240,7 +240,7 @@ describe('ConfigAddToCartButtonComponent', () => { describe('onAddToCart', () => { it('should navigate to OV in case configuration is cart bound and we are on product config page', () => { - mockRouterData.pageType = ConfigurationRouter.PageType.CONFIGURATION; + mockRouterData.pageType = ConfiguratorRouter.PageType.CONFIGURATION; performUpdateCart(); expect(routingService.go).toHaveBeenCalledWith( navParamsOverview, @@ -265,7 +265,7 @@ describe('ConfigAddToCartButtonComponent', () => { it('should not remove configuration and display no message in case continue to cart is triggered on config page', () => { mockProductConfiguration.isCartEntryUpdateRequired = false; - mockRouterData.pageType = ConfigurationRouter.PageType.CONFIGURATION; + mockRouterData.pageType = ConfiguratorRouter.PageType.CONFIGURATION; performUpdateCart(); expect( configuratorCommonsService.removeConfiguration @@ -302,7 +302,7 @@ describe('ConfigAddToCartButtonComponent', () => { }); it('should navigate to cart in case configuration has not yet been added and process was triggered from overview', () => { - mockRouterData.pageType = ConfigurationRouter.PageType.OVERVIEW; + mockRouterData.pageType = ConfiguratorRouter.PageType.OVERVIEW; performAddToCartOnOverview(); expect(routingService.go).toHaveBeenCalledWith('cart'); }); diff --git a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts index 4f6153f8c7a..6c3122443dd 100644 --- a/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts +++ b/feature-libs/product/configurators/common/src/components/add-to-cart-button/configurator-add-to-cart-button.component.ts @@ -5,16 +5,14 @@ import { GlobalMessageType, RoutingService, } from '@spartacus/core'; -import { - ConfigurationRouter, - ConfiguratorRouterExtractorService, -} from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { filter, map, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCartService } from '../../core/facade/configurator-cart.service'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-add-to-cart-button', @@ -23,7 +21,7 @@ import { Configurator } from './../../core/model/configurator.model'; }) export class ConfiguratorAddToCartButtonComponent { container$: Observable<{ - routerData: ConfigurationRouter.Data; + routerData: ConfiguratorRouter.Data; configuration: Configurator.Configuration; hasPendingChanges: boolean; }> = this.configRouterExtractorService.extractRouterData().pipe( @@ -112,12 +110,12 @@ export class ConfiguratorAddToCartButtonComponent { /** * Decides on the resource key for the button. Depending on the business process (owner of the configuration) and the * need for a cart update, the text will differ - * @param {ConfigurationRouter.Data} routerData - Reflects the current router state + * @param {ConfiguratorRouter.Data} routerData - Reflects the current router state * @param {Configurator.Configuration} configuration - Configuration * @returns {string} The resource key that controls the button description */ getButtonResourceKey( - routerData: ConfigurationRouter.Data, + routerData: ConfiguratorRouter.Data, configuration: Configurator.Configuration ): string { if ( @@ -139,16 +137,16 @@ export class ConfiguratorAddToCartButtonComponent { * Triggers action and navigation, both depending on the context. Might result in an addToCart, updateCartEntry, * just a cart navigation or a browser back navigation * @param {Configurator.Configuration} configuration - Configuration - * @param {ConfigurationRouter.Data} routerData - Reflects the current router state + * @param {ConfiguratorRouter.Data} routerData - Reflects the current router state */ onAddToCart( configuration: Configurator.Configuration, - routerData: ConfigurationRouter.Data + routerData: ConfiguratorRouter.Data ): void { const pageType = routerData.pageType; const configuratorType = routerData.configuratorType; - const isOverview = pageType === ConfigurationRouter.PageType.OVERVIEW; + const isOverview = pageType === ConfiguratorRouter.PageType.OVERVIEW; const isOwnerCartEntry = routerData.owner.type === GenericConfigurator.OwnerType.CART_ENTRY; const owner = configuration.owner; diff --git a/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts b/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts index c907d568c09..49490b4954e 100644 --- a/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts +++ b/feature-libs/product/configurators/common/src/components/form/configurator-form.component.ts @@ -1,14 +1,12 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { GenericConfigurator, LanguageService } from '@spartacus/core'; -import { - ConfigurationRouter, - ConfiguratorRouterExtractorService, -} from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { distinctUntilChanged, filter, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; import { ConfigFormUpdateEvent } from './configurator-form.event'; @Component({ @@ -22,7 +20,7 @@ export class ConfiguratorFormComponent implements OnInit { > = this.configRouterExtractorService.extractRouterData().pipe( filter( (routerData) => - routerData.pageType === ConfigurationRouter.PageType.CONFIGURATION + routerData.pageType === ConfiguratorRouter.PageType.CONFIGURATION ), switchMap((routerData) => { return this.configuratorCommonsService.getOrCreateConfiguration( diff --git a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts index 3b7492f36b8..dd3b5e3042e 100644 --- a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts +++ b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts @@ -1,16 +1,13 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { - ConfigurationRouter, - ConfiguratorRouterExtractorService, - HamburgerMenuService, - ICON_TYPE, -} from '@spartacus/storefront'; +import { HamburgerMenuService, ICON_TYPE } from '@spartacus/storefront'; import { Observable, of } from 'rxjs'; import { filter, map, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { ConfiguratorStorefrontUtilsService } from '../service/configurator-storefront-utils.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-group-menu', @@ -19,7 +16,7 @@ import { Configurator } from './../../core/model/configurator.model'; }) export class ConfiguratorGroupMenuComponent { routerData$: Observable< - ConfigurationRouter.Data + ConfiguratorRouter.Data > = this.configRouterExtractorService.extractRouterData(); configuration$: Observable< diff --git a/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts b/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts index 5a50533f7a2..4d82119640d 100644 --- a/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts +++ b/feature-libs/product/configurators/common/src/components/group-title/configurator-group-title.component.ts @@ -1,13 +1,11 @@ import { Component } from '@angular/core'; -import { - ConfiguratorRouterExtractorService, - ICON_TYPE, -} from '@spartacus/storefront'; +import { ICON_TYPE } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-group-title', diff --git a/feature-libs/product/configurators/common/src/components/message/configurator-message.component.ts b/feature-libs/product/configurators/common/src/components/message/configurator-message.component.ts index 22bd52e2a92..aaa58b3b1eb 100644 --- a/feature-libs/product/configurators/common/src/components/message/configurator-message.component.ts +++ b/feature-libs/product/configurators/common/src/components/message/configurator-message.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; -import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { interval, Observable } from 'rxjs'; import { map, switchMap, withLatestFrom } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { MessageConfig } from '../config/message-config'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-message', diff --git a/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts b/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts index 3e057f7ae28..c69a3c23a5e 100644 --- a/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts +++ b/feature-libs/product/configurators/common/src/components/overview-form/configurator-overview-form.component.ts @@ -1,5 +1,4 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { distinctUntilKeyChanged, @@ -9,6 +8,7 @@ import { } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-overview-form', diff --git a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts index a410124d020..ad135143b37 100644 --- a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.spec.ts @@ -1,10 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { GenericConfigurator } from '@spartacus/core'; -import { - ConfigurationRouter, - ConfiguratorRouterExtractorService, -} from '@spartacus/storefront'; import { Observable, of } from 'rxjs'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorComponentTestUtilsService } from '../../shared/testing/configurator-component-test-utils.service'; @@ -13,6 +9,8 @@ import { productConfigurationWithoutIssues, } from '../../shared/testing/configurator-test-data'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; import { ConfiguratorOverviewNotificationBannerComponent } from './configurator-overview-notification-banner.component'; @Pipe({ @@ -31,9 +29,9 @@ class MockUrlPipe implements PipeTransform { const configuratorType = 'cpqconfigurator'; -const routerData: ConfigurationRouter.Data = { +const routerData: ConfiguratorRouter.Data = { configuratorType: configuratorType, - pageType: ConfigurationRouter.PageType.OVERVIEW, + pageType: ConfiguratorRouter.PageType.OVERVIEW, isOwnerCartEntry: true, owner: { type: GenericConfigurator.OwnerType.CART_ENTRY, diff --git a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts index 1433ef29026..a4e6ada52a7 100644 --- a/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts +++ b/feature-libs/product/configurators/common/src/components/overview-notification-banner/configurator-overview-notification-banner.component.ts @@ -1,14 +1,12 @@ import { Component } from '@angular/core'; import { GenericConfiguratorUtilsService } from '@spartacus/core'; -import { - ConfigurationRouter, - ConfiguratorRouterExtractorService, - ICON_TYPE, -} from '@spartacus/storefront'; +import { ICON_TYPE } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { distinctUntilKeyChanged, map, switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-overview-notification-banner', @@ -16,7 +14,7 @@ import { Configurator } from './../../core/model/configurator.model'; }) export class ConfiguratorOverviewNotificationBannerComponent { routerData$: Observable< - ConfigurationRouter.Data + ConfiguratorRouter.Data > = this.configRouterExtractorService.extractRouterData(); numberOfIssues$: Observable = this.routerData$.pipe( diff --git a/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts b/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts index 5d25c37dbfb..7d4c9deb273 100644 --- a/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts +++ b/feature-libs/product/configurators/common/src/components/previous-next-buttons/configurator-previous-next-buttons.component.ts @@ -1,12 +1,12 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { GenericConfigurator } from '@spartacus/core'; -import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { map, switchMap, take } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { ConfiguratorGroupsService } from '../../core/facade/configurator-groups.service'; import { ConfiguratorStorefrontUtilsService } from '../service/configurator-storefront-utils.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-previous-next-buttons', diff --git a/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts b/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts index 3eb388a9661..835452438c6 100644 --- a/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts +++ b/feature-libs/product/configurators/common/src/components/price-summary/configurator-price-summary.component.ts @@ -1,9 +1,9 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; import { Configurator } from './../../core/model/configurator.model'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-price-summary', diff --git a/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.ts b/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.ts index 21f609d9160..4f0e040a735 100644 --- a/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.ts +++ b/feature-libs/product/configurators/common/src/components/product-title/configurator-product-title.component.ts @@ -1,12 +1,10 @@ import { Component } from '@angular/core'; import { GenericConfigurator, Product, ProductService } from '@spartacus/core'; -import { - ConfiguratorRouterExtractorService, - ICON_TYPE, -} from '@spartacus/storefront'; +import { ICON_TYPE } from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { ConfiguratorCommonsService } from '../../core/facade/configurator-commons.service'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-product-title', diff --git a/projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-data.ts b/feature-libs/product/configurators/common/src/components/service/configurator-router-data.ts similarity index 90% rename from projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-data.ts rename to feature-libs/product/configurators/common/src/components/service/configurator-router-data.ts index d1a1a2464b1..618161e2e5b 100644 --- a/projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-data.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-router-data.ts @@ -1,5 +1,5 @@ import { GenericConfigurator } from '@spartacus/core'; -export namespace ConfigurationRouter { +export namespace ConfiguratorRouter { export enum PageType { CONFIGURATION = 'configuration', OVERVIEW = 'overview', diff --git a/projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-extractor.service.spec.ts b/feature-libs/product/configurators/common/src/components/service/configurator-router-extractor.service.spec.ts similarity index 94% rename from projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-extractor.service.spec.ts rename to feature-libs/product/configurators/common/src/components/service/configurator-router-extractor.service.spec.ts index f597ad60661..5290f255bbe 100644 --- a/projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-extractor.service.spec.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-router-extractor.service.spec.ts @@ -8,7 +8,7 @@ import { RoutingService, } from '@spartacus/core'; import { Observable, of } from 'rxjs'; -import { ConfigurationRouter } from './configurator-router-data'; +import { ConfiguratorRouter } from './configurator-router-data'; import { ConfiguratorRouterExtractorService } from './configurator-router-extractor.service'; const PRODUCT_CODE = 'CONF_LAPTOP'; @@ -107,14 +107,14 @@ describe('ConfigRouterExtractorService', () => { }); it('should determine configurator and page type from router state ', () => { - let routerData: ConfigurationRouter.Data; + let routerData: ConfiguratorRouter.Data; serviceUnderTest .extractRouterData() .subscribe((data) => (routerData = data)); expect(routerData.configuratorType).toBe(CONFIGURATOR_TYPE); expect(routerData.isOwnerCartEntry).toBe(false); expect(routerData.pageType).toBe( - ConfigurationRouter.PageType.CONFIGURATION + ConfiguratorRouter.PageType.CONFIGURATION ); }); @@ -123,20 +123,20 @@ describe('ConfigRouterExtractorService', () => { GenericConfigurator.OwnerType.CART_ENTRY; mockRouterState.state.params.entityKey = CART_ENTRY_NUMBER; mockRouterState.state.semanticRoute = OVERVIEW_ROUTE; - let routerData: ConfigurationRouter.Data; + let routerData: ConfiguratorRouter.Data; serviceUnderTest .extractRouterData() .subscribe((data) => (routerData = data)) .unsubscribe(); expect(routerData.configuratorType).toBe(CONFIGURATOR_TYPE); expect(routerData.isOwnerCartEntry).toBe(true); - expect(routerData.pageType).toBe(ConfigurationRouter.PageType.OVERVIEW); + expect(routerData.pageType).toBe(ConfiguratorRouter.PageType.OVERVIEW); expect(routerData.forceReload).toBe(false); }); it('should tell from the URL if we need to enforce a reload of a configuration', () => { mockRouterState.state.queryParams = { forceReload: 'true' }; - let routerData: ConfigurationRouter.Data; + let routerData: ConfiguratorRouter.Data; serviceUnderTest .extractRouterData() .subscribe((data) => (routerData = data)) @@ -147,7 +147,7 @@ describe('ConfigRouterExtractorService', () => { it('should tell from the URL if we need to resolve issues of a configuration', () => { mockRouterState.state.queryParams = { resolveIssues: 'true' }; - let routerData: ConfigurationRouter.Data; + let routerData: ConfiguratorRouter.Data; serviceUnderTest .extractRouterData() .subscribe((data) => (routerData = data)) diff --git a/projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-extractor.service.ts b/feature-libs/product/configurators/common/src/components/service/configurator-router-extractor.service.ts similarity index 91% rename from projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-extractor.service.ts rename to feature-libs/product/configurators/common/src/components/service/configurator-router-extractor.service.ts index bc480989735..61b3e08c805 100644 --- a/projects/storefrontlib/src/cms-components/configurator/generic/service/configurator-router-extractor.service.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-router-extractor.service.ts @@ -7,7 +7,7 @@ import { } from '@spartacus/core'; import { Observable } from 'rxjs'; import { filter, map } from 'rxjs/operators'; -import { ConfigurationRouter } from './configurator-router-data'; +import { ConfiguratorRouter } from './configurator-router-data'; /** * Service to extract the configuration owner key from the current route @@ -21,7 +21,7 @@ export class ConfiguratorRouterExtractorService { protected routingService: RoutingService ) {} - extractRouterData(): Observable { + extractRouterData(): Observable { return this.routingService.getRouterState().pipe( filter((routingData) => routingData.state.params.entityKey), //we don't need to cover the intermediate router states where a future route is already known. @@ -31,7 +31,7 @@ export class ConfiguratorRouterExtractorService { map((routingData) => { const owner = this.createOwnerFromRouterState(routingData); - const routerData: ConfigurationRouter.Data = { + const routerData: ConfiguratorRouter.Data = { owner: owner, isOwnerCartEntry: owner.type === GenericConfigurator.OwnerType.CART_ENTRY, @@ -45,8 +45,8 @@ export class ConfiguratorRouterExtractorService { pageType: routingData.state.semanticRoute.includes( this.ROUTE_FRAGMENT_OVERVIEW ) - ? ConfigurationRouter.PageType.OVERVIEW - : ConfigurationRouter.PageType.CONFIGURATION, + ? ConfiguratorRouter.PageType.OVERVIEW + : ConfiguratorRouter.PageType.CONFIGURATION, }; return routerData; diff --git a/feature-libs/product/configurators/common/src/components/service/index.ts b/feature-libs/product/configurators/common/src/components/service/index.ts index 72383bc854f..415917f029b 100644 --- a/feature-libs/product/configurators/common/src/components/service/index.ts +++ b/feature-libs/product/configurators/common/src/components/service/index.ts @@ -1,2 +1,4 @@ +export * from './configurator-router-data'; +export * from './configurator-router-extractor.service'; export * from './configurator-storefront-utils.service'; export * from './configurator-ui-key-generator'; diff --git a/feature-libs/product/configurators/common/src/components/tab-bar/configurator-tab-bar.component.ts b/feature-libs/product/configurators/common/src/components/tab-bar/configurator-tab-bar.component.ts index 73a325a3181..fe338c6f939 100644 --- a/feature-libs/product/configurators/common/src/components/tab-bar/configurator-tab-bar.component.ts +++ b/feature-libs/product/configurators/common/src/components/tab-bar/configurator-tab-bar.component.ts @@ -1,10 +1,9 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { - ConfigurationRouter, - ConfiguratorRouterExtractorService, -} from '@spartacus/storefront'; +import {} from '@spartacus/storefront'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { ConfiguratorRouter } from './../service/configurator-router-data'; +import { ConfiguratorRouterExtractorService } from './../service/configurator-router-extractor.service'; @Component({ selector: 'cx-config-tab-bar', @@ -13,13 +12,13 @@ import { map } from 'rxjs/operators'; }) export class ConfiguratorTabBarComponent { routerData$: Observable< - ConfigurationRouter.Data + ConfiguratorRouter.Data > = this.configRouterExtractorService.extractRouterData(); isOverviewPage$: Observable = this.routerData$.pipe( map( (routerData) => - routerData.pageType === ConfigurationRouter.PageType.OVERVIEW + routerData.pageType === ConfiguratorRouter.PageType.OVERVIEW ) ); diff --git a/feature-libs/product/configurators/textfield/src/components/form/configurator-textfield-form.component.ts b/feature-libs/product/configurators/textfield/src/components/form/configurator-textfield-form.component.ts index 3da95a980d0..f633a3e68fd 100644 --- a/feature-libs/product/configurators/textfield/src/components/form/configurator-textfield-form.component.ts +++ b/feature-libs/product/configurators/textfield/src/components/form/configurator-textfield-form.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; import { GenericConfigurator } from '@spartacus/core'; -import { ConfiguratorRouterExtractorService } from '@spartacus/storefront'; +import { ConfiguratorRouterExtractorService } from '@spartacus/product/configurators/common'; import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { ConfiguratorTextfieldService } from '../../core/facade/configurator-textfield.service'; diff --git a/feature-libs/product/configurators/variant/src/variant-configurator.module.ts b/feature-libs/product/configurators/variant/src/variant-configurator.module.ts index 750b97277ed..a84ca989e95 100644 --- a/feature-libs/product/configurators/variant/src/variant-configurator.module.ts +++ b/feature-libs/product/configurators/variant/src/variant-configurator.module.ts @@ -1,5 +1,6 @@ import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; +import { VariantConfiguratorCoreModule } from './core/variant-configurator-core.module'; import { InteractiveConfiguratorModule } from './interactive-configurator.module'; import { OverviewConfiguratorModule } from './overview-configurator.module'; @@ -9,6 +10,7 @@ import { OverviewConfiguratorModule } from './overview-configurator.module'; @NgModule({ imports: [ CommonModule, + VariantConfiguratorCoreModule, InteractiveConfiguratorModule, OverviewConfiguratorModule, ], diff --git a/projects/storefrontlib/src/cms-components/configurator/commons/configuration-test-data.ts b/projects/storefrontlib/src/cms-components/configurator/commons/configuration-test-data.ts deleted file mode 100644 index 7af96454ee4..00000000000 --- a/projects/storefrontlib/src/cms-components/configurator/commons/configuration-test-data.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { Configurator, GenericConfigurator } from '@spartacus/core'; - -export const PRODUCT_CODE = 'CONF_LAPTOP'; -export const CONFIG_ID = '1234-56-7890'; - -export const GROUP_ID_1 = '1234-56-7891'; -export const GROUP_ID_2 = '1234-56-7892'; -export const GROUP_ID_3 = '1234-56-7893'; -export const GROUP_ID_4 = '1234-56-7894'; -export const GROUP_ID_5 = '1234-56-7895'; -export const GROUP_ID_6 = '1234-56-7896'; -export const GROUP_ID_7 = '1234-56-7897'; -export const GROUP_ID_8 = '1234-56-7898'; -export const GROUP_ID_9 = '1234-56-7899'; -export const GROUP_ID_10 = '1234-56-7900'; - -const CONFIGURATOR_URL = - 'electronics-spa/en/USD/configureCPQCONFIGURATOR/product/entityKey/WCEM_DEPENDENCY_PC'; - -export const mockRouterState: any = { - state: { - params: { - entityKey: PRODUCT_CODE, - ownerType: GenericConfigurator.OwnerType.PRODUCT, - }, - queryParams: {}, - url: CONFIGURATOR_URL, - }, -}; - -export const productConfiguration: Configurator.Configuration = { - configId: CONFIG_ID, - productCode: PRODUCT_CODE, - consistent: true, - complete: true, - groups: [ - { - id: GROUP_ID_1, - attributes: [ - { - name: 'ATTRIBUTE_1_CHECKBOX', - uiType: Configurator.UiType.CHECKBOXLIST, - required: true, - incomplete: true, - }, - ], - subGroups: [], - }, - - { - id: GROUP_ID_2, - attributes: [ - { - name: 'ATTRIBUTE_2_RADIOBUTTON', - uiType: Configurator.UiType.RADIOBUTTON, - required: false, - incomplete: false, - }, - ], - subGroups: [], - }, - { - id: GROUP_ID_3, - attributes: [ - { - name: 'ATTRIBUTE_3_SINGLESELECTIONIMAGE', - uiType: Configurator.UiType.SINGLE_SELECTION_IMAGE, - required: true, - incomplete: true, - }, - ], - subGroups: [{ id: GROUP_ID_4, subGroups: [], attributes: [] }], - }, - { - id: GROUP_ID_5, - attributes: [ - { - name: 'ATTRIBUTE_5_STRING', - uiType: Configurator.UiType.STRING, - required: true, - incomplete: false, - }, - { - name: 'ATTRIBUTE_5_DROPDOWN', - uiType: Configurator.UiType.DROPDOWN, - required: true, - incomplete: true, - }, - ], - - subGroups: [ - { id: GROUP_ID_6, subGroups: [], attributes: [] }, - { - id: GROUP_ID_7, - subGroups: [{ id: GROUP_ID_8, subGroups: [], attributes: [] }], - attributes: [], - }, - ], - }, - - { - id: GROUP_ID_9, - subGroups: [ - { - id: GROUP_ID_10, - attributes: [ - { - name: 'ATTRIBUTE_10_DROPDOWN', - uiType: Configurator.UiType.DROPDOWN, - required: true, - incomplete: false, - }, - ], - subGroups: [], - }, - ], - }, - ], - flatGroups: [ - { id: GROUP_ID_1 }, - { id: GROUP_ID_2 }, - { id: GROUP_ID_4 }, - { id: GROUP_ID_6 }, - { id: GROUP_ID_7 }, - { id: GROUP_ID_10 }, - ], - owner: { - id: PRODUCT_CODE, - type: GenericConfigurator.OwnerType.PRODUCT, - }, - nextOwner: {}, - interactionState: { - currentGroup: GROUP_ID_2, - menuParentGroup: GROUP_ID_3, - groupsStatus: {}, - groupsVisited: {}, - }, - overview: { - groups: [ - { - id: '1', - groupDescription: 'Group 1', - attributes: [ - { - attribute: 'C1', - value: 'V1', - }, - ], - }, - { - id: '2', - groupDescription: 'Group 2', - attributes: [ - { - attribute: 'C2', - value: 'V2', - }, - { - attribute: 'C3', - value: 'V3', - }, - ], - }, - ], - }, -}; diff --git a/projects/storefrontlib/src/cms-components/configurator/index.ts b/projects/storefrontlib/src/cms-components/configurator/index.ts index 23bbcf7d294..ee5df8bd6cc 100644 --- a/projects/storefrontlib/src/cms-components/configurator/index.ts +++ b/projects/storefrontlib/src/cms-components/configurator/index.ts @@ -2,5 +2,3 @@ export * from './generic/configure-cart-entry/configure-cart-entry.component'; export * from './generic/configure-issues-notification/configure-issues-notification.component'; export * from './generic/configure-product/configure-product.component'; export * from './generic/generic-configurator.module'; -export * from './generic/service/configurator-router-data'; -export * from './generic/service/configurator-router-extractor.service'; From 273f11e70f7f7d6874c25258fd52e6733a592c0f Mon Sep 17 00:00:00 2001 From: Christoph Hinssen Date: Thu, 10 Sep 2020 08:13:59 +0200 Subject: [PATCH 3/5] GH-8835 Remove obsolete code --- .../configurator-group-menu.component.spec.ts | 6 +----- .../configurator-group-menu.component.ts | 1 + .../configurator-storefront-utils.service.ts | 2 +- .../effects/configurator-basic.effect.spec.ts | 21 ++++++++++++++++++- ...urator-variant-price-summary-normalizer.ts | 2 -- .../occ-configurator-variant-serializer.ts | 2 -- ...or-variant-update-cart-entry-serializer.ts | 2 -- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts index bd300142ab0..31aa4abc3e8 100644 --- a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts +++ b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.spec.ts @@ -75,10 +75,6 @@ class MockCxIconComponent { @Input() type: ICON_TYPE; } -class MockConfigUtilsService { - scrollToConfigurationElement(): void {} -} - let component: ConfiguratorGroupMenuComponent; let fixture: ComponentFixture; let configuratorGroupsService: ConfiguratorGroupsService; @@ -124,7 +120,7 @@ describe('ConfigurationGroupMenuComponent', () => { }, { provide: ConfiguratorStorefrontUtilsService, - useClass: MockConfigUtilsService, + useClass: ConfiguratorStorefrontUtilsService, }, ], }); diff --git a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts index dd3b5e3042e..d61266b0dbf 100644 --- a/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts +++ b/feature-libs/product/configurators/common/src/components/group-menu/configurator-group-menu.component.ts @@ -96,6 +96,7 @@ export class ConfiguratorGroupMenuComponent { if (!this.configuratorGroupsService.hasSubGroups(group)) { this.configuratorGroupsService.navigateToGroup(configuration, group.id); this.hamburgerMenuService.toggle(true); + this.configUtils.scrollToConfigurationElement( '.VariantConfigurationTemplate' ); diff --git a/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts b/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts index 4be612c51d0..45dc4c301e4 100644 --- a/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts +++ b/feature-libs/product/configurators/common/src/components/service/configurator-storefront-utils.service.ts @@ -100,7 +100,7 @@ export class ConfiguratorStorefrontUtilsService { if (isPlatformBrowser(this.platformId)) { // we don't want to run this logic when doing SSR const element = document.querySelector(selector); - if (!this.isInViewport(element)) { + if (element && !this.isInViewport(element)) { this.scroll(element); } } diff --git a/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts b/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts index 66e7c8ab94e..2d71e1a36ed 100644 --- a/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts +++ b/feature-libs/product/configurators/common/src/core/state/effects/configurator-basic.effect.spec.ts @@ -33,6 +33,23 @@ const owner: GenericConfigurator.Owner = { key: 'product/CONF_LAPTOP', }; +const group: Configurator.Group = { + id: groupId, + attributes: [{ name: 'attrName' }], + subGroups: [], +}; + +const groupWithSubGroup: Configurator.Group = { + id: groupId, + attributes: [ + { + name: 'attrName', + images: [{ url: 'imageAttr' }], + values: [{ name: 'val', images: [{ url: 'imageVal' }] }], + }, + ], + subGroups: [group], +}; const productConfiguration: Configurator.Configuration = { configId: 'a', productCode: productCode, @@ -53,7 +70,9 @@ const productConfiguration: Configurator.Configuration = { }, ], }, - groups: [{ id: groupId, attributes: [{ name: 'attrName' }], subGroups: [] }], + groups: [group, groupWithSubGroup], + flatGroups: [group], + priceSummary: {}, }; ConfiguratorComponentTestUtilsService.freezeProductConfiguration( productConfiguration diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts index 9dcdff2f495..fdf4cc4d9b3 100644 --- a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts @@ -6,8 +6,6 @@ import { OccConfigurator } from '../occ-configurator.models'; @Injectable({ providedIn: 'root' }) export class OccConfiguratorVariantPriceSummaryNormalizer implements Converter { - constructor() {} - convert( source: OccConfigurator.Prices, target?: Configurator.PriceSummary diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts index 1ec851aef33..819c7af47e8 100644 --- a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts @@ -7,8 +7,6 @@ import { OccConfigurator } from '../occ-configurator.models'; export class OccConfiguratorVariantSerializer implements Converter { - constructor() {} - convert( source: Configurator.Configuration, target?: OccConfigurator.Configuration diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts index 47648047a6e..573ce401638 100644 --- a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts +++ b/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts @@ -10,8 +10,6 @@ export class OccConfiguratorVariantUpdateCartEntrySerializer Configurator.UpdateConfigurationForCartEntryParameters, OccConfigurator.UpdateConfigurationForCartEntryParameters > { - constructor() {} - convert( source: Configurator.UpdateConfigurationForCartEntryParameters, target?: OccConfigurator.UpdateConfigurationForCartEntryParameters From 6efdc8d80429ed1e5bc60bab42e568977bd0872b Mon Sep 17 00:00:00 2001 From: Christoph Hinssen Date: Fri, 11 Sep 2020 07:20:11 +0200 Subject: [PATCH 4/5] GH-8835 Restore formatting in public_api.ts --- projects/core/public_api.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/core/public_api.ts b/projects/core/public_api.ts index 6e5047060f6..d2370288c8b 100644 --- a/projects/core/public_api.ts +++ b/projects/core/public_api.ts @@ -14,11 +14,7 @@ export * from './src/features-config/index'; export * from './src/global-message/index'; export * from './src/i18n/index'; export * from './src/kyma/index'; -export { Cart } from './src/model/cart.model'; export * from './src/model/index'; -export { Facet, ProductSearchPage } from './src/model/product-search.model'; -/** AUGMENTABLE_TYPES_START */ -export { Product } from './src/model/product.model'; export * from './src/occ/index'; export * from './src/personalization/index'; export * from './src/process/index'; @@ -33,4 +29,8 @@ export * from './src/user/index'; export * from './src/util/index'; export * from './src/window/index'; +/** AUGMENTABLE_TYPES_START */ +export { Cart } from './src/model/cart.model'; +export { Facet, ProductSearchPage } from './src/model/product-search.model'; +export { Product } from './src/model/product.model'; /** AUGMENTABLE_TYPES_END */ From 654da7536e78307f16462731e52b215f9a6d5f39 Mon Sep 17 00:00:00 2001 From: Christoph Hinssen Date: Fri, 11 Sep 2020 07:55:21 +0200 Subject: [PATCH 5/5] GH-8835 occ as sibling to core and components --- .../src/core/textfield-configurator-core.module.ts | 3 +-- feature-libs/product/configurators/textfield/src/index.ts | 1 + .../textfield/src/{core => }/occ/converters/index.ts | 0 ...cc-configurator-textfield-add-to-cart-serializer.spec.ts | 2 +- .../occ-configurator-textfield-add-to-cart-serializer.ts | 2 +- .../occ-configurator-textfield-normalizer.spec.ts | 2 +- .../occ/converters/occ-configurator-textfield-normalizer.ts | 2 +- ...figurator-textfield-update-cart-entry-serializer.spec.ts | 2 +- ...c-configurator-textfield-update-cart-entry-serializer.ts | 2 +- .../occ/default-occ-configurator-textfield-config.ts | 0 .../configurators/textfield/src/{core => }/occ/index.ts | 2 +- .../occ/occ-configurator-textfield.adapter.spec.ts | 4 ++-- .../{core => }/occ/occ-configurator-textfield.adapter.ts | 6 +++--- .../src/{core => }/occ/occ-configurator-textfield.models.ts | 0 .../textfield-configurator-occ.module.ts} | 6 +++--- .../textfield/src/textfield-configurator.module.ts | 2 ++ .../product/configurators/variant/src/core/index.ts | 1 - .../variant/src/core/variant-configurator-core.module.ts | 4 ++-- feature-libs/product/configurators/variant/src/index.ts | 1 + .../variant/src/{core => }/occ/converters/index.ts | 0 .../occ-configurator-variant-add-to-cart-serializer.spec.ts | 0 .../occ-configurator-variant-add-to-cart-serializer.ts | 0 .../converters/occ-configurator-variant-normalizer.spec.ts | 0 .../occ/converters/occ-configurator-variant-normalizer.ts | 0 .../occ-configurator-variant-overview-normalizer.spec.ts | 0 .../occ-configurator-variant-overview-normalizer.ts | 0 ...cc-configurator-variant-price-summary-normalizer.spec.ts | 0 .../occ-configurator-variant-price-summary-normalizer.ts | 0 .../converters/occ-configurator-variant-serializer.spec.ts | 0 .../occ/converters/occ-configurator-variant-serializer.ts | 0 ...onfigurator-variant-update-cart-entry-serializer.spec.ts | 0 ...occ-configurator-variant-update-cart-entry-serializer.ts | 0 .../occ/default-occ-configurator-variant-config.ts | 0 .../configurators/variant/src/{core => }/occ/index.ts | 2 +- .../{core => }/occ/occ-configurator-variant.adapter.spec.ts | 0 .../src/{core => }/occ/occ-configurator-variant.adapter.ts | 0 .../variant/src/{core => }/occ/occ-configurator.models.ts | 0 .../variant-configurator-occ.module.ts} | 2 +- .../variant/src/variant-configurator.module.ts | 2 ++ 39 files changed, 26 insertions(+), 22 deletions(-) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/index.ts (100%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts (95%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts (95%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/occ-configurator-textfield-normalizer.spec.ts (94%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/occ-configurator-textfield-normalizer.ts (91%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts (95%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts (95%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/default-occ-configurator-textfield-config.ts (100%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/index.ts (62%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/occ-configurator-textfield.adapter.spec.ts (97%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/occ-configurator-textfield.adapter.ts (93%) rename feature-libs/product/configurators/textfield/src/{core => }/occ/occ-configurator-textfield.models.ts (100%) rename feature-libs/product/configurators/textfield/src/{core/occ/configurator-textfield-occ.module.ts => occ/textfield-configurator-occ.module.ts} (90%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/index.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-normalizer.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-normalizer.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-overview-normalizer.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-price-summary-normalizer.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-serializer.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-serializer.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/default-occ-configurator-variant-config.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/index.ts (82%) rename feature-libs/product/configurators/variant/src/{core => }/occ/occ-configurator-variant.adapter.spec.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/occ-configurator-variant.adapter.ts (100%) rename feature-libs/product/configurators/variant/src/{core => }/occ/occ-configurator.models.ts (100%) rename feature-libs/product/configurators/variant/src/{core/occ/configurator-variant-occ.module.ts => occ/variant-configurator-occ.module.ts} (98%) diff --git a/feature-libs/product/configurators/textfield/src/core/textfield-configurator-core.module.ts b/feature-libs/product/configurators/textfield/src/core/textfield-configurator-core.module.ts index c2be566b429..b12001b1c33 100644 --- a/feature-libs/product/configurators/textfield/src/core/textfield-configurator-core.module.ts +++ b/feature-libs/product/configurators/textfield/src/core/textfield-configurator-core.module.ts @@ -1,11 +1,10 @@ import { NgModule } from '@angular/core'; -import { ConfiguratorTextfieldOccModule } from './occ/configurator-textfield-occ.module'; import { ConfiguratorTextfieldStoreModule } from './state/configurator-textfield-store.module'; /** * Exposes the textfield configurator core entities */ @NgModule({ - imports: [ConfiguratorTextfieldStoreModule, ConfiguratorTextfieldOccModule], + imports: [ConfiguratorTextfieldStoreModule], }) export class TextfieldConfiguratorCoreModule {} diff --git a/feature-libs/product/configurators/textfield/src/index.ts b/feature-libs/product/configurators/textfield/src/index.ts index 08bcc1ac436..21415419bb8 100644 --- a/feature-libs/product/configurators/textfield/src/index.ts +++ b/feature-libs/product/configurators/textfield/src/index.ts @@ -1,3 +1,4 @@ export * from './components/index'; export * from './core/index'; +export * from './occ/index'; export * from './textfield-configurator.module'; diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/index.ts b/feature-libs/product/configurators/textfield/src/occ/converters/index.ts similarity index 100% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/index.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/index.ts diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts similarity index 95% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts index 7956c1da2a6..c3ee0c72374 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts +++ b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-add-to-cart-serializer.spec.ts @@ -1,6 +1,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { ConfiguratorTextfield } from '../../model/configurator-textfield.model'; +import { ConfiguratorTextfield } from '../../core/model/configurator-textfield.model'; import { OccConfiguratorTextfieldAddToCartSerializer } from './occ-configurator-textfield-add-to-cart-serializer'; describe('OccConfiguratorTextfieldAddToCartSerializer', () => { diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts similarity index 95% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts index 3402955a538..c70c9768153 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts +++ b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-add-to-cart-serializer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Converter } from '@spartacus/core'; -import { ConfiguratorTextfield } from '../../model/configurator-textfield.model'; +import { ConfiguratorTextfield } from '../../core/model/configurator-textfield.model'; import { OccConfiguratorTextfield } from '../occ-configurator-textfield.models'; export const CONFIGURATOR_TYPE_TEXTFIELD = 'TEXTFIELD'; diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-normalizer.spec.ts b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-normalizer.spec.ts similarity index 94% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-normalizer.spec.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-normalizer.spec.ts index cd30ce6cbb5..34f7f0b1018 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-normalizer.spec.ts +++ b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-normalizer.spec.ts @@ -1,7 +1,7 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { ConverterService } from '@spartacus/core'; -import { ConfiguratorTextfield } from '../../model/configurator-textfield.model'; +import { ConfiguratorTextfield } from '../../core/model/configurator-textfield.model'; import { OccConfiguratorTextfield } from '../occ-configurator-textfield.models'; import { OccConfiguratorTextfieldNormalizer } from './occ-configurator-textfield-normalizer'; diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-normalizer.ts b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-normalizer.ts similarity index 91% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-normalizer.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-normalizer.ts index 545cf7e3c66..a530d610ef1 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-normalizer.ts +++ b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-normalizer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Converter } from '@spartacus/core'; -import { ConfiguratorTextfield } from '../../model/configurator-textfield.model'; +import { ConfiguratorTextfield } from '../../core/model/configurator-textfield.model'; import { OccConfiguratorTextfield } from '../occ-configurator-textfield.models'; @Injectable({ providedIn: 'root' }) diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts similarity index 95% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts index 51215e55c93..790f6b64e0f 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts +++ b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.spec.ts @@ -1,6 +1,6 @@ import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { ConfiguratorTextfield } from '../../model/configurator-textfield.model'; +import { ConfiguratorTextfield } from '../../core/model/configurator-textfield.model'; import { OccConfiguratorTextfieldUpdateCartEntrySerializer } from './occ-configurator-textfield-update-cart-entry-serializer'; describe('OccConfiguratorTextfieldUpdateCartEntrySerializer', () => { diff --git a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts similarity index 95% rename from feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts rename to feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts index b6f0d7cc613..f7e12403ec8 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts +++ b/feature-libs/product/configurators/textfield/src/occ/converters/occ-configurator-textfield-update-cart-entry-serializer.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Converter } from '@spartacus/core'; -import { ConfiguratorTextfield } from '../../model/configurator-textfield.model'; +import { ConfiguratorTextfield } from '../../core/model/configurator-textfield.model'; import { OccConfiguratorTextfield } from '../occ-configurator-textfield.models'; export const CONFIGURATOR_TYPE_TEXTFIELD = 'TEXTFIELD'; diff --git a/feature-libs/product/configurators/textfield/src/core/occ/default-occ-configurator-textfield-config.ts b/feature-libs/product/configurators/textfield/src/occ/default-occ-configurator-textfield-config.ts similarity index 100% rename from feature-libs/product/configurators/textfield/src/core/occ/default-occ-configurator-textfield-config.ts rename to feature-libs/product/configurators/textfield/src/occ/default-occ-configurator-textfield-config.ts diff --git a/feature-libs/product/configurators/textfield/src/core/occ/index.ts b/feature-libs/product/configurators/textfield/src/occ/index.ts similarity index 62% rename from feature-libs/product/configurators/textfield/src/core/occ/index.ts rename to feature-libs/product/configurators/textfield/src/occ/index.ts index 51a1a454c20..8765af7b119 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/index.ts +++ b/feature-libs/product/configurators/textfield/src/occ/index.ts @@ -1,3 +1,3 @@ -export * from './configurator-textfield-occ.module'; export * from './converters/index'; export * from './occ-configurator-textfield.adapter'; +export * from './textfield-configurator-occ.module'; diff --git a/feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.adapter.spec.ts b/feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.adapter.spec.ts similarity index 97% rename from feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.adapter.spec.ts rename to feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.adapter.spec.ts index 278db3ca51e..69069c875ab 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.adapter.spec.ts +++ b/feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.adapter.spec.ts @@ -11,8 +11,8 @@ import { } from '@spartacus/core'; import { GenericConfigurator } from 'projects/core/src/model'; import { OccConfiguratorTextfieldAdapter } from '.'; -import { CONFIGURATION_TEXTFIELD_NORMALIZER } from '../connectors/converters'; -import { ConfiguratorTextfield } from '../model/configurator-textfield.model'; +import { CONFIGURATION_TEXTFIELD_NORMALIZER } from '../core/connectors/converters'; +import { ConfiguratorTextfield } from '../core/model/configurator-textfield.model'; class MockOccEndpointsService { getUrl(endpoint: string, _urlParams?: object, _queryParams?: object) { diff --git a/feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.adapter.ts b/feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.adapter.ts similarity index 93% rename from feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.adapter.ts rename to feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.adapter.ts index 356a391537c..5722df8803b 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.adapter.ts +++ b/feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.adapter.ts @@ -9,13 +9,13 @@ import { } from '@spartacus/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ConfiguratorTextfieldAdapter } from '../connectors/configurator-textfield.adapter'; +import { ConfiguratorTextfieldAdapter } from '../core/connectors/configurator-textfield.adapter'; import { CONFIGURATION_TEXTFIELD_ADD_TO_CART_SERIALIZER, CONFIGURATION_TEXTFIELD_NORMALIZER, CONFIGURATION_TEXTFIELD_UPDATE_CART_ENTRY_SERIALIZER, -} from '../connectors/converters'; -import { ConfiguratorTextfield } from '../model/configurator-textfield.model'; +} from '../core/connectors/converters'; +import { ConfiguratorTextfield } from '../core/model/configurator-textfield.model'; import { OccConfiguratorTextfield } from './occ-configurator-textfield.models'; @Injectable() diff --git a/feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.models.ts b/feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.models.ts similarity index 100% rename from feature-libs/product/configurators/textfield/src/core/occ/occ-configurator-textfield.models.ts rename to feature-libs/product/configurators/textfield/src/occ/occ-configurator-textfield.models.ts diff --git a/feature-libs/product/configurators/textfield/src/core/occ/configurator-textfield-occ.module.ts b/feature-libs/product/configurators/textfield/src/occ/textfield-configurator-occ.module.ts similarity index 90% rename from feature-libs/product/configurators/textfield/src/core/occ/configurator-textfield-occ.module.ts rename to feature-libs/product/configurators/textfield/src/occ/textfield-configurator-occ.module.ts index 5f3aa477038..86a829a3e7c 100644 --- a/feature-libs/product/configurators/textfield/src/core/occ/configurator-textfield-occ.module.ts +++ b/feature-libs/product/configurators/textfield/src/occ/textfield-configurator-occ.module.ts @@ -2,12 +2,12 @@ import { CommonModule } from '@angular/common'; import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { ConfigModule } from '@spartacus/core'; -import { ConfiguratorTextfieldAdapter } from '../connectors/configurator-textfield.adapter'; +import { ConfiguratorTextfieldAdapter } from '../core/connectors/configurator-textfield.adapter'; import { CONFIGURATION_TEXTFIELD_ADD_TO_CART_SERIALIZER, CONFIGURATION_TEXTFIELD_NORMALIZER, CONFIGURATION_TEXTFIELD_UPDATE_CART_ENTRY_SERIALIZER, -} from '../connectors/converters'; +} from '../core/connectors/converters'; import { OccConfiguratorTextfieldAddToCartSerializer } from './converters/occ-configurator-textfield-add-to-cart-serializer'; import { OccConfiguratorTextfieldNormalizer } from './converters/occ-configurator-textfield-normalizer'; import { OccConfiguratorTextfieldUpdateCartEntrySerializer } from './converters/occ-configurator-textfield-update-cart-entry-serializer'; @@ -44,4 +44,4 @@ import { OccConfiguratorTextfieldAdapter } from './occ-configurator-textfield.ad }, ], }) -export class ConfiguratorTextfieldOccModule {} +export class TextfieldConfiguratorOccModule {} diff --git a/feature-libs/product/configurators/textfield/src/textfield-configurator.module.ts b/feature-libs/product/configurators/textfield/src/textfield-configurator.module.ts index bd15d73d793..6dd86b767bb 100644 --- a/feature-libs/product/configurators/textfield/src/textfield-configurator.module.ts +++ b/feature-libs/product/configurators/textfield/src/textfield-configurator.module.ts @@ -6,6 +6,7 @@ import { CmsPageGuard, PageLayoutComponent } from '@spartacus/storefront'; import { ConfiguratorTextfieldFormComponent } from './components/form/configurator-textfield-form.component'; import { TextfieldConfiguratorComponentsModule } from './components/textfield-configurator-components.module'; import { TextfieldConfiguratorCoreModule } from './core/textfield-configurator-core.module'; +import { TextfieldConfiguratorOccModule } from './occ/textfield-configurator-occ.module'; /** * Exposes the textfield configurator, a small configurator that only provides 3 attributes at product level without any dependencies between them, @@ -15,6 +16,7 @@ import { TextfieldConfiguratorCoreModule } from './core/textfield-configurator-c imports: [ TextfieldConfiguratorCoreModule, TextfieldConfiguratorComponentsModule, + TextfieldConfiguratorOccModule, CommonModule, RouterModule.forChild([ { diff --git a/feature-libs/product/configurators/variant/src/core/index.ts b/feature-libs/product/configurators/variant/src/core/index.ts index b416c18b97f..bdcd7de1152 100644 --- a/feature-libs/product/configurators/variant/src/core/index.ts +++ b/feature-libs/product/configurators/variant/src/core/index.ts @@ -1,2 +1 @@ -export * from './occ/index'; export * from './variant-configurator-core.module'; diff --git a/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts b/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts index f74981d7318..b8ee6b5f948 100644 --- a/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts +++ b/feature-libs/product/configurators/variant/src/core/variant-configurator-core.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { ConfiguratorVariantOccModule } from './occ/configurator-variant-occ.module'; + /** * Exposes the variant configurator core entities */ -@NgModule({ imports: [ConfiguratorVariantOccModule] }) +@NgModule() export class VariantConfiguratorCoreModule {} diff --git a/feature-libs/product/configurators/variant/src/index.ts b/feature-libs/product/configurators/variant/src/index.ts index 56e3836daf9..25d3e8d1ea9 100644 --- a/feature-libs/product/configurators/variant/src/index.ts +++ b/feature-libs/product/configurators/variant/src/index.ts @@ -1,5 +1,6 @@ export * from './components/index'; export * from './core/index'; export * from './interactive-configurator.module'; +export * from './occ/index'; export * from './overview-configurator.module'; export * from './variant-configurator.module'; diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/index.ts b/feature-libs/product/configurators/variant/src/occ/converters/index.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/index.ts rename to feature-libs/product/configurators/variant/src/occ/converters/index.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-add-to-cart-serializer.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-add-to-cart-serializer.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.spec.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-normalizer.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.spec.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-normalizer.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-normalizer.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-normalizer.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-normalizer.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-overview-normalizer.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-overview-normalizer.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-overview-normalizer.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-overview-normalizer.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-price-summary-normalizer.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-price-summary-normalizer.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-price-summary-normalizer.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-price-summary-normalizer.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.spec.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-serializer.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.spec.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-serializer.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-serializer.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-serializer.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-serializer.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-update-cart-entry-serializer.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts b/feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts rename to feature-libs/product/configurators/variant/src/occ/converters/occ-configurator-variant-update-cart-entry-serializer.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/default-occ-configurator-variant-config.ts b/feature-libs/product/configurators/variant/src/occ/default-occ-configurator-variant-config.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/default-occ-configurator-variant-config.ts rename to feature-libs/product/configurators/variant/src/occ/default-occ-configurator-variant-config.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/index.ts b/feature-libs/product/configurators/variant/src/occ/index.ts similarity index 82% rename from feature-libs/product/configurators/variant/src/core/occ/index.ts rename to feature-libs/product/configurators/variant/src/occ/index.ts index 615047bd517..77649764850 100644 --- a/feature-libs/product/configurators/variant/src/core/occ/index.ts +++ b/feature-libs/product/configurators/variant/src/occ/index.ts @@ -1,4 +1,4 @@ -export * from './configurator-variant-occ.module'; export * from './converters/index'; export { defaultOccVariantConfiguratorConfigFactory as ɵdefaultOccVariantConfiguratorConfigFactory } from './default-occ-configurator-variant-config'; export * from './occ-configurator-variant.adapter'; +export * from './variant-configurator-occ.module'; diff --git a/feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.spec.ts b/feature-libs/product/configurators/variant/src/occ/occ-configurator-variant.adapter.spec.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.spec.ts rename to feature-libs/product/configurators/variant/src/occ/occ-configurator-variant.adapter.spec.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.ts b/feature-libs/product/configurators/variant/src/occ/occ-configurator-variant.adapter.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/occ-configurator-variant.adapter.ts rename to feature-libs/product/configurators/variant/src/occ/occ-configurator-variant.adapter.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/occ-configurator.models.ts b/feature-libs/product/configurators/variant/src/occ/occ-configurator.models.ts similarity index 100% rename from feature-libs/product/configurators/variant/src/core/occ/occ-configurator.models.ts rename to feature-libs/product/configurators/variant/src/occ/occ-configurator.models.ts diff --git a/feature-libs/product/configurators/variant/src/core/occ/configurator-variant-occ.module.ts b/feature-libs/product/configurators/variant/src/occ/variant-configurator-occ.module.ts similarity index 98% rename from feature-libs/product/configurators/variant/src/core/occ/configurator-variant-occ.module.ts rename to feature-libs/product/configurators/variant/src/occ/variant-configurator-occ.module.ts index fab832e7d0b..dafc16a9dda 100644 --- a/feature-libs/product/configurators/variant/src/core/occ/configurator-variant-occ.module.ts +++ b/feature-libs/product/configurators/variant/src/occ/variant-configurator-occ.module.ts @@ -63,4 +63,4 @@ import { OccConfiguratorVariantAdapter } from './occ-configurator-variant.adapte }, ], }) -export class ConfiguratorVariantOccModule {} +export class VariantConfiguratorOccModule {} diff --git a/feature-libs/product/configurators/variant/src/variant-configurator.module.ts b/feature-libs/product/configurators/variant/src/variant-configurator.module.ts index a84ca989e95..a7af70a763d 100644 --- a/feature-libs/product/configurators/variant/src/variant-configurator.module.ts +++ b/feature-libs/product/configurators/variant/src/variant-configurator.module.ts @@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { VariantConfiguratorCoreModule } from './core/variant-configurator-core.module'; import { InteractiveConfiguratorModule } from './interactive-configurator.module'; +import { VariantConfiguratorOccModule } from './occ/variant-configurator-occ.module'; import { OverviewConfiguratorModule } from './overview-configurator.module'; /** @@ -11,6 +12,7 @@ import { OverviewConfiguratorModule } from './overview-configurator.module'; imports: [ CommonModule, VariantConfiguratorCoreModule, + VariantConfiguratorOccModule, InteractiveConfiguratorModule, OverviewConfiguratorModule, ],